Can keybd_event and mouse_event send user input to a window in a hidden desktop

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: johnny xia (binqiang.xia_at_intel.com)
Date: 07/10/04


Date: Sat, 10 Jul 2004 16:25:43 +0800

Hi All,

In my application I created a desktop, say, the name is "MyDesktop". Then I
started a thread and called SetThreadDesktop() to set the thread's desktop
to "MyDesktop". And then I created a window in this thread. MyDesktop is a
hidden desktop, so the window is invisible to user.

But when my application receives commands from network, I wish to translate
those commands to keyboard and mouse events and send them to that window in
the hidden desktop.

I tried the function keybd_event and mouse_event, it seems that either of
them works. If I called those two functions in main thread, that event will
send to active desktop. But if I called those two functions in the thread of
MyDesktop, the window in MyDesktop receives nothing.

Any idea or hint will be very appreciated. Thanks in advance.

Regards,
Johnny Xia.



Relevant Pages

  • Can keybd_event and mouse_event send user input to a window in a hidden desktop
    ... In my application I created a desktop, say, the name is "MyDesktop". ... And then I created a window in this thread. ... hidden desktop, so the window is invisible to user. ... But when my application receives commands from network, ...
    (microsoft.public.windowsxp.basics)
  • Re: help in upgrade
    ... window to i need to reboot and check the trosubleshoot icon in mydesktop ...
    (microsoft.public.windows.inetexplorer.ie6.browser)