Jump to content
Sign in to follow this  


Recommended Posts


Was actually trying to find something else and came across this, someone might find it usefull.

#include <GUIConstants.au3>

Global Const $WM_SYSCOMMAND = 0x112;
Global Const $SC_CLOSE = 0xF060;
Global Const $SC_CONTEXTHELP = 0xF180;
Global Const $SC_DEFAULT = 0xF160;
Global Const $SC_HOTKEY = 0xF150;
Global Const $SC_KEYMENU = 0xF100;
Global Const $SC_MAXIMIZE = 0xF030;
Global Const $SC_MINIMIZE = 0xF020;
Global Const $SC_MONITORPOWER = 0xF170;
Global Const $SC_MOUSEMENU = 0xF090;
Global Const $SC_MOVE = 0xF010;
Global Const $SC_NEXTWINDOW = 0xF040;
Global Const $SC_PREVWINDOW = 0xF050;
Global Const $SC_RESTORE = 0xF120;
Global Const $SC_SCREENSAVE = 0xF140;
Global Const $SC_SIZE = 0xF000;
Global Const $SC_TASKLIST = 0xF130;
Global Const $SC_VSCROLL = 0xF070;

;~ GUICreate("My GUI",500,500,Default,Default,BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))  ; will create a dialog box that when displayed is centered
GUICreate("My GUI",500,500,Default,Default,BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX),$WS_EX_CONTEXTHELP)  ; will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW)       ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Func WM_SYSCOMMAND_Events($hWndGUI, $MsgID, $wParam, $lParam)
    Switch $wParam
        Case $SC_CLOSE
        Case $SC_CONTEXTHELP
        Case $SC_DEFAULT
        Case $SC_HOTKEY
        Case $SC_KEYMENU
        Case $SC_MAXIMIZE
        Case $SC_MINIMIZE
        Case $SC_MOUSEMENU
        Case $SC_MOVE
        Case $SC_NEXTWINDOW
        Case $SC_PREVWINDOW
        Case $SC_RESTORE
        Case $SC_SCREENSAVE
        Case $SC_SIZE
        Case $SC_TASKLIST
        Case $SC_VSCROLL

Func _HiWord($x)
    Return BitShift($x, 16)
EndFunc   ;==>_HiWord 

Func _LoWord($x)
    Return BitAND($x, 0xFFFF)
EndFunc   ;==>_LoWord 

Func _DebugPrint($s_text)
    $s_text = StringReplace(StringReplace($s_text, @CRLF, @LF), @LF, @LF & "!-->")
    ConsoleWrite( _
            "+===========================================================" & @LF & _
            "!-->" & $s_text & @LF & _
            "+===========================================================" & @LF & @LF)
EndFunc   ;==>_DebugPrint

SciTE for AutoItDirections for Submitting Standard UDFs


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


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.