sambuddy Posted October 27, 2008 Posted October 27, 2008 Hello, I have a C# app that i wrote and i would like to be able to control it by sending messages to it using autoit. If i use _sendmessage in autoit, what command do i use in C# to receive the message? Thanks
Moderators SmOke_N Posted October 27, 2008 Moderators Posted October 27, 2008 Hello, I have a C# app that i wrote and i would like to be able to control it by sending messages to it using autoit. If i use _sendmessage in autoit, what command do i use in C# to receive the message?ThanksThis seriously has nothing to do with AutoIt. You'll only find a handful of people on this forum familiar with C#, but your question is directly related to C# and not AutoIt itself (as the answer would apply to any language that sent a SendMessage() api call to your app).I'd suggest you: http://www.google.com/search?q=c%23+forums...lient=firefox-a used one of these forums to ask your C# specific questions. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Richard Robertson Posted October 27, 2008 Posted October 27, 2008 Just for the sake of doing so though, to receive those window messages, you'll have to override the WndProc of your form.
sambuddy Posted October 27, 2008 Author Posted October 27, 2008 Hello Richard, Thankyou for your reply. I have now got it working and I have got my autoit scripts controlling some apps (woohoo). I was initially using mouse clicks but i had one (3rd party) app that kept on stealling focus, hence this message sending will make the scripts more robust. My appologies to the moderator for asking a C# question on the autoit forum. My intention was to find out what the opposite of the sendmessage function was (e.g. receivemessage) but it obviously didn't come out that way. Anyway, it's all working now
Richard Robertson Posted October 27, 2008 Posted October 27, 2008 If I recall, SendMessage sends window messages. If I am correct, then you just override the WndProc function in the Form object. You'll want to make sure you check for the message you are sending, and pass all others to the base class implementation of WndProc though. Otherwise you'll lose all the messages that you don't handle yourself.
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