Ticket #3729: AutoIt - Buttons background color issue.au3

File AutoIt - Buttons background color issue.au3, 1.5 KB (added by Enrico Boldori <mainmaster@…>, 2 months ago)

Second reproduction script

Line 
1#include <GUIConstants.au3>
2#include <GUIConstantsEx.au3>
3#include <WindowsConstants.au3>
4
5Opt("GUIOnEventMode", 1) ; 1 = enable
6Opt("GUIEventOptions", 0) ; 0 = (default) Windows behavior on click on Minimize,Restore, Maximize, Resize.
7
8$hGui = GUICreate("Test double event")
9GUISetBkColor(0xABCDEF, $hGui)
10
11GUISetOnEvent($GUI_EVENT_CLOSE, "guiEventsHandler", $hGui)
12GUISetOnEvent($GUI_EVENT_RESTORE, "guiEventsHandler", $hGui)
13GUISetOnEvent($GUI_EVENT_MINIMIZE, "guiEventsHandler", $hGui)
14
15GuiCtrlCreateButton("Test input", 8, 8, 100, 30)
16GUICtrlSetOnEvent(-1, buttonHandler)
17
18GuiCtrlCreateButton("Test input", 8, 46, 100, 30)
19GUICtrlSetOnEvent(-1, buttonHandler2)
20GUICtrlSetBkColor(-1, 0xABCDEF)
21
22GuiCtrlCreateInput("asdasd", 8, 84, 100, 30)
23GUICtrlSetOnEvent(-1, inputHandler)
24
25GUISetState()
26
27While 1
28        Sleep(10)
29WEnd
30
31Func guiEventsHandler()
32        If @GUI_CtrlId == $GUI_EVENT_CLOSE Then Exit
33        If @GUI_CtrlId == $GUI_EVENT_RESTORE Then GUISetState(@SW_RESTORE, @GUI_WinHandle)
34        If @GUI_CtrlId == $GUI_EVENT_MAXIMIZE Then GUISetState(@SW_MAXIMIZE, @GUI_WinHandle)
35        If @GUI_CtrlId == $GUI_EVENT_MINIMIZE Then GUISetState(@SW_MINIMIZE, @GUI_WinHandle)
36EndFunc
37
38Func buttonHandler()
39        MsgBox(0, "Button handler", "Got an event from the first button")
40EndFunc
41
42Func buttonHandler2()
43        MsgBox(0, "Button handler", "Got an event from the second button")
44EndFunc
45
46Func inputHandler()
47        MsgBox(0, "Input handler", "Got an event from the input")
48EndFunc