Search the Community
Showing results for tags '$WM_COMMAND'.
-
Is there an easier (proper) way of detecting a change in the state of a checkbox other than comparing the checkbox text like I have done below? Is there a way of using and comparing the checkbox handle rather than its text? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Gui = GUICreate("WM_COMMAND", 390, 220) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 10, 40, 90, 17) $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 10, 60, 90, 17) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Do Until GUIGetMsg() = -3 Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $nID = BitAND($wParam, 0x0000FFFF) ; _WinAPI_LoWord Local $nNotifyCode = BitShift($wParam, 16) ; _WinAPI_HiWord If GUICtrlRead($nID, 1) = "Checkbox1" Then MsgBox(0, '', 'Checkbox1 has been modified') ; do some non-blocking code here If GUICtrlRead($nID, 1) = "Checkbox2" Then MsgBox(0, '', 'Checkbox2 has been modified') ; do some non-blocking code here Return $GUI_RUNDEFMSG EndFunc
- 5 replies
-
- $WM_COMMAND
- checkbox
-
(and 1 more)
Tagged with:
-
I'm trying to make it so that when I double click an item in my $List1 listbox, it will bring up a GUI window that reads all the .log values into the variable and then displays it in another list inside that child window. It should open a .log file that starts with the computer name ($compName) & ".log". Then read all the lines into a variable called $fread which then after its done reading into the variable it would then put that variable's value inside the list. Then close the file. Do I have the logic correct for doing this. Would my $List1 that I double click have to be able to edit, because that list is $ES_READONLY. ::Here is the GUIRegisterMsg and WM_COMMAND function that I'd like some help with:: GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $Child, $lb, $fopen, $fclose, $fread, $count, $i $iIDFrom = BitAND($wParam, 0xFFFF) ; low word $iCode = BitShift($lParam, 16) ; high word Switch $iCode Case $LBN_DBLCLK ;sent when user double-clicks a string in the list box Switch $iIDFrom Case $List1 $index = _GUICtrlListBox_GetCaretIndex($List1) $sText = _GUICtrlListBox_GetText($List1, $index) $Child = GUICreate($compName, 600, 500, -1, -1, -1, -1, $GUIhandle) $fopen = FileOpen($compName & ".log", 0) $count = _FileCountLines($fopen) for $i = 0 To $count Step 1 $fread &= FileReadLine($fopen, $i) & @CRLF Next $lb = GUICtrlCreateList("", 10, 10, 580, 480, BitOr($WS_BORDER, $WS_VSCROLL), $ES_READONLY) GUICtrlSetData($lb, $fread) $fclose = FileClose($fopen) EndSelect EndSelect EndFunc
- 8 replies
-
- $WM_COMMAND
- $LBN_DBLCLK
-
(and 1 more)
Tagged with:
-
I'm trying to use $WM_command to do some creative Auto_complete in a combobox, This works when i Force $hWndCombo = GUICtrlGetHandle($input[$x][62]) where $input[$x][62] is the handle of the combo. What I would like is to reuse this code, for multple combo boxes, I can get windows id of the other windows using GUIGetCursorInfo, but not any of the combo boxes, they are always returned as 0. So How can get the ID of a the Combobox that my cursor is at?
-
Hi ppl, i need a little help! I'm trying to understand how to use the GuiRegisterMsg(), and in this teste above: why it capture the click on Button, but not capture the click in the tab? how to use it correctly? #include <GuiTab.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> $Gui = GUICreate("Test", 300, 300, -1, -1) $tab = _GUICtrlTab_Create($Gui, 0, 0, 300, 300) _GUICtrlTab_InsertItem($tab, 0, "Tab 1") $button = GUICtrlCreateButton("Button test", 100, 100) _GUICtrlTab_InsertItem($tab, 1, "Tab 2") _GUICtrlTab_SetItem($tab, 0) GUISetState() GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _WM_COMMAND($hWnd, $msg, $wParam, $lParam) Local $nID = BitAND($wParam, 0x0000FFFF) Switch $nID Case $button MsgBox(0,'','Click on Button') Case $tab MsgBox(0,'','Click on Tab') EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_COMMAND thanks a lot!