Sign in to follow this  
Followers 0
Hooch

Minimum Window size when using styles?

10 posts in this topic

#1 ·  Posted (edited)

EDITED FOR CLARITY

When I use this code I get a window that is 70px wide.

GUICreate("myProg", 70, 354, 200, 200)
GUISetState(@SW_SHOW)

while 1 = 1 
   
Wend

However when I use this code or any varient of styles I get a window twice the width

:)

$WS_CAPTION = 0x00C00000
$WS_EX_TOPMOST = 0x00000008
$style = BitOr($WS_CAPTION,$WS_EX_TOPMOST)

GUICreate ( "myProg", 70, 354, 200 , 200 , $style)

GUISetState(@SW_SHOW)

while 1 = 1 
  
Wend
Edited by Hooch

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The topmost style is an extended style and should be placed last.

eg:

$WS_CAPTION = 0x00C00000
$WS_EX_TOPMOST = 0x00000008

GUICreate ( "myProg", 70, 354, 200 , 200, $WS_CAPTION, $WS_EX_TOPMOST)

GUISetState(@SW_SHOW)

while 1 = 1 
 
Wend
Edited by SlimShady

Share this post


Link to post
Share on other sites

EDITED FOR CLARITY

When I use this code I get a window that is 70px wide.

GUICreate("myProg", 70, 354, 200, 200)
GUISetState(@SW_SHOW)

while 1 = 1 
   
Wend

However when I use this code or any varient of styles I get a window twice the width

:)

$WS_CAPTION = 0x00C00000
$WS_EX_TOPMOST = 0x00000008
$style = BitOr($WS_CAPTION,$WS_EX_TOPMOST)

GUICreate ( "myProg", 70, 354, 200 , 200 , $style)

GUISetState(@SW_SHOW)

while 1 = 1 
  
Wend

<{POST_SNAPBACK}>

Your previous post was correct you only used the Hex values..

You have now BitOr-ed the Style and ExStyle together... ( like SlimShady mentiones in his post)

I had a quick look if there is a minimum window size for the WS_CAPTION style but couldn't find any .. maybe others know ??


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I usually just use the numbers anyway but even the code that Slim posted the width of the resulting window is still far more than the 70px it is supposed to be. Remove the styles and the window is at the correct width.

Share this post


Link to post
Share on other sites

Ok, here is some code, when you run it the button should be the same width as the window. For me it is not.

GUICreate ( "myProg", 70, 354, 200 , 200, 0x00C00000, 0x00000008)
GUISetState(@SW_SHOW)

$GUI_CLOSE = GUICtrlCreateButton("Close", 0, 331, 70, 22)

while 1 = 1 
   
   $MSG = GUIGetMsg()
   Select
      Case $MSG = $GUI_CLOSE         
         
   EndSelect
      
Wend

Share this post


Link to post
Share on other sites

this does work:

#Include <GUIConstants.au3>
GUICreate("myProg", 70, 354, 200, 200, BitOr($WS_CAPTION,$WS_POPUP), $WS_EX_TOPMOST)
GUISetState(@SW_SHOW)
$GUI_CLOSE = GUICtrlCreateButton("Close", 0, 331, 70, 22)
While 1 = 1 
   $MSG = GUIGetMsg()
   Select
   Case $MSG = $GUI_CLOSE
      exit
   EndSelect 
Wend

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

@Hooch: that is normal :)

You have a window with a caption AND a 'possible' maximize/minimize-box-placeholder...

<{POST_SNAPBACK}>

Oh ok well that is different behavior than 102 which is to be expected.

What I am trying for is a window that has no min/max or close buttons on the title bar, just the Title text and still only be 70px wide.

0x00C00000 is the only style I saw that gave that type of a title bar.

Share this post


Link to post
Share on other sites

Oh ok well that is different behavior than 102 which is to be expected.

What I am trying for is a window that has no min/max or close buttons on the title bar, just the Title text and still only be 70px wide.

0x00C00000 is the only style I saw that gave that type of a title bar.

<{POST_SNAPBACK}>

Check the post just above this one... you migth have missed it.... :)

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Check the post just above this one... you migth have missed it....  :)

<{POST_SNAPBACK}>

Ahhh nice, great thanks for the assist. :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0