Jump to content



Photo

[SOLVED] WinGetPos not returning consistent results.


  • Please log in to reply
2 replies to this topic

#1 jaberwocky6669

jaberwocky6669

    Dull light.

  • Active Members
  • PipPipPipPipPipPip
  • 2,080 posts

Posted 19 June 2012 - 12:50 AM

I have WinGetPos("Name of Script") in a script to tell me the size of the window height upon exit. However, a different height is returned even though I haven't resized the gui. Have any of you run across this issue? I'm using 3.3.9.4 on Win7 Pro 64. When I use this syntax WinGetPos("Name of Script")[3] then I use alpha 3.3.9.5. To clarify, every time I close the script the height returned by the function keeps growing larger by about twenty pixels.

Edited by LaCastiglione, 19 June 2012 - 01:50 PM.








#2 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 19 June 2012 - 01:14 AM

When you create a window, your dimensions don't include the title bar, when you resize it according to what WinGetPos gives you (which includes the title bar) it makes the new window 20 pixels larger because your dimensions of the client area is being resized to the actual window size instead of just the client area. At least that's how I believe it is working, I've encountered this before.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#3 jaberwocky6669

jaberwocky6669

    Dull light.

  • Active Members
  • PipPipPipPipPipPip
  • 2,080 posts

Posted 19 June 2012 - 01:34 AM

Ahhh, yes. That would explain it! Okies, so just minus twenty from the return value. Thanks bunches BrewManNH.

Edit: I'm trying to make a script that remembers the last height and so I minus 38 from the result of WinGetPos and that did the trick just fine.

Edited by LaCastiglione, 19 June 2012 - 01:42 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users