Detecting Window Resize - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: Detecting Window Resize (/showthread.php?tid=67900) Detecting Window Resize by Spunky on 10-31-2006 at 04:11 PM Is there any way to detect this as an event or just have something check? I wan't it to check for when the contact list is resized. I think I could possibly use the Messenger API, but I want to avoid this if it's possible. Else I think this may be my only alternative RE: Detecting Window Resize by RaceProUK on 10-31-2006 at 10:48 PM Detecting a window resize is not possible via the Messenger API. What you need to use is a Windows Message Hook, both the CallWndProc and GetMessage types, and look for window messages such as WM_SIZE. RE: Detecting Window Resize by Spunky on 10-31-2006 at 10:57 PM
quote: Thanks for the help and info on where I should start. I'll try it. I was going to use the Messenger API to get the width, and then check it with a timer... so it kinda was possible RE: Detecting Window Resize by deAd on 10-31-2006 at 11:01 PM
A simpler way using just scripts: quote:That would've worked, except the Messenger API would (1) take a while to initialize, (2) make Windows Messenger run, (3) not be the fastest way to get the width, and (4) not even work all the time. RE: Detecting Window Resize by RaceProUK on 10-31-2006 at 11:18 PM
quote:OMFG ewwww! Do you have any idea how goddam slow polling can be? Using that much effort just to check a window size: it's a total waste of CPU cycles. That's why I suggested window messages. They are much more efficient, as they're designed as an event-reponse mechanism. RE: Detecting Window Resize by deAd on 10-31-2006 at 11:44 PM
quote:True, but I was simply suggesting a way to do it without DLLs. I never said it was a good approach RE: Detecting Window Resize by Spunky on 10-31-2006 at 11:46 PM
quote: Messenger doesn't run on my PC (checked processes too) quote: It doesn't use DLLs it uses API calls. RE: Detecting Window Resize by deAd on 10-31-2006 at 11:53 PM
quote:You'll need DLLs because you can't get/pass a function pointer. RE: Detecting Window Resize by CookieRevised on 11-01-2006 at 04:19 PM
quote:it is "Windows Messenger"..., not "msn messenger", nor "windows live messenger". It will run when you invoke the Messenger API. RE: Detecting Window Resize by Spunky on 11-01-2006 at 04:45 PM
quote: I know, it does not run on my PC... Don't know why. There is not a single instance of it. Yet I can open it through the shortcut etc. RE: Detecting Window Resize by RaceProUK on 11-01-2006 at 06:53 PM It depends exactly how the API is instantiated. If it's via CreateObject() or similar, Windows Messenger will run. Other means won't necessarily do that. RE: Detecting Window Resize by Spunky on 11-01-2006 at 06:57 PM
code: Thats how I'm calling it... Doesn't seem to do any harm RE: Detecting Window Resize by vikke on 11-01-2006 at 07:07 PM Spunky: You'll need CALLBACK function in your hook procedure (it's the Windows Message Event). To create that, you'll need a dll. That's why scripting can't hook without a dll. RE: RE: Detecting Window Resize by CookieRevised on 11-02-2006 at 01:33 AM
quote:It also isn't the complete Messenger API but only a very small part of it. |