SendMessage - using for forms
  Home FAQ Contact Sign in
microsoft.public.dotnet.framework.windowsforms only
 
Advanced search
POPULAR GROUPS

more...

microsoft ... windowsforms Profile…
 Up
SendMessage - using for forms         


Author: SushiSean
Date: May 4, 2007 11:07

I Have a question. I use C# to send messages for other wondows.
In my example it is windows notepad.exe
So after I found handle of this window I can send WM_CHAR event.
But I need help with other two types of events.
How can I send
1) Some system key like "F5" ?
2) some combination of them? For example Alt + V ?

This is code which use now.

[DllImport("User32.dll")]
public static extern Int32 FindWindow(String lpClassName, String
lpWindowName);

[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SendMessage(int hWnd, int msg, int wParam,
int lParam);

[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr
childAfter, string className, string windowTitle);

private const int WM_KEYDOWN = 256;
Show full article (1.38Kb)
1 Comment
Re: SendMessage - using for forms         


Author: G Himangi
Date: May 5, 2007 03:42

For Alt=V, use the WM_SYSKEYDOWN followed by WM_SYSKEYUP window message.
For F5, use WM_KEYDOWN followed by WM_KEYUP

---------
- G Himangi, Sky Software http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
---------

"SushiSean" discussions.microsoft.com> wrote in message
news:40077C0A-11DF-40B1-A835-483DA2649A06@microsoft.com...
>I Have a question. I use C# to send messages for other wondows.
> In my example...
Show full article (2.06Kb)
no comments