BackHomeAgain Posted April 6, 2010 Share Posted April 6, 2010 Is there some way to return window attributes that has information about frames/borders and if they can be re-sized? For example, if I were to select the active window, can I find that information? I want to determine if a given window is re-sizeable or not and which borders. I know that MouseGetCursor can provide some information. Link to comment Share on other sites More sharing options...
blakel Posted April 6, 2010 Share Posted April 6, 2010 You could try resizing with WinMove and then see if was successful with WinGetPos. Link to comment Share on other sites More sharing options...
blakel Posted April 6, 2010 Share Posted April 6, 2010 (edited) This may work. Get the size of the window with WinGetPos and subtract WinGetState WinGetClientSize. That may give you how thick the border is, if that is what you are looking for.Edit: Sorry wrong function Edited April 6, 2010 by blakel Link to comment Share on other sites More sharing options...
KaFu Posted April 6, 2010 Share Posted April 6, 2010 A true (>0) return means the window has the style set... #Include <WinAPI.au3> #Include <Constants.au3> #Include <WindowsConstants.au3> $hwnd_style = _WinAPI_GetWindowLong(WinGetHandle("[active]"), $GWL_STYLE) ConsoleWrite(BitAND($hwnd_style,$WS_POPUP) & @crlf) ConsoleWrite(BitAND($hwnd_style,$WS_SIZEBOX) & @crlf) ConsoleWrite(BitAND($hwnd_style,$WS_SYSMENU) & @crlf) ConsoleWrite(BitAND($hwnd_style,$DS_CONTEXTHELP) & @crlf) $WS_SIZEBOX = "Creates a window that has a sizing border. Same as the WS_THICKFRAME style." OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
BackHomeAgain Posted April 10, 2010 Author Share Posted April 10, 2010 A true (>0) return means the window has the style set... #Include <WinAPI.au3> #Include <Constants.au3> #Include <WindowsConstants.au3> $hwnd_style = _WinAPI_GetWindowLong(WinGetHandle("[active]"), $GWL_STYLE) ConsoleWrite(BitAND($hwnd_style,$WS_POPUP) & @crlf) ConsoleWrite(BitAND($hwnd_style,$WS_SIZEBOX) & @crlf) ConsoleWrite(BitAND($hwnd_style,$WS_SYSMENU) & @crlf) ConsoleWrite(BitAND($hwnd_style,$DS_CONTEXTHELP) & @crlf) $WS_SIZEBOX = "Creates a window that has a sizing border. Same as the WS_THICKFRAME style." Thanks for the information. It was very helpful. Another question? How can a MsgBox be identified when it is the active window? Link to comment Share on other sites More sharing options...
picea892 Posted April 10, 2010 Share Posted April 10, 2010 I believe all Msgbox's have a class of #32770 Link to comment Share on other sites More sharing options...
BackHomeAgain Posted April 12, 2010 Author Share Posted April 12, 2010 I believe all Msgbox's have a class of #32770I thought of that, but other windows also use class #32770.For example "Windows Task Manager".There must be some unique attribute that separates MsgBox windows from others? Link to comment Share on other sites More sharing options...
KaFu Posted April 12, 2010 Share Posted April 12, 2010 Compare the styles with au3info.exe... maybe there's special style set unique to msgbox. Detect #32770 windows and check style with the function mentioned above. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
BackHomeAgain Posted April 13, 2010 Author Share Posted April 13, 2010 Compare the styles with au3info.exe... maybe there's special style set unique to msgbox. Detect #32770 windows and check style with the function mentioned above.Window Extended style(EXStyle) 0x00010101 appears to be common to the MsgBox windows.But, there is no Global Const that matches the value in WindowsConstants.au3How did au3info.exe obtain this parameter? Link to comment Share on other sites More sharing options...
KaFu Posted April 13, 2010 Share Posted April 13, 2010 (edited) But, there is no Global Const that matches the value in WindowsConstants.au3 No need to know what it actually means ... #include <WinAPI.au3> #include <Constants.au3> HotKeySet("{ESC}", "_Exit") While 1 Sleep(25) $aHwnd = WinList("[CLASS:#32770;]", "") For $i = 1 To $aHwnd[0][0] If BitAND(WinGetState($aHwnd[$i][1]), 2) Then If _WinAPI_GetWindowLong($aHwnd[$i][1], $GWL_EXSTYLE) = 0x00010101 Then MsgBox(0, "", "MsgBox detected..." & @CRLF & WinGetTitle($aHwnd[$i][1])) EndIf EndIf Next WEnd Func _Exit() Exit EndFunc ;==>_Exit Edit: And actually they are there: #include <WindowsConstants.au3> ConsoleWrite(bitor($WS_EX_CONTROLPARENT,$WS_EX_DLGMODALFRAME,$WS_EX_WINDOWEDGE) & @crlf) ConsoleWrite(0x00010101 & @crlf) Edit2: Closing SciTE the save message popped up as a msgbox alert... so maybe you'll have to add another layer by checking if only one button control is present in msgbox? Be as specific as possible ... Edited April 13, 2010 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now