?
Solved

Send Message ENTER to a Dialog

Posted on 2005-04-25
5
Medium Priority
?
1,160 Views
Last Modified: 2008-05-09
Hi Experts

My machine uses WinXP. I have a dialog 'About' with a button 'OK' show on the sceen. I want to program a app (C#) send a message ENTER to this dialog to Close the dialog
How to do this?

Thanks
0
Comment
Question by:vinhnl
  • 3
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
WebSpecials earned 2000 total points
ID: 13859435
hi

in the System.Windows.Forms namespace there is a class called SendKeys

so you can say

SendKeys.Send("{ENTER"},true);

and it emulates enter. If you include that in a timer or a function thats called on your wanted event you can send that.
The documentation for the class.
ms-help://MS.NETFrameworkSDKv1.1.DE/cpref/html/frlrfsystemwindowsformssendkeysclasssendtopic.htm

mfg maZe
0
 
LVL 8

Author Comment

by:vinhnl
ID: 13859519
But the dialog isn't in the application
0
 
LVL 2

Expert Comment

by:WebSpecials
ID: 13861157
that doesnt matter...

thats a global keyboard hook... you can use it everywhere... it just emulate a key press in the active window your working in...

mfg WebSpecials
0
 
LVL 8

Author Comment

by:vinhnl
ID: 13862874
yes. but maybe this form isn't active.
0
 
LVL 8

Author Comment

by:vinhnl
ID: 13863996
thanks WebSpecials. You are correct!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question