Jump to content
Sign in to follow this  
Alia5

AutoIT: Send <-> C++ WinAPI: Postmessage, Sendinput, etc

Recommended Posts

Alia5

Well i couldn't post this in dev chat now, sorry

First off: I'm NOT having trouble to write me a "Send"-like Function with Postmessage, Sendmessage, Sendinput or keybd_event

Im having trouble to send Keystrokes to various applications with WinAPI functions... With AutoIt it just works fine in the Programs where WinAPI seems to be NOT working oO

So my questions is now how does AotoIt's Send-command send Keystrokes to Programms? It Seems not to use WinAPI functions oO

Cheers

Edited by Alia5

Share this post


Link to post
Share on other sites
tlman12

Well i couldn't post this in dev chat now, sorry

First off: I'm NOT having trouble to write me a "Send"-like Function with Postmessage, Sendmessage, Sendinput or keybd_event

Im having trouble to send Keystrokes to various applications with WinAPI functions... With AutoIt it just works fine in the Programs where WinAPI seems to be NOT working oO

So my questions is now how does AotoIt's Send-command send Keystrokes to Programms? It Seems not to use WinAPI functions oO

Cheers

not exactly sure but have you checked out

ControlSend

or

ControlClick

Share this post


Link to post
Share on other sites
Alia5

not exactly sure but have you checked out

ControlSend

or

ControlClick

Did you even read my post?! -.-

For clarification: in AutoIt it works just fine!

But I'm NOT wanting to do something with AutoIt!

I can send keystrokes with WinAPI functions to programms, but it's NOT working in all programms, but when using AutoIt it even works in programms where WinAPI seems to fail!

Get me? Alright :)

Edited by Alia5

Share this post


Link to post
Share on other sites
monoscout999

I don`t have much idea form how to work both, but i think there`s a huge difference between Send and ControlSend().

Also.. The problem is from the program that you want to send keys or from your PC? Or(Excuse me if i don`t have any idea and maybe this sounds wrong :S is not my intention) the problem are your programing skills?

Edited by monoscout999

Share this post


Link to post
Share on other sites
Alia5

I don`t have much idea form how to work both, but i think there`s a huge difference between Send and ControlSend().

Also.. The problem is from the program that you want to send keys or from your PC? Or(Excuse me if i don`t have any idea and maybe this sounds wrong :S is not my intention) the problem are your programing skills?

I can do it, you know :)!

But in some programms every Key that i send via the WinAPI functions, seems to fail ;) (in c++!) But that is just at SOME(!) programms! Most programms do work fine!

If i use AutoIt it works o.O

And now i want to know how AutoIt sends keystrokes to programms ;) (Not how to use AutoIt!)

Edited by Alia5

Share this post


Link to post
Share on other sites
GEOSoft

That would be a question for the developers and since AutoIt is not open source you may just get a general reply or none at all.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Alia5

That would be a question for the developers and since AutoIt is not open source you may just get a general reply or none at all.

Yeah but i couldn't post this in Dev-Chat forums :) What i did say above btw...

Dang... Why cant people read properly? -.-

Share this post


Link to post
Share on other sites
GEOSoft

Dang... Why cant people read properly? -.-

I'm not sure why you can't read properly. I said nothing at all about Dev-Chat; I just said it was for the developers.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
monoscout999

only curiosity what program it ressist automation?

Share this post


Link to post
Share on other sites
Xandy

my solution to this:

make autoit exe's that do a task

make c++ programs to do a task

call the different programs from each other when a task is needed.

You can send variables as arguments to your different programs, or make data files to instruct modules(programs) what to do.

have autoit script running managing your hotkeys, and there you have it.

Edited by songersoft

Share this post


Link to post
Share on other sites
Exit

Perhaps it would be wise to show a short C++ (or whatever language you use) sample, which fails on certain programms.

Then a DEV could have a look on it and comment it. Just give this a try. :)

BTW, you can write-access the DEV forum when your postcount is above a certain limit. I don't know the exact number.


My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites
smartee

So my questions is now how does AotoIt's Send-command send Keystrokes to Programms? It Seems not to use WinAPI functions oO

Exactly, last I checked, it used PostMessage.

Share this post


Link to post
Share on other sites
Alia5

Perhaps it would be wise to show a short C++ (or whatever language you use) sample, which fails on certain programms.

Then a DEV could have a look on it and comment it. Just give this a try. :)

BTW, you can write-access the DEV forum when your postcount is above a certain limit. I don't know the exact number.

I just use WinAPI functions like in MSDN.. and it works in almos every, but not all applications so the problem is not the way i use them.

Share this post


Link to post
Share on other sites
Exit

I just use WinAPI functions like in MSDN.. and it works in almos every, but not all applications so the problem is not the way i use them.

OK, no source, no error. I'm out of this case. :)

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites
3mustgetbeers

Mate, I tend to find people are much more inclined to help when you show a little more humility on approach.

Posts such as

Did you even read my post?! -.-

and

Dang... Why cant people read properly? -.-

generally make people stop reading, not want to investigate. I'm not having a go, just a tip :)

Out of my depth but hope you get it sorted ;)

Share this post


Link to post
Share on other sites
monoscout999

I fyou can told us what application want to automatize or show us some code maybe we can help you... there are many winapi functions from MSDN you also can send or post messages but if you don`t show us something that allows us to try something, why you post here?

Share this post


Link to post
Share on other sites
Alia5

PostMessage(hwnd,WM_KEYDOWN,0x4B,0); //Should send "k" - Works in Notepad etc, fails in some applications...

PostMessage(hwnd,WM_KEYUP,0x4B,0);

SendMessage(hwnd,WM_KEYDOWN,0x4B,0); //Should send "k" - Works in Notepad etc, fails in some applications...

SendMessage(hwnd,WM_KEYUP,0x4B,0);

hwnd is correct -> mouseclicks using postmessage work perfectly!

keybd_event( 0x4B, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 );

keybd_event( 0x4B, 0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); //Should send "k" - Works in Notepad etc, fails in some applications...

etc...

everyhing mouse related just works fine and the way you would expect...

but keystrokes aren't working -.-

Share this post


Link to post
Share on other sites
monoscout999

i`m really curious about what application and what control resist automation.

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  

×