Jump to content

How to not have title bar


Recommended Posts

Is it possible to create a GUI without any form of title bar? If so, please elaborate how.

I'm working on a stopwatch type application, and I want it to look something like the attached file (if that works):

Thanks

post-7657-1182266830_thumb.jpg

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Is there a way to make the box move-able when there is no title bar? So someone can click and drag it around.

Here is a basic framework if someone wants to play with it:

#include <GUIConstants.au3>
;Opt("GUICoordMode",2)
$main = GUICreate('Timer', 100, 30, -1,-1,$WS_POPUP,$WS_EX_DLGMODALFRAME)
$display = GUICtrlCreateLabel("00:00:00.00",30,5,-1,-1,$SS_SUNKEN)
$button = GUICtrlCreateButton("",5,5,20,20)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
Edited by SpookMeister

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

#include <GUIConstants.au3>
Opt("MustDeclareVars", 1)

Global Const $HTCAPTION = 2
Global Const $WM_NCHITTEST = 0x0084
Global $GUI

_Main()

Func _Main()
    $GUI = GUICreate("Blash", 300, 300, 155, 134, $WS_POPUP)
    Local $btn = GUICtrlCreateButton("Exit", 10, 10, 90, 25)
    GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
    GUISetState()
    While 1
        Switch GUIGetMsg()
            Case $btn
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>_Main

; ===============================================================================================================================
; Handle the WM_NCHITTEST for the layered window so it can be dragged by clicking anywhere on the image.
; ===============================================================================================================================
Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
    If ($hWnd = $GUI) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION
EndFunc   ;==>WM_NCHITTEST

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Is there a way to make the box move-able when there is no title bar? So someone can click and drag it around.

Try this: http://www.autoitscript.com/forum/index.ph...ost&p=88820

EDIT: gafrost solution is better!

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Thank you all

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Gary,

I'm trying to incorporate a context menu into this and am having an issue. As I don't really fully understand what $WM_NCHITTEST is about, I'm hoping you have an idea.

#include <GUIConstants.au3>
;Opt("MustDeclareVars", 1)

Global Const $HTCAPTION = 2
Global Const $WM_NCHITTEST = 0x0084
Global $GUI, $display, $button, $contextmenu, $title = "Timer"


$GUI = GUICreate($title, 200, 30, -1, -1, $WS_POPUP, $WS_EX_DLGMODALFRAME + $WS_EX_TOPMOST)
$contextmenu = GUICtrlCreateContextMenu()
$newsubmenu     = GUICtrlCreateMenu ("new", $contextmenu)
$textitem       = GUICtrlCreateMenuitem ("text", $newsubmenu)
$fileitem       = GUICtrlCreateMenuitem ("Open", $contextmenu)
$saveitem       = GUICtrlCreateMenuitem ("Save", $contextmenu)
GUICtrlCreateMenuitem ("", $contextmenu)    ; separator
$infoitem       = GUICtrlCreateMenuitem ("Info", $contextmenu)
$display = GUICtrlCreateLabel("00:00:00.00", 30, 5, -1, -1, $SS_SUNKEN)
$button = GUICtrlCreateButton("", 5, 5, 20, 20)
$contextmenu = GUICtrlCreateContextMenu()
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
GUISetState()
While 1
    Switch GUIGetMsg()
        Case $button
            _ButtonPushed()
    EndSwitch
WEnd

Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
    If ($hWnd = $GUI) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION
EndFunc   ;==>WM_NCHITTEST

Func _ButtonPushed()
    MsgBox(4096, "Click", "You clicked the button", 1)
EndFunc   ;==>ButtonPushed

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Tying it to the Label works.

Thanks again

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

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