PantZ4 Posted May 31, 2008 Posted May 31, 2008 Hey everyone. I'm trying to make a child GUI which only have a title and a close button. The title can easily acquired by adding $WS_CAPTION to the style but what about a close button? $WS_SYSMENU isn't the wanted effect I want as it also adds a window menu and icon to the GUI but I only want the close button. I couldn't find anything in the help file. Anyone got the style I need to apply, to my GUI on the top of their mind? Thanks.
BrettF Posted May 31, 2008 Posted May 31, 2008 #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 447, 193, 125, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
therks Posted May 31, 2008 Posted May 31, 2008 (edited) Variable used without being declared.: $Form1 = GUICreate("Form1", 633, 447, 193, 125, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS)) $Form1 = GUICreate("Form1", 633, 447, 193, 125, BitOR(^ ERROR *Edit: And not to mention that even if it's working, it's explicitly NOT what the OP asked for. Maybe he was misread, so I'll bold the important parts. Quote $WS_SYSMENU isn't the wanted effect I want as it also adds a window menu and icon to the GUI but I only want the close button.If I had to guess, I'd say he wants a window like MsgBox(0, '', '') gives. Although it should be noted that it still has a window menu, it's just not accessible via a title icon (must press Alt+Space). Edited May 31, 2008 by Saunders My AutoIt Stuff | My Github
PantZ4 Posted May 31, 2008 Author Posted May 31, 2008 Here is a image of what I mean: As you see within the red rectangle this title bar doesn't have the icon. Saunders @ About they can access the window menu doesn't matter. It just the icon I want gone. But thanks for enlighten me with the hotkey. Didn't even know you could do that . Sorry for my English .
BrettF Posted June 1, 2008 Posted June 1, 2008 (edited) #include <GUIConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 447, 193, 125, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I'm still using version 3.2.10.0 lol. Try it now (still untested with the latest release, I'm downloading it, but this should be fixed now.\ EDIT: @Saunders- He asked for a title and a close button... He provided no code to show what he had done, so I gave him something to work with, to see if he could figure it out himself. Edited June 1, 2008 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
PantZ4 Posted June 1, 2008 Author Posted June 1, 2008 Bert said: He asked for a title and a close button... He provided no code to show what he had done, so I gave him something to work with, to see if he could figure it out himself.Well I would love to figure it out myself but I have already tried various ways to get my wanted effect.Heck, I even tried to use Au3Info to get the style and then apply it. Still no luck.
rasim Posted June 2, 2008 Posted June 2, 2008 Mr. ZeroThis?#include <GUIConstants.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test GUI", 300, 200, -1, -1, BitOR($WS_POPUP, $WS_CAPTION, $WS_SYSMENU), $WS_EX_TOOLWINDOW) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE
PantZ4 Posted June 2, 2008 Author Posted June 2, 2008 rasim said: Mr. Zero This? #include <GUIConstants.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test GUI", 300, 200, -1, -1, BitOR($WS_POPUP, $WS_CAPTION, $WS_SYSMENU), $WS_EX_TOOLWINDOW) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Yes! That is exactly what I want. Thank you. Well if I'm allowed to be a bit picky, you might notice that the title bar have become smaller by the $WS_EX_TOOLwindow. Is there any alternative to this? I tried some other $WS_EX but it seems only toolwindow works.
rasim Posted June 2, 2008 Posted June 2, 2008 Mr. Zero Quote Well if I'm allowed to be a bit picky, you might notice that the title bar have become smaller by the $WS_EX_TOOLwindow.Hmm...this is a trick: #include <GUIConstants.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test GUI", 300, 200, -1, -1, BitOR($WS_POPUP, $WS_CAPTION, $WS_SYSMENU)) GUISetState() DllCall("user32.dll", "int", "SendMessage", "hwnd", $hGUI, "int", $WM_SETICON, "int", 1, "str", 0) DllCall("user32.dll", "int", "SendMessage", "hwnd", $hGUI, "int", $WM_SETICON, "int", 0, "str", 0) DllCall("user32.dll", "int", "DrawMenuBar", "hwnd", $hGUI) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE But system menu don`t removed.
therks Posted June 4, 2008 Posted June 4, 2008 What are the DllCall's supposed to be doing? I commented them out and the window looks and acts the same to me. My AutoIt Stuff | My Github
rasim Posted June 5, 2008 Posted June 5, 2008 Saunders Quote What are the DllCall's supposed to be doing? I commented them out and the window looks and acts the same to me.Remove the window icon.
Pain Posted June 5, 2008 Posted June 5, 2008 I find this method better if you want to remove the icon Global $sFilename = @SystemDir & "\shell32.dll" GuiSetIcon($sFilename, -50)
therks Posted June 6, 2008 Posted June 6, 2008 rasim said: Saunders Remove the window icon. [img removed]I did not get that result. Pain said: I find this method better if you want to remove the icon Global $sFilename = @SystemDir & "\shell32.dll" GuiSetIcon($sFilename, -50)That works though. My AutoIt Stuff | My Github
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