Question: using SendMessage via DllImport 
Author Message
 Question: using SendMessage via DllImport

I have the handle to the window that I want to send the keystrokes to and I
have this:

[DllImport("user32.dll")]
private static extern bool SendMessage(
        IntPtr hWnd,   // handle to destination window
        UInt32 Msg,    // message
        Int32 wParam,  // first message parameter
        Int32 lParam   // second message parameter
        );

Now how do I use this to send Ctrl-A to select all and then Ctrl-C to copy?  
What is the syntax?

Thanks



Mon, 14 Feb 2005 03:02:53 GMT  
 Question: using SendMessage via DllImport
Well I figured out the copy part,

SendMessage(WindowFromPoint(MyPoint),WM_COPY,0,0);

but I can't figure out the select all part.  Can anyone help me here?

Thanks.


Quote:
> I have the handle to the window that I want to send the keystrokes to
> and I have this:

> [DllImport("user32.dll")]
> private static extern bool SendMessage(
>      IntPtr hWnd,   // handle to destination window
>      UInt32 Msg,    // message
>      Int32 wParam,  // first message parameter
>      Int32 lParam   // second message parameter
>      );

> Now how do I use this to send Ctrl-A to select all and then Ctrl-C to
> copy?   What is the syntax?

> Thanks



Mon, 14 Feb 2005 21:37:07 GMT  
 Question: using SendMessage via DllImport

Quote:
>but I can't figure out the select all part.  Can anyone help me here?

Selection is done with the EM_SETSEL message.

Mattias

===
Mattias Sj?gren (VB MVP)

http://www.msjogren.net/dotnet/



Mon, 14 Feb 2005 22:36:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Trapping SendMessage via interop services

2. Crashing when sending a pointer to a large chunk of shared memory via an IPC SendMessage

3. activation of c++ program using _spawnl from dll imported through DllImport

4. Pb integrating a System dll into a C# project using DllImport

5. Using __declspec(dllexport) and __declspec(dllimport)?

6. C2099 vc++ compiler error while using __dllspec(dllimport)...

7. problem using dll in aplikation Link error: "__declspec(dllimport)

8. using DllImport in Visual Studio .NET

9. Using DLLImport Attribute in C#

10. Using DllImport with Out Parameters

11. __declspec(dllexport/dllimport) Question

12. Dllimport question

 

 
Powered by phpBB® Forum Software