Jump to content

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


zutto
 Share

Recommended Posts

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?

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...