Jump to content

Less space-eating GUI


Recommended Posts

I found that I can uncheck the minimize button in Koda, but when I try to run it gets an error about BitOR(remaining checks). And I think this is due to a missing include. I need those $WS_something variables, but I don't find them (I ran a search in the include folder). Anyone knows how to solve this? :)

Link to comment
Share on other sites

How can I make a GUI without the maximize, minimize and restore buttons on the top right, and with no box on the taskbar?

#include <guiconstants.au3>
#include <constants.au3>
Opt("TrayIconHide",1)

$hGui = GUICreate('Parent', 800, 600, 100, 100)
$gui1 = GUICreate("child",300,300,100,100,$WS_SIZEBOX ,-1,$hgui)
GUISetState(@SW_SHOW,$gui1)

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then
        Exit
    EndIf
    
WEnd
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

You can remove the minimize, maximise and restore buttons by specifying this as style:

BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU)

To remove the window from the taskbar, you can parent it to some other window(like in my example the "Program Manager", which is the desktop)

Example:

#include <WindowsConstants.au3>
#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 633, 447, 193, 115, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), -1, WinGetHandle("Program Manager"))
$Button1 = GUICtrlCreateButton("Exit", 32, 16, 81, 41, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Exit
    EndSwitch
WEnd
Link to comment
Share on other sites

#include <guiconstants.au3>
#include <constants.au3>
Opt("TrayIconHide",1)

$hGui = GUICreate('Parent', 800, 600, 100, 100)
$gui1 = GUICreate("child",300,300,100,100,$WS_SIZEBOX ,-1,$hgui)
GUISetState(@SW_SHOW,$gui1)

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then
        Exit
    EndIf
    
WEnd
The same error again... $WS_Sizebox possibly used before declaration :P

And... about the box on the taskbar, I don't know what the above script does, but I think you understood I'm refering at the tray icon... no, I want that 160 pixels wide and 40 pixels in height box :)

Edited by Kiti
Link to comment
Share on other sites

You can remove the minimize, maximise and restore buttons by specifying this as style:

BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU)

To remove the window from the taskbar, you can parent it to some other window(like in my example the "Program Manager", which is the desktop)

Example:

#include #include <WindowsConstants.au3>
#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 633, 447, 193, 115, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), -1, WinGetHandle("Program Manager"))
$Button1 = GUICtrlCreateButton("Exit", 32, 16, 81, 41, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Exit
    EndSwitch
WEnd
#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 633, 447, 193, 115, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), -1, WinGetHandle("Program Manager"))
$Button1 = GUICtrlCreateButton("Exit", 32, 16, 81, 41, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Exit
    EndSwitch
WEnd
Yayy!!! Thank you very much FreeFry !!!

So WindowsConstants.au3 was the missing include... :)

But the whole upper bar or at least the "X" too cannot be removed? :P

Edited by Kiti
Link to comment
Share on other sites

Well, you can create a window without a title bar by specifying:

BitOR($WS_POPUP, $WS_SYSMENU)
as style.

Example:

#include <WindowsConstants.au3>
#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 633, 447, 193, 115, BitOR($WS_POPUP, $WS_SYSMENU), -1, WinGetHandle("Program Manager"))
$Button1 = GUICtrlCreateButton("Exit", 32, 16, 81, 41, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Exit
    EndSwitch
WEnd

Edit:

If you want the titlebar, you can specify this as style instead:

BitOR($WS_CAPTION, $WS_POPUP)
Edited by FreeFry
Link to comment
Share on other sites

Well, you can create a window without a title bar by specifying:

BitOR($WS_POPUP, $WS_SYSMENU)
as style.

Example:

#include <WindowsConstants.au3>
#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 633, 447, 193, 115, BitOR($WS_POPUP, $WS_SYSMENU), -1, WinGetHandle("Program Manager"))
$Button1 = GUICtrlCreateButton("Exit", 32, 16, 81, 41, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Exit
    EndSwitch
WEnd

Edit:

If you want the titlebar, you can specify this as style instead:

BitOR($WS_CAPTION, $WS_POPUP)
Perfect! This is exactly what I want. Thank you so much! Do you know any source of where I can learn more about these styles?
Link to comment
Share on other sites

Perfect! This is exactly what I want. Thank you so much! Do you know any source of where I can learn more about these styles?

The helpfile has it all. :) Look under GUICreate, it has links to the style and exStyle parameters.

Link to comment
Share on other sites

No problemo :P Good luck with your script :)

Thank you. :D Do you happen to know about transparent buttons? I've tried ChrisL "Transparent Controls" from Example Scripts, but I got a visible box, and a dozen of pixel below the acutal transparent button. Do you know how can I fix that? :P

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