How to use WM_MESSAGES on headless WEC7 device? RRS feed

  • Question

  • Hi,

    Even tough I have included the "Minimal GWES Configuration" and "Minimal Input Configuration" (SYSGEN_MINGWES resp. SYSGEN_MININPUT) components in my headless OS image (BSP_NODISPLAY), I still can't create an "invisible window" and process windows messages (for instance WM_CLOSE).

    According to the WEC7 help this will give me "Minimal GWES Configuration, which supports basic windowing and message queuing" resp. "Minimal Input Configuration, which supports keyboard input".

        hWnd = CreateWindow(szWindowClass, szTitle, WS_DISABLED,

        if (!hWnd)
            _tprintf(_T("Failed to CreateWindow() err:0x%08x\r\n"), GetLastError());
            return FALSE;

    Generates the output: Failed to CreateWindow() err:0x00000078 -> ERROR_CALL_NOT_IMPLEMENTED

    Is someone going to implement the CreateWindow() function anytime soon? :-) Or am I missing something here?


    • Edited by JoeSixpack Wednesday, May 9, 2012 12:58 PM
    Wednesday, May 9, 2012 12:55 PM

All replies

  • If you include minimum GWES most of the GWES functions are stubbed and you'll get ERROR_CALL_NOT_IMPLEMENTED when you call them

    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom Check my blog:

    Wednesday, May 9, 2012 2:01 PM
  • Hi Luca,

    So what you are saying is that you can not use WM_MESSAGES on a headless device, and for instance process keyboard input? Or post a WM_CLOSE to applications/windows on power down, for a graceful shutdown. Surely there must be a way to do this other than implementing it yourself?

    /Robster Melobster

    • Edited by JoeSixpack Wednesday, May 9, 2012 3:24 PM
    Wednesday, May 9, 2012 3:21 PM
  • You need the messaging system in order to process messages. There are few instances in the real world where keyboard and mouse make sense, but windowing does not. Microsoft made a choice and it bites you. How would you have an application/window without GWES? No GWES ==> no window ==> no need to send a WM_CLOSE message.

    It seems that you should be using some version of GWES. You can use a null display driver with minimal-GWES (or even the full windowing system) in your device. I've done this with a device not containing any graphical display because it saves a lot of work when configuring WiFi adapters, setting up services, performing control panel operations, etc. You can use a remote display viewer running on a PC to perform the graphical configuration. Here, a front-most application that aggressively makes itself the focus will get all keyboard input and can be your main application. You can send it a WM_CLOSE and the normal message processing will occur.

    Paul T.

    Tuesday, May 29, 2012 3:32 PM
  • An interesting way to do it. What components are needed in the OS for WH_KEYBOARD_LL to work (how up-market a kernel is needed)?

    Paul T.

    Wednesday, May 30, 2012 5:49 PM