alexk345 Posted September 28, 2018 Posted September 28, 2018 I have several instances of testing program and i want to run concurrent test on them. So i need a way to click on the links on them. Tried controlcick and it need active window to work. I tested with simple click anywhere on window. it get registered only if window is activated. Tried Post message , Sendmessage, then dont work at all even window is activated. Func _PostMessage_Click($hWnd, $X = -1, $Y = -1, $Button = "left", $Clicks = 1, $Delay = 10) If Not IsHWND($hWnd) And $hWnd <> "" Then $hWnd = WinGetHandle($hWnd) EndIf If Not IsHWND($hWnd) Then Return SetError(1, "", False) EndIf If StringLower($Button) == "left" Then $Button = $WM_LBUTTONDOWN ElseIf StringLower($Button) == "right" Then $Button = $WM_RBUTTONDOWN ElseIf StringLower($Button) == "middle" Then $Button = $WM_MBUTTONDOWN If $Delay == 10 Then $Delay = 100 EndIf $WinSize = WinGetClientSize($hWnd) If $X == -1 Then $X = $WinSize[0] / 2 If $Y == -1 Then $Y = $WinSize[1] / 2 $User32 = DllOpen("User32.dll") If @error Then Return SetError(2, "", False) For $j = 1 To $Clicks DllCall($User32, "int", "PostMessage", "HWND", $hWnd, "uint", $Button, "WPARAM", 1, "LPARAM", _MakeLong($X, $Y)) Sleep($Delay) DllCall($User32, "int", "PostMessage", "HWND", $hWnd, "uint", $Button + 1, "WPARAM", 0, "LPARAM", _MakeLong($X, $Y)) Next DllClose($User32) Return SetError(0, 0, True) EndFunc Any expert here in this area to help? I must make it work. Because without it it takes 1 sec for window to get activated in slow machine. So i have to wait 8 sec for 8 instance. Not acceptable. Let me know. thanks very much.
Moderators JLogan3o13 Posted September 28, 2018 Moderators Posted September 28, 2018 Moved to the appropriate forum. Moderation Team "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
careca Posted September 28, 2018 Posted September 28, 2018 Would it work for you, if you could extract the link and use it elsewhere, instead of cliking in it? Im not saying im able to do it, but i got that idea as a possible workaround. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
alexk345 Posted September 30, 2018 Author Posted September 30, 2018 I have created empty html page with toggle button which change color on click and also click on anywhere page it will popup message box saying its clicked. Controlclick work if windows active. I want to click that page without it getting activated. So far nothing happening if window is not activated. Postmessage call dont work even windows activated. No error message returned on Dllcall. so i need autoit experts advise.
alexk345 Posted October 1, 2018 Author Posted October 1, 2018 I might have solved it with controlclick for inactive window. will update it tomorrow in testing setup.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now