Re: second/third screen preview box
Posted: November 16th, 2015, 12:58 pm
BTW, it just crashed again...
Yeah, for me too. Not sure what's wrong. The code I added is basically doing a !SetVariable bang during the Update to store the new mouse position to those SCREENSHOTMOUSEX/Y vars. I suspect it's something about the execution path there but not sure what's wrong. The actual call to get the mouse should be very safe and fast, so I doubt that's it.jsmorley wrote:BTW, it just crashed again...
Code: Select all
[Rainmeter]
Author=dgrace
AppVersion=2003000
Update=50
Background=#@#Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14
[Metadata]
Description=Test skin for screenshot plugin.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0
Code: Select all
[Rainmeter]
Update=50
Background=#@#Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14
[Metadata]
Author=dgrace
Information=Test skin for screenshot plugin.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0
I'll give it a go...dgrace wrote:Ok one more try. This one seems stable for me so far... (and I updated the plugin version)
dave
So how often are you sending a !SetVariable to Rainmeter? If that is really just "constantly", I could see that being an issue, as I'd be concerned with overrunning the message queue. However, although I could see that being a problem for Rainmeter itself, the fact that it impacts explorer or DWM or something more fundamental is strange.dgrace wrote:Yeah, for me too. Not sure what's wrong. The code I added is basically doing a !SetVariable bang during the Update to store the new mouse position to those SCREENSHOTMOUSEX/Y vars. I suspect it's something about the execution path there but not sure what's wrong. The actual call to get the mouse should be very safe and fast, so I doubt that's it.
Yeah, once per update, even at Update=16, shouldn't be an issue.dgrace wrote:It does it once per update, so it depends on the update rate of the skin, but I wouldn't think setting a variable even 20x a second should be any kind of big deal. I still suspect it's something about the skin update running on one thread and the ExecuteCommand running on a different one. Maybe I'll try to think of a different way to do it tomorrow.
dave
I'm doing this inside the Reload() of the plugin:jsmorley wrote:Crashed and burned again....
You mentioned something about "execution path". I assumed you are using this:
http://docs.rainmeter.net/developers/#SendMessage
And not just a call to Rainmeter.exe with the bang as a parm?
Edit: Maybe that doesn't matter in the context of a plugin, where you are already "connected" to the calling skin.
Code: Select all
// update absolute mouse position vars
CURSORINFO cinfo; cinfo.cbSize = sizeof(CURSORINFO);
void* skin;
if(
GetCursorInfo(&cinfo)
&& ((skin=RmGetSkin(rm)) != nullptr)
) {
static WCHAR s_cmdX[64];
wsprintf(s_cmdX, L"!SetVariable SCREENSHOTMOUSEX %ld", cinfo.ptScreenPos.x);
RmExecute(skin, s_cmdX);
static WCHAR s_cmdY[64];
wsprintf(s_cmdY, L"!SetVariable SCREENSHOTMOUSEY %ld", cinfo.ptScreenPos.y);
RmExecute(skin, s_cmdY);
}