| Detecting Window Resize | 
| Author: | Message: | 
| Spunky Former Super Mod
 
      
 
  
 Posts: 3656
 Reputation: 61
 37 /
  /  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"   | 
 | 
| 10-31-2006 04:11 PM |  | 
|  | 
| RaceProUK Elite Member
 
      
 
  
 Posts: 6070
 Reputation: 57
 40 /
  /  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. | 
 | 
| 10-31-2006 10:48 PM |  | 
|  | 
| Spunky Former Super Mod
 
      
 
  
 Posts: 3656
 Reputation: 61
 37 /
  /  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   <Eljay> "Problems encountered: shit blew up"   | 
 | 
| 10-31-2006 10:57 PM |  | 
|  | 
| deAd Scripting Contest Winner
 
      
 
  
 Posts: 1060
 Reputation: 28
 – /
  /  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
  
 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.  This post was edited on 10-31-2006 at 11:02 PM by deAd.
 | 
 | 
| 10-31-2006 11:01 PM |  | 
|  | 
| RaceProUK Elite Member
 
      
 
  
 Posts: 6070
 Reputation: 57
 40 /
  /  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. | 
 | 
| 10-31-2006 11:18 PM |  | 
|  | 
| deAd Scripting Contest Winner
 
      
 
  
 Posts: 1060
 Reputation: 28
 – /
  /  Joined: Jan 2006
 
 | | RE: Detecting Window Resize quote:Originally posted by RaceProUK
 
 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.Originally posted by deAd
 Use a timer (100 ms interval for fastest detection)
 
 
 True, but I was simply suggesting a way to do it without DLLs. I never said it was a good approach   | 
 | 
| 10-31-2006 11:44 PM |  | 
|  | 
| Spunky Former Super Mod
 
      
 
  
 Posts: 3656
 Reputation: 61
 37 /
  /  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.   <Eljay> "Problems encountered: shit blew up"   | 
 | 
| 10-31-2006 11:46 PM |  | 
|  | 
| deAd Scripting Contest Winner
 
      
 
  
 Posts: 1060
 Reputation: 28
 – /
  /  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.
  
 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 |  | 
|  | 
| CookieRevised Elite Member
 
      
 
  
 Posts: 15494
 Reputation: 173
 – /
  /  Joined: Jul 2003
 Status: Away
 
 | | RE: Detecting Window Resize quote:Originally posted by SpunkyLoveMuff
 
 quote:Messenger doesn't run on my PC (checked processes too)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.
 
 
 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 |  | 
|  | 
| Spunky Former Super Mod
 
      
 
  
 Posts: 3656
 Reputation: 61
 37 /
  /  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"   | 
 | 
| 11-01-2006 04:45 PM |  | 
|  | 
| Pages: (2): 
« First
  
 [ 1 ]
 2
 
»
 
Last » | 
|  |