Change desktop background based on program shortcut
Hi, could anyone give me the general idea on how to implement this feature?
Basically, i want the desktop background to change whenever user place the mouse on program's shortcut.
It's not clicking, just Focusing.
You know, just place your mouse cursor on the shortcut and the background will change.
i.e:
I have a halo 4 game shortcut on my desktop
I place the mouse to that shortcut, and the background will change to halo 4 wallpaper
When i click it the game will run normally.
By default windows shows the location of the program's exe when the shortcut is focused.
I couldn't find the registry files that control this feature, nor the method to tweak windows shortcuts...
thanks before.
Re: Change desktop background based on program shortcut
You have to define "focused". Do you mean just hovering the cursor over the shortcut's text and icon, or actually clicking on it (not double clicking to launch the program)?
Re: Change desktop background based on program shortcut
Quote:
Originally Posted by
cilu
You have to define "focused". Do you mean just hovering the cursor over the shortcut's text and icon, or actually clicking on it (not double clicking to launch the program)?
By focus, I mean hovering the cursor over shortcuts icon, and after set times, 3 sec for example it will change the wallpaper.. by default windows shows the location of the exe file when focused, i want it to be changed to wallpaper change..
Re: Change desktop background based on program shortcut
AFAIK, the easiest way I can think of is to write an infotip shell extension handler ( google for further info ): when you are asked for the tooltip text you also set the desktop background ( but only if the mouse is on the desktop window, of course ). Alternatively (or if you need more control), you'll need to hook the ListView window holding the desktop icons, not a comfortable task though ( consider that you'll need to read from that window process memory in order to retrieve info from the list view ) ...
Re: Change desktop background based on program shortcut
Quote:
Originally Posted by
superbonzo
AFAIK, the easiest way I can think of is to write an infotip shell extension handler ( google for further info ): when you are asked for the tooltip text you also set the desktop background ( but only if the mouse is on the desktop window, of course ). Alternatively (or if you need more control), you'll need to hook the ListView window holding the desktop icons, not a comfortable task though ( consider that you'll need to read from that window process memory in order to retrieve info from the list view ) ...
thanks for the answer,
does this mean i can just find the infotip registry value for specific shortcut?
but is it possible to execute the script (that will change the wallpaper) from infotip handler?
Re: Change desktop background based on program shortcut
Quote:
Originally Posted by
denywinarto
does this mean i can just find the infotip registry value for specific shortcut?
no, it means that you have to write a COM DLL implementing a so called "shell extension handler". Once registered, this will be invoked by Windows whenever a tooltip is required by user action in the shell environment; in your case, when the user hovers the mouse on a desktop icon your handler will be notified of the "focused" file path ( say, the .lnk file ) and the tooltip will be queried, via IPersistFile::Load and IQueryInfo::GetInfoTip, respectively.
IPersistFile::Load should just store the file path and IQueryInfo::GetInfoTip should create a tooltip and modify the desktop background ( or even better, it should send the filename to an auxillary process asynchronously; in this way, any blocking operation ( like, say, disk access for wallpaper searching ) would not make the shell unresponsive; moreover, in this way you could do things like reverting to the original background ( based on a timer or user action ), exposing a system tray icon for advanced user settings, etc ... ).
if you google "infotip shell extension handler" the first result offers a complete example to start from ...