Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/19/2011 in all areas

  1. So who was phone? jk, by the way, is the program you're attempting to automate look like this?
    1 point
  2. i do not have that download manager so i assume that your looking for something like this #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("AutoIT", 182, 140, 505, 284) $Combo1 = GUICtrlCreateCombo("1", 16, 40, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$WS_VSCROLL, $CBS_DROPDOWNLIST)) GUICtrlSetData(-1,"2|Other") $Label1 = GUICtrlCreateLabel("Combo", 16, 16, 37, 17) $Label2 = GUICtrlCreateLabel("Input", 16, 80, 28, 17) $Input = GUICtrlCreateInput("", 16, 104, 145, 21,$ES_NUMBER) GUISetState(@SW_SHOW) $clast = 1 Dim $speed[3] = [1000,2000,3000] While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $Combo1 Switch Guictrlread($Combo1) Case "1" GUICtrlSetData($Input,$speed[0]) $clast = 1 Case "2" GUICtrlSetData($Input,$speed[1]) $clast = 2 Case "Other" GUICtrlSetData($Input,$speed[2]) $clast = "Other" EndSwitch EndSwitch If $clast <> "Other" And $speed[$clast] <> GUICtrlRead($Input) Then GUICtrlSetData($Input,$speed[$clast]) WEnd
    1 point
  3. GUISetState(@SW_SHOW) GUICtrlSetState($Input, $GUI_DISABLE) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $Combo1 Switch Guictrlread($Combo1) Case "1" GUICtrlSetData($Input,"1000") GUICtrlSetState($Input, $GUI_DISABLE) Case "2" GUICtrlSetData($Input,"2000") GUICtrlSetState($Input, $GUI_DISABLE) Case "Other" GUICtrlSetState($Input, $GUI_ENABLE) GUICtrlSetData($Input,"3000") EndSwitch EndSwitch WEnd
    1 point
  4. Here's an updated version of the same code as above, but using a single function to handle all 3 types of Windows messages. I'm sure there's a Windows constant for the 2 numbers I used in the Switch statement for $iMsg, but I wasn't able to find out what it was. The 273 is used to activate the button control function, which also works on combobox controls, the 274 is the GUI messages for things like the sysmenu and the close button. If anyone knows the variables for those 2 numbers, please let me know. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUIRegisterMsg($WM_COMMAND, "_WM_EXTRACTOR") GUIRegisterMsg($WM_SYSCOMMAND, "_WM_EXTRACTOR") GUIRegisterMsg($WM_HSCROLL, "_WM_EXTRACTOR") $GUI = GUICreate("Test GUI", 200, 200, -1, -1, BitOR($WS_THICKFRAME, $gui_ss_default_gui)) $Button = GUICtrlCreateButton("Test", 20, 20) $Button2 = GUICtrlCreateButton(" Another Test ", 20, 100) $Slider = GUICtrlCreateSlider(20, 60, 150) $hSlider = GUICtrlGetHandle($Slider) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $Button MsgBox(0, "", "You pressed the button marked TEST") Case $Button2 MsgBox(0, "", "You pressed the button marked 'Another Test'") EndSwitch WEnd Func _WM_EXTRACTOR($hWnd, $iMsg, $wParam, $lParam) Local $nNotifyCode = BitShift($wParam, 16) Local $nID = BitAND($wParam, 0x0000FFFF) Local $hCtrl = $lParam #forceref $hWnd, $iMsg, $wParam, $lParam Switch $iMsg Case $WM_HSCROLL Switch $lParam Case $hSlider ConsoleWrite("+Slider moved to: " & GUICtrlRead($Slider) & @LF) EndSwitch Case $WM_VSCROLL Case 273 Switch $nID Case $Button ConsoleWrite(">Button Test pressed" & @LF) Case $Button2 ConsoleWrite(">Button Another Test pressed" & @LF) Case Else MsgBox(0, "MY_WM_COMMAND", "GUIHWnd" & @TAB & ":" & $hWnd & @LF & _ "MsgID" & @TAB & ":" & $msg & @LF & _ "wParam" & @TAB & ":" & $wParam & @LF & _ "lParam" & @TAB & ":" & $lParam & @LF & @LF & _ "WM_COMMAND - Infos:" & @LF & _ "-----------------------------" & @LF & _ "Code" & @TAB & ":" & $nNotifyCode & @LF & _ "CtrlID" & @TAB & ":" & $nID & @LF & _ "CtrlHWnd" & @TAB & ":" & $hCtrl) EndSwitch Case 274 Switch $wParam Case 0xf060 ConsoleWrite("!Exit pressed" & @LF) Exit Case 0xF120 ConsoleWrite("!Restore window" & @LF) Case 0xF020 ConsoleWrite("!Minimize Window" & @LF) Case 0xF093 ConsoleWrite("!System menu pressed" & @LF) Case 0xF010 ConsoleWrite("!System menu Move Option pressed" & @LF) Return 0 Case 0xF000 ConsoleWrite("!System menu Size Option pressed" & @LF) Return 0 Case 0xF002 ; This and the following case statements are only valid when the GUI is resizable ConsoleWrite("!Right side of GUI clicked" & @LF) Return 0 Case 0xf001 ConsoleWrite("!Left side of GUI clicked" & @LF) Return 0 Case 0xF008 ConsoleWrite("!Lower Right corner of GUI clicked" & @LF) Return 0 Case 0xF007 ConsoleWrite("!Lower Left corner of GUI clicked" & @LF) Return 0 Case 0xF006 ConsoleWrite("!Bottom side of GUI clicked" & @LF) Return 0 Case Else MsgBox(0, "MY_WM_COMMAND", "GUIHWnd" & @TAB & ":" & $hWnd & @LF & _ "MsgID" & @TAB & ":" & $msg & @LF & _ "wParam" & @TAB & ":" & $wParam & @LF & _ "lParam" & @TAB & ":" & $lParam & @LF & @LF & _ "WM_COMMAND - Infos:" & @LF & _ "-----------------------------" & @LF & _ "Code" & @TAB & ":" & $nNotifyCode & @LF & _ "CtrlID" & @TAB & ":" & $nID & @LF & _ "CtrlHWnd" & @TAB & ":" & $hCtrl) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_WM_EXTRACTOR
    1 point
×
×
  • Create New...