Jump to content

AU3GUI magically broke...


Valik
 Share

Recommended Posts

Larry, does CheckGUI.au3 (or any other GUI with WS_CAPTION + WS_POPUP) create a titleless/borderless window for you, too? If so, think it has anything to do with AutoIt using doubles now instead of ints? I updated a script that used AU3GUI but now the window is borderless (Removing WS_POPUP seems to fix it and that's a rather large number...).

Link to comment
Share on other sites

AutoIt3 seems to function correctly... perhaps $WS_POPUP is wrong...  I forget...

For my script, I looked it up in the Windows header file and converted it to decimal myself and it's the same was what you have. The thing is, it worked before (The last version of AutoIt 3 I compiled it with was 3.0.77). Now, trying to run it with 3.0.84, the WS_POPUP style is causing problems. I thought maybe it was because AutoIt was using doubles internally, that was the only big change I could think of. I don't know what the problem is now.
Link to comment
Share on other sites

Alrighty, I figured out how to "fix" whatever the problem I had. I found two solutions:

First, easy one, instead of converting the styles to their decimal equivalent, just use the hex values since AutoIt supports hex now:

$WS_POPUP = 0x80000000

$WS_CAPTION = 0x00C00000

EnvSet("GUI.style", $WS_POPUP + $WS_CAPTION)

Second one makes sense, but is clunky because BitOR is a function and not an operator, but using BitOR works with either decimal or hex values.

$WS_POPUP = 2147483648 ; or $WS_POPUP = 0x80000000

$WS_CAPTION = 12582912 ; or $WS_CAPTION = 0x00C00000

EnvSet("GUI.style", BitOR($WS_POPUP, $WS_CAPTION))

The second method will get ugly with more than 2 styles being used since you'll either have a bunch of nested BitOR calls or have to store the results of each call somewhere and make multiple calls.

This does not work, and it did work in previous versions of AutoIt:

$WS_POPUP = 2147483648

$WS_CAPTION = 12582912

EnvSet("GUI.style", $WS_POPUP + $WS_CAPTION)

Edited by Valik
Link to comment
Share on other sites

  • Administrators

2147483648 is actually -1 when using 32 bits (overflow) - this will be the problem.

When using the hex notation it forces 32bit operation for a while, so 0x80000000 will set the variant to -1, and then it will correctly be converted to the double -1.

Or something.

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...