Jump to content

Can GUIs have Dialog style?


Recommended Posts

Is is possible to create a GUI window that looks like the following MsgBox?

http://www.autoitscript.com/fileman/users/public/CyberSlug/dialogGui.png

http://www.autoitscript.com/fileman/users/public/CyberSlug/dialogGui.png

WinSpy++ reports the following styles.

Window Style: 94C803C5

WS_POPUPWINDOW  80880000
WS_VISIBLE  10000000
WS_CLIPSIBLINGS 04000000
WS_DLGFRAME 00400000
DS_ABSALIGN 00000001
DS_SETFONT  00000040
DS_MODALFRAME   00000080
DS_NOIDLEMSG    00000100
DS_SETFOREGROUND    00000200
DS_3DLOOK   00000004


Extended Style: 00010101

WS_EX_DLGMODALFRAME 00000001
WS_EX_WINDOWEDGE    00000100
WS_EX_LEFT  00000000
WS_EX_LTRREADING    00000000
WS_EX_RIGHTSCROLLBAR    00000000
WS_EX_CONTROLPARENT 00010000

It appears that GuiCreate(...) does not support "DS_..." Styles, because WinSpy++ reports the following when I try GuiCreate("Title", 100, 100, 0, 0, 0x94C803C5, 0x00010101)

Window Style:  94C803C5

WS_POPUPWINDOW  80880000
WS_VISIBLE  10000000
WS_CLIPSIBLINGS 04000000
WS_DLGFRAME 00400000
000003C5    000003C5 <--- notice this


Extended Style:  00050101

WS_EX_DLGMODALFRAME 00000001
WS_EX_WINDOWEDGE    00000100
WS_EX_LEFT  00000000
WS_EX_LTRREADING    00000000
WS_EX_RIGHTSCROLLBAR    00000000
WS_EX_CONTROLPARENT 00010000
WS_EX_APPWINDOW 00040000

Does the fact that a MsgBox window is Class "#32770" and the fact that a GUI Window is Class "AutoIt v3 GUI" make a difference???

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

The only thing I can create is such a msgbox, but only with an icon like this:

#include "GUIConstants.au3"
$DS_MODALFRAME = 0x80

GUICreate("Example",155,75,-1,-1,BitOr(BitOr($DS_MODALFRAME,$WS_CAPTION),$WS_SYSMENU))
$label = GUISetControl("label","Msgbox(0,""Example"",""FOO"")",10,10,200,16)
$button= GUISetControl("button","OK",45,40,70,23)
GUISetControlEx(-1,$GUI_FOCUS)
GUIShow()
GUIWaitClose()
GUIDelete()

@CyberSlug: is this what you need or do you want the icon 'away'?

EDIT: otherwise you create a GUI without any closing button (without WS_SYSMENU) like:

#include "GUIConstants.au3"
$DS_MODALFRAME = 0x80

GUICreate("Example",155,75,-1,-1,BitOr($DS_MODALFRAME,$WS_CAPTION))
$label = GUISetControl("label","Msgbox(0,""Example"",""FOO"")",10,10,200,16)
$button= GUISetControl("button","OK",45,40,70,23)
GUISetControlEx(-1,$GUI_FOCUS)
GUIShow()
GUIWaitClose()
GUIDelete()

Edit2: that is what you can also use:

GUICreate("Example",155,75,-1,-1,BitOr(BitOr(BitOr($DS_MODALFRAME,$WS_POPUP),$WS_CAPTION),$WS_SYSMENU),$WS_EX_TOOLWINDOW)

So you have a GUI with only a small closing button but no icon :D

Edited by Holger
Link to comment
Share on other sites

Ah, thank you for that third example!

I'm attempting to document useful window styles:

http://www.autoitscript.com/fileman/users/public/CyberSlug/WindowStyles.png

http://www.autoitscript.com/fileman/users/public/CyberSlug/WindowStyles.au3

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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...