Jump to content

Receiving "sendmessage" in a C# application


 Share

Recommended Posts

  • Moderators

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

This 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.

Link to comment
Share on other sites

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 :P

Link to comment
Share on other sites

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.

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...