zutto Posted September 14, 2009 Share Posted September 14, 2009 hi i am trying to use postmessage to paste text to me, but apparently i fail for some reason.. DllCall("user32.dll", "int", "PostMessage", "hwnd", $hWnd, "int", 0x302, "int", 0, "int", $lParam) thats what i've been trying and also: DllCall("user32.dll", "int", "PostMessage", "hwnd", $hWnd, "int", 0x100, "int", 0x302, "int", $lParam) ..so, anyone have any idea why/what point i fail at? Link to comment Share on other sites More sharing options...
Skrip Posted September 14, 2009 Share Posted September 14, 2009 Take a look at this: http://msdn.microsoft.com/en-us/library/ms644944%28VS.85%29.aspx [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
zutto Posted September 14, 2009 Author Share Posted September 14, 2009 Take a look at this: http://msdn.microsoft.com/en-us/library/ms644944%28VS.85%29.aspxisnt really helping me at this point :/(WM_PASTE is afaik bit different than just normal keydown ) Link to comment Share on other sites More sharing options...
smashly Posted September 14, 2009 Share Posted September 14, 2009 Hi, works for me#include <GuiConstants.au3> Run("notepad.exe") Sleep(100) WinActivate("[CLASS:Notepad]") Send("This is some text, let's copy it to the clipboard.") ClipPut(ControlGetText("[CLASS:Notepad]", "", "Edit1")) $hGui1 = GUICreate("My Edit", 300, 200) $iEdit = GUICtrlCreateEdit("", 5, 5, 290, 190) GUISetState() DllCall("user32.dll", "int", "PostMessage", "hwnd", GUICtrlGetHandle($iEdit), "int", 0x0302, "int", 0, "int", 0) Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE Cheers Link to comment Share on other sites More sharing options...
jvanegmond Posted September 14, 2009 Share Posted September 14, 2009 (edited) Same thing: #include <GuiConstants.au3> ClipPut("This is some text, let's copy it to the clipboard.") $hGui1 = GUICreate("My Edit", 300, 200) $iEdit = GUICtrlCreateEdit("", 5, 5, 290, 190) GUISetState() ControlSetText($hGui1, "", GUICtrlGetHandle($iEdit), ClipGet()) ;DllCall("user32.dll", "int", "PostMessage", "hwnd", GUICtrlGetHandle($iEdit), "int", 0x0302, "int", 0, "int", 0) Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE Or ofcourse, ControlSend ^v Edited September 14, 2009 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
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