Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Post(Thread)Message() and System-wide hooks

Post(Thread)Message() and System-wide hooks

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionperformancetutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PatrykDabrowski
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups