Jump to content

mpechner

Members
  • Posts

    1
  • Joined

  • Last visited

mpechner's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I have been racking my brains out trying to query a checkbox and possibly set the value of the checkbox. I first tried to no avail: ;state global set to "Check" or "UnCheck" Func flipCheckbox($controlId) ControlFocus($title, "", $controlId); Shows me the correct control is being queried sleep(250) ControlCommand($title, "", $controlId, $state, "") ConsoleWrite($controlId&" state"&$state&@CRLF); $ctlstate = ControlCommand($title, "", $controlId, "IsChecked", "") ConsoleWrite($controlId&" state"&$state&" cur st:"&$ctlstate&@CRLF); If $state == "Check" And Not $ctlstate == 1 Then ConsoleWrite("Could turn on flip:"&$controlId) Cleanup($LOGFILE, "Could turn on flip:"&$controlId); ElseIf $state == "Uncheck" And Not $ctlstate == 0 Then ConsoleWrite("Could turn off flip:"&$controlId) Cleanup($LOGFILE, "Could turn off flip:"&$controlId) EndIf EndFunc Now I am trying things at a lower level: Chandle returns the same value as autoit info. $chandle = ControlGetHandle($title, "", "TResTeCheckBox6"); ;MsgBox(0, "hh", $chandle); flipCheckbox("[Class:TResTeCheckBox;Instance:6]") $BM_GETCHECK = 0x00F0 $BM_SETCHECK = 0x00F1 $BM_GETSTATE = 0x00F2 $BM_SETSTATE = 0x00F3 $BM_CLICK = 0x00F5 $BST_UNCHECKED = 0x0000 $BST_CHECKED = 0x0001 $BST_INDETERMINATE = 0x0002 ; ; Final attempt ; ConsoleWrite("check"&@CRLF); DllCall("user32.dll","uint", "SendMessage","hwnd", $chandle, "uint", $BM_CLICK, "wparam", 0, "lparam", 0 ) sleep(4000) ConsoleWrite("check"&@CRLF); DllCall("user32.dll","uint", "SendMessage","hwnd", $chandle, "uint", $BM_CLICK, "wparam", 0, "lparam", 0 ) sleep(4000) ConsoleWrite("check"&@CRLF); DllCall("user32.dll","uint", "SendMessage","hwnd", $chandle, "uint", $BM_CLICK, "wparam", 0, "lparam", 0 ) sleep(4000) ; ;Next to last attempt ; ;ConsoleWrite("check"&@CRLF); ;DllCall("user32.dll","uint", "SendMessage","hwnd", $chandle, "uint", $BM_SETCHECK, "wparam", $BST_CHECKED, "lparam", 0 ) ;sleep(4000) ;ConsoleWrite("uncheck"&@CRLF); ;DllCall("user32.dll","uint", "SendMessage","hwnd", $chandle, "uint", $BM_SETCHECK, "wparam", $BST_UNCHECKED, "lparam", 0 ) ;sleep(4000) ;ConsoleWrite("check"&@CRLF); ;DllCall("user32.dll","uint", "SendMessage","hwnd", $chandle, "uint", $BM_SETCHECK, "wparam", $BST_CHECKED, "lparam", 0 ) ;sleep(4000) What am I doing wrong?
×
×
  • Create New...