Sign in to follow this  
Followers 0
zutto

0x302... pasting...(postmessage..)

5 posts in this topic

hi :D

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?

Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Manadar

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0