Post(Thread)Message() and System-wide hooks
-
Hello:) I've already posted those questions but it was Sunday night so probably nobody had seen it;) I have a DLL which installs system wide hook using SetWindowsHookEx(WH_Mouse,...), can I use normal PostMessage(main_application_hwnd_handle,...) to inform my application about some event which happend inside this DLL?? I tried it, but it seems not working. PostThreadMessage(main_application_thread_id,...) works fine. In MSDN I couldn't find any information that HWND handle in PostMessage() should belong to the calling process/thread...? My second question is, how to capture LVM_HITTEST messages, I mean which hook could I use to capture system wide LVM_HITTEST messages? I need also WM_LMOUSEDBLCLK messages which I capture using WH_MOUSE hook. Is it possible to capture those two messages using only one hook? I've partialy solved this problem by sending LVM_HITTEST message to the hooked window from the WH_MOUSE hook, but I don't think it's 'clean' and for sure it generates additional performance hit... Last question - how to find (in a 'safe and compatible way') HWND to the desktop window "FolderView" of class "SysListView32"? It has a handle 0x10094 but I think I can't hardcode it to my application... Now I use: HWND h1=::FindWindowEx(NULL,NULL,"Progman","Program Manager"); HWND h2=::FindWindowEx(h1,NULL,"SHELLDLL_DefView",NULL); m_hwnd_desktop=::FindWindowEx(h2,NULL,"SysListView32",NULL); is it safe? (single m_hwnd_desktop=::FindWindowEx(NULL,NULL,"SysListView32","FolderView") returns NULL..?!?) Thanks for any help (and thanks to Naveen R for answering my previous question at 5 o'clock;) Pat.