misioooo Posted November 14, 2013 Posted November 14, 2013 I hope this is not violating any rules Here is my sample code: expandcollapse popupHotKeySet("{F5}","f_start") HotKeySet("{F9}","f_stop") HotKeySet("{ESC}","f_exit") ;Variables Global $mouse_pos[2] Global $log_x = 660, $log_y = 820, $run = 0 Run("notepad.exe") Global $notepad = WinWait("[CLASS:Notepad]", "", 10) Func f_start() $run = 1 EndFunc Func f_stop() $run = 0 EndFunc Func f_exit() WinClose($notepad, "") exit 0 EndFunc WinSetState($notepad, "", @SW_MINIMIZE) Local $hHandle = ControlGetHandle($notepad, "", "Edit1") While 1 While $run = 1 $mouse_pos = MouseGetPos() MouseClick("left",$log_x,$log_y,1,0) Send("^a") Send("^c") MouseMove($mouse_pos[0], $mouse_pos[1],0) $debug = ControlSend($notepad,"","Edit1","^v") MsgBox(0,"Debug","Successfuly sent ctrl + v to notepad: "&$debug) $run = 0 WEnd WEnd In general: Copy works (i have copied text in clipboard). But i cant get it to paste into notepad window. I tried using $hHandle, "Edit1", "Edit 1" etc. Notepad window stays empty... What i am doing wrong? Btw $debug = 1, so it SHOULD work?
Kidney Posted November 14, 2013 Posted November 14, 2013 is there a reason why you want to do it this way as opposed to using FileWrite??
misioooo Posted November 14, 2013 Author Posted November 14, 2013 (edited) How stupid of me There is no particular reason. I did previously file writes and it worked fine. But how to writo to file from clipboard? And i cant do FileRead, i must use Copy (CTRL+c) or other means to get all data. Edited: ClipGet should do the trick i suppose... Edited November 14, 2013 by misioooo
Solution Kidney Posted November 14, 2013 Solution Posted November 14, 2013 ClipGet and ClipPut will work.
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