Jump to content

Recommended Posts

Posted

Hi,

I am running a website and try to take a printscreen and then open mspaint and paste the screenshot. It is working fine when i am running manually on the server logged in, but when i disconnect the server and running through task schedule, mspaint is opening but pasting the screenshot is not happening. Please guide.

Local $oIE = _IECreate($URL,0,1,0)

Local $hWnd = WinWait("","",5)
WinActivate($hWnd)
Sleep(5000)
Send("!{PRINTSCREEN}")
Sleep(2000)
Run("mspaint")
Sleep(2000)
Local $hWnd = WinWaitActive("Untitled - Paint","",5)
WinActivate($hWnd)
Sleep(2000)
ControlClick($hWnd, "", "Afx:c10000:81",2)
Sleep(2000)
ControlSend($hWnd, "", "Afx:c10000:81","^v")

 

Posted

Hi,

Thanks.

I tried with below script but still its not working.

Local $oIE = _IECreate($URL,0,1,0)

Local $hWnd = WinWait("","",5)
WinActivate($hWnd)
Sleep(5000)
Send("!{PRINTSCREEN}")
Sleep(2000)
Run("mspaint")
Sleep(2000)
Local $hWnd = WinWaitActive("Untitled - Paint","",5)
WinActivate($hWnd)
Sleep(2000)
ControlClick($hWnd, "", "[REGEXPCLASS:Afx:.+:8]",2)
Sleep(2000)
ControlSend($hWnd, "", "[REGEXPCLASS:Afx:.+:8]","^v")

Even i tried with below script that also not working. I am not sure where i am missing. 

Local $oIE = _IECreate($URL,0,1,0)

Local $hWnd = WinWait("","",5)
WinActivate($hWnd)
Sleep(5000)
Send("!{PRINTSCREEN}")
Sleep(2000)
Run("mspaint")
Sleep(2000)

$hWnd = ControlGetHandle ($hWnd, "", "[REGEXPCLASS:Afx:.+:8]")
WinActivate($hWnd)
Sleep(2000)

Sleep(2000)
ControlClick($hWnd, "", "[REGEXPCLASS:Afx:.+:8]",2)
Sleep(2000)
ControlSend($hWnd, "", "[REGEXPCLASS:Afx:.+:8]","^v")

 

Posted

Works well for me

Local $oIE = _IECreate("google.ca",0,1,0)
Local $hWnd = WinWait("","",5)
WinActivate($hWnd)
Sleep(5000)
Send("!{PRINTSCREEN}")
Sleep(2000)
Run("mspaint")
Sleep(2000)
Local $hWnd = WinWaitActive("[CLASS:MSPaintApp]","",5)
WinActivate($hWnd)
Sleep(2000)
Local $hWnd2 = ControlGetHandle ($hWnd, "", "[REGEXPCLASS:Afx:.+:8]")
MsgBox ($MB_SYSTEMMODAL,"",$hWnd2)
ControlClick($hWnd, "", "[REGEXPCLASS:Afx:.+:8]",2)
Sleep(2000)
ControlSend($hWnd, "", "[REGEXPCLASS:Afx:.+:8]","^v")

 

Posted

Hi ,

Thanks.

But it is working only when i logged into the server and run manually, when i schedule the script in task scheduler and disconnect the server, then it is not working only empty mspaint is opened but no any screenshot of the page. 

Posted

I didn't get you here what do you mean by resize it ( to a size that won't bother ). Do you mean decrease the size of the screen resolution.

  • 3 weeks later...
Posted

Hi,

Thanks.

Sorry for late reply. I did the same as you suggested, but after sometime, server locked and then the printscreen and pasting is not working on mspaint.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...