SendMessage function?

  • Thread starter Thread starter Dave Veeneman
  • Start date Start date
D

Dave Veeneman

I need to send a message (WM_SETREDRAW) to a windows form. However, I don't
have a SendMessage() function, and I don't think C# or the .Net framework
have such a function built-in. Can someone provide canonical C# code for
such a function in C#? I'd like to avoid recreating the wheel. Thanks.
 
Hi Dave,

You should P/Invoke to the SendMessage Windows API.
 
Hi,

Use P/Invoke:

[DllImport("user32.dll")]

public extern static int SendMessage(IntPtr hwnd, uint msg, uint wParam,
uint lParam);


Cheers,
 
The best thing to do here is to P/Invoke SendMessage.



--
Jared Parsons [MSFT]
(e-mail address removed)
This posting is provided "AS IS" with no warranties, and confers no rights.
OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
 
Back
Top