How do I hook Windows desktop folder clicks?
June 27, 2009 2:38 PM Subscribe
I'd like to write a program for Windows XP that detects when a folder on the desktop is clicked and switches the desktop location to that folder, instead of the default Explorer behavior of opening the folder in a window.
posted by long to Computers & Internet (12 answers total) 1 user marked this as a favorite
Roughly, the program will behave like this:
1. User left-clicks folder A on the desktop.
2. Program captures the click, changes the appropriate registry keys, and refreshes the desktop view so that folder A's contents are now displayed on the desktop. (Folder A does not open in an explorer window).
I'm competent at programming, but don't have much experience with the Windows API or hooking. From some googling, I gather that a decent approach is to hook WH_MOUSE_LL, but it seems that detecting whether the clicked object is a folder is non-trivial and potentially kludgey.
Can you advise a general approach that (1) accomplishes the described behavior and (2) isn't too hacky?
Thanks so much,