Jump to content

Window style properties


 Share

Recommended Posts

I am new to using Autoit, but I have been able to get some nice scripts working with the existing examples and the help files. However, there is one feature / function that I am trying to incorporate into my script that I have as yet to be able to figure out how to implement.

The Window Info tool shows both Style and ExStyle properties for existing windows as you switch from one app to the next. This style information provides something that I need to access for certain applications where I want to know if the app is running as a window or if the app is running full screen (i.e. without a border). I have used the window info tool to determine what style value would indicate which mode the app is running in, but I have yet to find a comparable funtion within the scripting capabilities of Autoit. I see that these style properties can be set for new windows that are being created by the script, but I do not see a way to inspect the properties for windows that are being created by other apps.

Any thoughts or insight into how this might be accomplished would be greatly appreciated.

Thanks in advance.

izy

Link to comment
Share on other sites

WinGetState() allows you to find out if the window in question is maximized or minimized.

Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt
Link to comment
Share on other sites

WinGetState() allows you to find out if the window in question is maximized or minimized.

So I would have thought, however, on the app that I am experimenting on it does not show the property that I am looking for. Essentially, the app is running "full screen" and not maximized and apparently there is a difference... So, "full screen" has no border (i.e. a DVD movie playing app or a game or something similar), but is not necessarilly considered maximized...

So, I am looking to get at the same information that Window Info utility extracts...

Edited by izy
Link to comment
Share on other sites

GetWindowLong

as in...

$hwnd = WinGetHandle("Untitled - Notepad")

$aStyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hwnd, "int", -16)

$aExStyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hwnd, "int", -20)

MsgBox(0, "", "Style="&Hex($aStyle[0])&@cr&"ExStyle="&Hex($aExStyle[0]))

Edited by Siao

"be smart, drink your wine"

Link to comment
Share on other sites

GetWindowLong

as in...

$hwnd = WinGetHandle("Untitled - Notepad")

$aStyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hwnd, "int", -16)

$aExStyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hwnd, "int", -20)

MsgBox(0, "", "Style="&Hex($aStyle[0])&@cr&"ExStyle="&Hex($aExStyle[0]))

Excellent. Thanks, that gets me exactly what I was looking for and exposes me to some more advanced capabilities of Autoit at the same time...

Cheers,

izy

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...