Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Get Window default Size and Position


  • Please log in to reply
6 replies to this topic

#1 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,400 posts

Posted 22 November 2011 - 10:56 AM

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







#2 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,375 posts

Posted 22 November 2011 - 11:03 AM

Have you looked at _WinAPI_GetClientRect?

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

Edited by guinness, 22 November 2011 - 11:06 AM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 26/09/2014


#3 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,400 posts

Posted 22 November 2011 - 11:07 AM

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, 22 November 2011 - 11:08 AM.


#4 Manadar

Manadar

         

  • MVPs
  • 10,846 posts

Posted 22 November 2011 - 11:25 AM

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, 22 November 2011 - 11:27 AM.


#5 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,400 posts

Posted 22 November 2011 - 12:19 PM

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.

#6 lesolutionneur

lesolutionneur

    Seeker

  • Active Members
  • 35 posts

Posted 28 April 2012 - 11:31 PM

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 ;)

#7 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 12,689 posts

Posted 18 June 2012 - 12:29 AM

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
 
 
OMG! Women are the cows of people.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users