Jump to content



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,422 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

[font="tahoma, geneva, sans-serif;"]Posted Image [color=#4a5a74;]OS: Win8.1 - 64bit - German, AutoIt Version: 3.3.8.1, AutoIt Editor: SciTE, Website: [color=#0000ff;]http://www.funk.eu[/color], [color=#4a5a74;]My unsolved Questions:[/color] Get default Window Size and Position, [font="Tahoma;"]Rotate display by 270 degrees[/color][font="Tahoma;"][color=#4a5a74;], [/color][/font]Get Systray Icons, ... [/font]Posted Image AMT - Auto-Movie-Thumbnailer (2014-Sep-06) Posted Image COP - Color Picker (2009-May-21) [/font][font="tahoma, geneva, sans-serif;"]Posted Image HMW - Hide my Windows (2013-Dec-08)[/font][font="tahoma, geneva, sans-serif;"] Posted Image HRC - HotKey Resolution Changer (2012-May-16) [/font]Posted Image[font="tahoma, geneva, sans-serif;"] [/font]ICU - Icon Configuration Utility (2013-May-24)[font="tahoma, geneva, sans-serif;"] [/font]Posted Image[font="tahoma, geneva, sans-serif;"] [/font]SMF - Search my Files (2014-Sep-06) - THE file info and duplicates search tool[font="tahoma, geneva, sans-serif;"] [/font]Posted Image[font="tahoma, geneva, sans-serif;"] [/font]SSD - Set Sound Device (2013-Oct-18)








#2 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 18,135 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()_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()CodingDirToHTML5FileInstallrGeoIP 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: 30/03/2015


#3 KaFu

KaFu

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

  • MVPs
  • 3,422 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.

[font="tahoma, geneva, sans-serif;"]Posted Image [color=#4a5a74;]OS: Win8.1 - 64bit - German, AutoIt Version: 3.3.8.1, AutoIt Editor: SciTE, Website: [color=#0000ff;]http://www.funk.eu[/color], [color=#4a5a74;]My unsolved Questions:[/color] Get default Window Size and Position, [font="Tahoma;"]Rotate display by 270 degrees[/color][font="Tahoma;"][color=#4a5a74;], [/color][/font]Get Systray Icons, ... [/font]Posted Image AMT - Auto-Movie-Thumbnailer (2014-Sep-06) Posted Image COP - Color Picker (2009-May-21) [/font][font="tahoma, geneva, sans-serif;"]Posted Image HMW - Hide my Windows (2013-Dec-08)[/font][font="tahoma, geneva, sans-serif;"] Posted Image HRC - HotKey Resolution Changer (2012-May-16) [/font]Posted Image[font="tahoma, geneva, sans-serif;"] [/font]ICU - Icon Configuration Utility (2013-May-24)[font="tahoma, geneva, sans-serif;"] [/font]Posted Image[font="tahoma, geneva, sans-serif;"] [/font]SMF - Search my Files (2014-Sep-06) - THE file info and duplicates search tool[font="tahoma, geneva, sans-serif;"] [/font]Posted Image[font="tahoma, geneva, sans-serif;"] [/font]SSD - Set Sound Device (2013-Oct-18)


#4 Manadar

Manadar

         

  • MVPs
  • 10,933 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.

[color=#555555;]josvanegmond.nl, [/color]github.com/jvanegmond


#5 KaFu

KaFu

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

  • MVPs
  • 3,422 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.

[font="tahoma, geneva, sans-serif;"]Posted Image [color=#4a5a74;]OS: Win8.1 - 64bit - German, AutoIt Version: 3.3.8.1, AutoIt Editor: SciTE, Website: [color=#0000ff;]http://www.funk.eu[/color], [color=#4a5a74;]My unsolved Questions:[/color] Get default Window Size and Position, [font="Tahoma;"]Rotate display by 270 degrees[/color][font="Tahoma;"][color=#4a5a74;], [/color][/font]Get Systray Icons, ... [/font]Posted Image AMT - Auto-Movie-Thumbnailer (2014-Sep-06) Posted Image COP - Color Picker (2009-May-21) [/font][font="tahoma, geneva, sans-serif;"]Posted Image HMW - Hide my Windows (2013-Dec-08)[/font][font="tahoma, geneva, sans-serif;"] Posted Image HRC - HotKey Resolution Changer (2012-May-16) [/font]Posted Image[font="tahoma, geneva, sans-serif;"] [/font]ICU - Icon Configuration Utility (2013-May-24)[font="tahoma, geneva, sans-serif;"] [/font]Posted Image[font="tahoma, geneva, sans-serif;"] [/font]SMF - Search my Files (2014-Sep-06) - THE file info and duplicates search tool[font="tahoma, geneva, sans-serif;"] [/font]Posted Image[font="tahoma, geneva, sans-serif;"] [/font]SSD - Set Sound Device (2013-Oct-18)


#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

    Number #1

  • Active Members
  • PipPipPipPipPipPip
  • 14,305 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    Pause Script     Monkey's are, like, natures humans.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users