Jump to content
Sign in to follow this  
52AT

A problem about DllCall

Recommended Posts

52AT

I want to send a keystroke to Notepad.

This is my script:

Dim $WM_KEYDOWN = 256,  $VK_TAB = 9
$hwnd = WinGetHandle("Untitled - Notepad")
DLLCall("user32.dll","long","SendMessage", "hwnd", $hWnd, "long", $WM_KEYDOWN, "long", $VK_TAB, "long", 0)

but the code is't work.

Share this post


Link to post
Share on other sites
Helge

http://www.autoitscript.com/fileman/users/Helge/forum/forum-ss.gif

(btw, the topic will probably moved so there's no need to create a new one)

Share this post


Link to post
Share on other sites
Pa Callender

Dim $WM_KEYDOWN = 256,  $VK_TAB = 9
$hwnd = WinGetHandle("Untitled - Notepad")
DLLCall("user32.dll","long","SendMessage", "hwnd", $hWnd, "long", $WM_KEYDOWN, "long", $VK_TAB, "long", 0)

Saves a couple of minutes searching MSDN like crazy.

P.S. If you use [ autoit ] instead of [ code ] (remove the spaces) and [ /autoit ] instead of [ /code ], it makes it a bit clearer if you post complicated scripts.

P.P.S. Try the support forum as well.

Edited by Pa Callender

[size="4"]YOU SHALL NOT PARSE!![/size]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.