TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nick Nichols
NA
8
0
C# Keyboard Emulator, SendKeys, and user32.dll's SendMessage
Jun 17 2008 3:25 AM
Hello all,
I am trying to get my program to emulate keyboard strokes and send to other programs. Currently I am using:
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SendMessage(int hWnd, int msg, int wParam, IntPtr lParam);
and this is proving to be a headache. The way I implemented it, it works fine. I can send keystrokes to almost any program but Notepad (dont know why that wont work but I am guessing it is because there is the "Edit" subwindow inside it).
Anyways, people using the software cant figure out the title/class required. So I want to make a global keyboard presser basically. Something that programs with hotkeys can capture and also any program.
Is the basic SendKey function all that is needed? Will this trigger global hotkeys in other programs too? (I want this to happen, not prevent it!)
Is there a way to emulate an actual keyboard somehow? Maybe actually register a virtual keyboard?! I am just thowing out ideas here.
Thanks in advance!
Reply
Answers (
4
)
generate xml using c#
CLSCompliantAttribute