Sign in to follow this  
Followers 0

Get Window default Size and Position

7 posts in this topic

#1 ·  Posted

Hiho,

does anyone know if there is a way to get the default Size and Position of a Window (used during the CreateWindow call)?

Best Regards

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Have you looked at _WinAPI_GetClientRect?

Ref: http://stackoverflow.com/questions/61555...-and-height-from-createwindowe

Edited by guinness

UDF List:

 

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

 

 

Updated: 02/04/2015

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

This one returns the current Size and Position, I'm looking for a way to retrieve the default / initial values. As far as I can see it's not possible to obtain these values, seems like they're not stored anywhere accessible :D...

Edited by KaFu

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

1) This is an option which users can set. Windows keeps track of the window size and location on a per-window basis, might also be per-application basis.

2) If this option is enabled, the data is stored somewhere in the registry.

Tip: CCleaner can delete these registry values for you. If you enable this as the only option in CCleaner, it will tell you which registry keys it has deleted. From there it is probably much easier to figure out a way to read the values yourself.

Edit: http://support.microsoft.com/kb/235994/en-us Not sure if relevant.

Edited by Manadar

Share this post


Link to post
Share on other sites

#5 ·  Posted

Thanks for this hint. As far as I can see these registry values contain size & position of OS related windows like explorer and control panel windows only. Also I found a ref that this has been changed in Vista+, so I guess no luck here.

Share this post


Link to post
Share on other sites

#6 ·  Posted

I've the solution for you:

-download regshot

-install it

-make a first snapshot changing directory to C:/ (and stop all process that could modify the registry as AVs)

-open the program, move the window

-make a second snapshot

-compare

-see what has been modified and where and if it is the window's position then you found it ;)

Share this post


Link to post
Share on other sites

#7 ·  Posted

If you were to create a hidden window with that call, using the CW_USEDEFAULT constant for x,y,w,h

and used wingetpos, would that not give you the default position?


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0