Kageno

Set Hotkey only GUI

4 posts in this topic

#1 ·  Posted (edited)

Why Error ?

#include <GUIConstants.au3>
#include <GuiStatusBar.au3>
#include <Misc.au3>

Global $GUI = GUICreate("Command", 674, 346)
$Dummy = GUICtrlCreateDummy()
$Edit = GUICtrlCreateEdit("", 0, 0, 673, 297, BitOR($ES_READONLY,$ES_WANTRETURN))
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetCursor (-1, 5)
$Command = GUICtrlCreateInput("", 0, 296, 673, 26)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetCursor (-1, 5)
$StatusBar = _GUICtrlStatusBar_Create($GUI)
_GUICtrlStatusBar_SetSimple($StatusBar)
_GUICtrlStatusBar_SetText($StatusBar, "Coded by Noro")
Dim $AccelKeys = [1][2] = [['{ENTER}', $Dummy]]
GUISetAccelerators($AccelKeys)
GUISetState(@SW_SHOW)

While 1
    $Msg = GUIGetMsg()
    Select
        Case $Msg = -3
            Exit
        Case $Msg = $Dummy
            MsgBox(64 + 262144, '', 'OK')
    EndSelect
WEnd
Edited by Kageno

Share this post


Link to post
Share on other sites



Kageno,

Welcome to the AutoIt forums. :)

Because: ;)

#include <GUIConstantsEx.au3>  ; Use the correct include
#include <EditConstants.au3>   ; Which means you need to add a few more
#include <GuiStatusBar.au3>
#include <Misc.au3>

Global $GUI = GUICreate("Command", 674, 346)

; If all control share the same properties, just set them once
GUISetFont(12, 400, 0, "Arial")
GUICtrlSetDefColor(0x00FF00)
GUICtrlSetDefBkColor( 0x000000)

$Dummy = GUICtrlCreateDummy()

$Edit = GUICtrlCreateEdit("", 0, 0, 673, 297, BitOR($ES_READONLY,$ES_WANTRETURN))
GUICtrlSetCursor (-1, 5)

$Command = GUICtrlCreateInput("", 0, 296, 673, 26)
GUICtrlSetCursor (-1, 5)

$StatusBar = _GUICtrlStatusBar_Create($GUI)
_GUICtrlStatusBar_SetSimple($StatusBar)
_GUICtrlStatusBar_SetText($StatusBar, "Coded by Noro")

GUISetState(@SW_SHOW)

Local $AccelKeys[1][2] = [['{ENTER}', $Dummy]] ; Look at difference in syntax from your code
GUISetAccelerators($AccelKeys)


While 1
    $Msg = GUIGetMsg()
    Select
        Case $Msg = -3 ; Now reads "Case" and not "Call"
            Exit
        Case $Msg = $Dummy
            MsgBox(64 + 262144, '', 'OK')
    EndSelect
    ;Sleep(100)  ; Not required as GUIGetMsg has an inbuilt Sleep
WEnd
Please ask if you have any questions. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Kageno,

Welcome to the AutoIt forums. :)

Because: ;)

#include <GUIConstantsEx.au3>  ; Use the correct include
#include <EditConstants.au3>   ; Which means you need to add a few more
#include <GuiStatusBar.au3>
#include <Misc.au3>

Global $GUI = GUICreate("Command", 674, 346)

; If all control share the same properties, just set them once
GUISetFont(12, 400, 0, "Arial")
GUICtrlSetDefColor(0x00FF00)
GUICtrlSetDefBkColor( 0x000000)

$Dummy = GUICtrlCreateDummy()

$Edit = GUICtrlCreateEdit("", 0, 0, 673, 297, BitOR($ES_READONLY,$ES_WANTRETURN))
GUICtrlSetCursor (-1, 5)

$Command = GUICtrlCreateInput("", 0, 296, 673, 26)
GUICtrlSetCursor (-1, 5)

$StatusBar = _GUICtrlStatusBar_Create($GUI)
_GUICtrlStatusBar_SetSimple($StatusBar)
_GUICtrlStatusBar_SetText($StatusBar, "Coded by Noro")

GUISetState(@SW_SHOW)

Local $AccelKeys[1][2] = [['{ENTER}', $Dummy]] ; Look at difference in syntax from your code
GUISetAccelerators($AccelKeys)


While 1
    $Msg = GUIGetMsg()
    Select
        Case $Msg = -3 ; Now reads "Case" and not "Call"
            Exit
        Case $Msg = $Dummy
            MsgBox(64 + 262144, '', 'OK')
    EndSelect
    ;Sleep(100)  ; Not required as GUIGetMsg has an inbuilt Sleep
WEnd
Please ask if you have any questions. :)

M23

 

 

Write mistake :sweating:  Thanks you   :thumbsup:

Share this post


Link to post
Share on other sites

Kageno,

Glad I could help. :)

M23

P.S. When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily. ;)


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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