What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Detecting Window Resize

Pages: (2): « First [ 1 ] 2 » Last »
Detecting Window Resize
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. Detecting Window Resize
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
<Eljay> "Problems encountered: shit blew up" :zippy:
10-31-2006 04:11 PM
Profile PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Detecting Window Resize
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.
[Image: spartaafk.png]
10-31-2006 10:48 PM
Profile PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. RE: Detecting Window Resize
quote:
Originally posted by RaceProUK
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.

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 :p
<Eljay> "Problems encountered: shit blew up" :zippy:
10-31-2006 10:57 PM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: Detecting Window Resize
A simpler way using just scripts:

Use a timer (100 ms interval for fastest detection) and the
GetWindowRect function to check for changes. When the contact list is destroyed (there's an event) stop all timers and don't create new ones. When it's created resume timing.

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 :p
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. :P

This post was edited on 10-31-2006 at 11:02 PM by deAd.
10-31-2006 11:01 PM
Profile PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Detecting Window Resize
quote:
Originally posted by deAd
Use a timer (100 ms interval for fastest detection)
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.
[Image: spartaafk.png]
10-31-2006 11:18 PM
Profile PM Web Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: Detecting Window Resize
quote:
Originally posted by RaceProUK
quote:
Originally posted by deAd
Use a timer (100 ms interval for fastest detection)
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.
True, but I was simply suggesting a way to do it without DLLs. I never said it was a good approach :P
10-31-2006 11:44 PM
Profile PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. RE: Detecting Window Resize
quote:
Originally posted by deAd
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.

Messenger doesn't run on my PC (checked processes too)


quote:
Originally posted by deAd
True, but I was simply suggesting a way to do it without DLLs. I never said it was a good approach 

It doesn't use DLLs it uses API calls. :p
<Eljay> "Problems encountered: shit blew up" :zippy:
10-31-2006 11:46 PM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: Detecting Window Resize
quote:
Originally posted by SpunkyLoveMuff
quote:
Originally posted by deAd
True, but I was simply suggesting a way to do it without DLLs. I never said it was a good approach 

It doesn't use DLLs it uses API calls. :p
You'll need DLLs because you can't get/pass a function pointer.

This post was edited on 10-31-2006 at 11:54 PM by deAd.
10-31-2006 11:53 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Detecting Window Resize
quote:
Originally posted by SpunkyLoveMuff
quote:
Originally posted by deAd
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.
Messenger doesn't run on my PC (checked processes too)
it is "Windows Messenger"..., not "msn messenger", nor "windows live messenger". It will run when you invoke the Messenger API.

This post was edited on 11-01-2006 at 04:19 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-01-2006 04:19 PM
Profile PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. RE: Detecting Window Resize
quote:
Originally posted by CookieRevised
it is "Windows Messenger"..., not "msn messenger", nor "windows live messenger". It will run when you invoke the Messenger API.

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.
<Eljay> "Problems encountered: shit blew up" :zippy:
11-01-2006 04:45 PM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On