Jump to content
Macro Express Forums

Use reg change as a trigger?


Recommended Posts

Hi All,

Does anyone know if it's possible to use "wallpaper has been changed" as a trigger for a macro?

Googling has lead me to the REG_SZ key "HKEY_CURRENT_USER/Control Panel/Desktop/Wallpaper."

Also, I see the following trigger option:

og7LGQ.png

 

Any thoughts on what to try next?

I use the excellent BGInfo

https://technet.microsoft.com/en-us/library/bb897557.aspx

and would like it to be updated whenever right-click an image and use "Set as desktop wallpaper."

 

(Note: I'm not 100% sure that watching for changes in this key will work.)

 

Link to comment
Share on other sites

There's probably a way to do it using Windows System Messages. Besides that I think that a macro running on a schedule to check periodically would be the only other way.

 

In the past I've had 1 macro that checks several things for the user and if something changes runs another macro. Set it to run every minute. That way I only needed one macro to run on a schedule.

Link to comment
Share on other sites

Thanks for the reply Cory.

I'm hesitant to use a periodic loop to look for things, simply because I already have so many goodies running in the background on my computer. Don't want to strain the system. I'm curious if your above-mentioned one caused any noticeable performance lag? I guess the activation of the macro, per se, would be smooth, but depending on what the different things that macro looked for, there could be a lag (?) Anyway, for now, I've made a trigger that simply looks for when xyplorer.exe is closed. That's usually what I browse pictures with. I get lots of superfluous triggering though, because I use xyplorer for other stuff too. I might see about setting up a trigger that looks for certain keywords in window titles. (Pictures, Images, Wallpapers) It looks like that might require three separate macros though (each one calling my BGInfo macro). I'll post back if I ever get a good working solution.

Link to comment
Share on other sites

I believe you expressed a common concern for new macro developers with regards to performance. It seems that doing something like this would be a burden but in reality your demands on the registry in a case like this are nil. The registry is being hammers thousands of times a second most of the time. And although it's true that it's a DAT file on your hard drive the entire database resides in memory with a very smart and efficient program to manage these requests. You can hammer the registry a hundred times a second and i doubt you would notice an effect on your computer's responsiveness. And in all likelihood you probably only need to check once a second.

Link to comment
Share on other sites

https://msdn.microsoft.com/en-us/library/aa393035.aspx

Or we can set you up with a VBScript to do this. Or if you're interested I could write a primitive .NET app for you using WMI that could run in the background on log in. I could then have it launch macros or we could find some other way to notify Macro Express.

Link to comment
Share on other sites

Wow cool. Thanks Cory. I'd hate for you to burn your time on this.... If you do though, maybe go with the VBScript option, that way people could change what reg key it looks for and thus the script could be used by other people as well(??)

Here's another question though: If I'm having a VBScript running in the background anyway, should I just go ahead with the once-per-minute looping marco you suggested?

Link to comment
Share on other sites

Since you don't need the instantaneous nature of an event trigger I'd just make a macro. But don't loop it. Activate it on a schedule. Use the When a specified time has elapsed option. Have it run once a minute or whatever you like. Note that you can use the range to avoid it running in the middle of the night or such.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...