Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/26/2021 in all areas

  1. Nine

    HELP - (Moved)

    Dam, will I have to start donating to #hertoo ?
    2 points
  2. Don't worry about this remark. DOS console accept messages very well. As a proof : #include <Constants.au3> #include <SendMessage.au3> #include <WindowsConstants.au3> Global $hwnd = "C:\Windows\system32\cmd.exe" Global $iEr = Run(@ComSpec & " /k " & '@echo Please wait', "", @SW_SHOW) Global $iCountW = 30 While Not WinExists($hwnd) $iCountW -= 1 If $iCountW < 1 Then Exit MsgBox ($MB_SYSTEMMODAL, "", "Unable to lauch DOS console") Sleep(500) WEnd Sleep(500) $hwnd = WinGetHandle($hwnd) _SendMessage($hwnd, $WM_CHAR, 0X41, 0) _SendMessage($hwnd, $WM_CHAR, 0X42, 0) _SendMessage($hwnd, $WM_CHAR, 0X43, 0)
    1 point
  3. You have one too much blank in there : ControlSend($hwnd, '', '', $key
    1 point
  4. Not only WinWaitActive but all win* functions are case sensitive. Unless you have WinTitleMatchMode set to a negative value.
    1 point
  5. @VIP There is a couple of bugs in your code (I noticed when testing it). Here a functional version of your code : #include <Constants.au3> Global $hwnd = "C:\Windows\system32\cmd.exe" Global $iEr = Run(@ComSpec & " /k " & '@echo Please wait', "", @SW_SHOW) Global $iCountW = 30 While Not WinExists($hwnd) $iCountW -= 1 If $iCountW < 1 Then Exit MsgBox ($MB_SYSTEMMODAL, "", "Unable to lauch DOS console") Sleep(500) WEnd Sleep(500) _SendToCmd("echo 1" & @CR) _SendToCmd("echo 2" & @CR) _SendToCmd("echo 3" & @CR) _SendToCmd("echo 4" & @CR) _SendToCmd("{UP}") _SendToCmd("{UP}") _SendToCmd("{UP}") _SendToCmd(@CR) ; {ENTER} = @CR) _SendToCmd("exit"& @CR) Func _SendToCmd($key) Sleep(250) WinActivate($hwnd, "") Local $t = WinWaitActive($hwnd, "", 2) ConsoleWrite ($t & @CRLF) Return Send($key) EndFunc ;==>_SendToCmd 1. Remember that using title, it is case sensitive 2. Your loop was checking the inverse
    1 point
  6. Which part do you not understand about the timeout? The TimeOut is the Max waiting time, so the WinWaitActive() will either wait until that Window is active and continue or else wait the number of seconds defined in the TimeOut when it is greater than 0. Jos
    1 point
  7. 1. When you post code, please use this tool. 2. You should not mix functions and main code in alternation, it makes the code very hard to follow. Put your main code together at the beginning of the script (best practices). 3. As for your problem, it seems that you should put a sleep after run to let time for the program to load.
    1 point
  8. Hope this small piece of code that can help you: Global $hwnd = "C:\WINDOWS\system32\cmd.exe" Global $iEr = Run(@ComSpec & " /k " & '@echo Please wait', "", @SW_SHOW) Global $iCountW = 30 While WinExists($hwnd) $iCountW -= 1 If $iCountW < 1 Then Exit Sleep(500) WEnd Sleep(500) _SendToCmd("mkdir 1" & @CR) _SendToCmd("rmdir 1" & @CR) _SendToCmd("mkdir 2" & @CR) _SendToCmd("rmdir 2" & @CR) _SendToCmd("{UP}") _SendToCmd("{UP}") _SendToCmd("{UP}") _SendToCmd(@CR) ; {ENTER} = @CR) _SendToCmd("exit"& @CR) Func _SendToCmd($key) Sleep(250) WinActivate($hwnd, "") WinActive($hwnd, "") Return Send($key) EndFunc ;==>_SendToCmd
    1 point
  9. It work on my pc: ;#RequireAdmin WinActivate("Infineon", "") Local $Success= ControlClick("Infineon", "", "[CLASS:Button; INSTANCE:2]") If $Success Then MsgBox(32+262144,"Autoit","ControlClick Success", 5) Else MsgBox(16+ 262144,"Autoit","ControlClick Failed", 5) EndIf
    1 point
  10. Untested, but I think something like this would work -- Func _WD_IsFullscreen($sSession) Local Const $sFuncName = "_WD_IsFullScreen" Local $sResponse = _WD_ExecuteScript($sSession, 'return screen.width == window.innerWidth and screen.height == window.innerHeight;') If @error <> $_WD_ERROR_Success Then Return SetError(__WD_Error($sFuncName, $_WD_ERROR_Exception), 0, $sResult) EndIf Local $oJSON = Json_Decode($sResponse) Local $bResult = Json_Get($oJSON, "[value]") Return SetError($_WD_ERROR_Success, 0, $bResult) EndFunc
    1 point
  11. well, your attitude is not friendly nor helpful. If you start a thread, do attend to it by responding honestly, and with a touch of humility if I may say. I understand that when one has a need for a solution, one goes into a form of desperation of sorts. But jumping around without attending the dialog is not nice nor welcoming to the one attempting to aid. Glad to see that you posted the solution to the problem for the next one needing such solution. ...and as I kindly ask everyone that found a clear solution, do prefix [Solved] to the tittle, as this helps future searches.
    1 point
  12. Did you use 64 bit driver ? maybe your au3 script is 64 bit but driver is not.
    1 point
  13. SoulA modified helpfile example without any checking for menu handles. use the GuiMenu.au3 UDF to make menus you can check for the handles of using wparam in _WM_CONTEXTMENU(). see helpfile GuiMenu UDF section example for _GUICtrlMenu_CreatePopup () Edit: added comment on helpfile example #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) Local $contextmenu, $button, $buttoncontext, $buttonitem, $msg, $iFlag = 0 Local $newsubmenu, $textitem, $fileitem, $saveitem, $infoitem ;right click on gui to bring up context Menu. ;right click on the "ok" button to bring up a control specific context menu. ;click on the "ok" button to disable contextmenus GUICreate("My GUI Context Menu", 300, 200) $button = GUICtrlCreateButton("Context Menu Enabled", 75, 100, 150, 20) $buttoncontext = GUICtrlCreateContextMenu($button) $buttonitem = GUICtrlCreateMenuItem("About button", $buttoncontext) $contextmenu = GUICtrlCreateContextMenu() $newsubmenu = GUICtrlCreateMenu("new", $contextmenu) $textitem = GUICtrlCreateMenuItem("text", $newsubmenu) $fileitem = GUICtrlCreateMenuItem("Open", $contextmenu) $saveitem = GUICtrlCreateMenuItem("Save", $contextmenu) GUICtrlCreateMenuItem("", $contextmenu) ; separator $infoitem = GUICtrlCreateMenuItem("Info", $contextmenu) GUIRegisterMsg($WM_CONTEXTMENU, "_WM_CONTEXTMENU") GUISetState() While 1 Switch GUIGetMsg() Case $button $iFlag = Not $iFlag If $iFlag Then GUICtrlSetData($button, "Context Menu Disabled") Else GUICtrlSetData($button, "Context Menu Enabled") EndIf Case $GUI_EVENT_CLOSE GUIDelete() Exit EndSwitch WEnd Func _WM_CONTEXTMENU($hwnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam If $iFlag Then Return 0 Return $GUI_RUNDEFMSG EndFunc
    1 point
×
×
  • Create New...