Desktop Functions:

   Smart Device Functions:

Show Recent Changes
Subscribe (RSS)
Misc. Pages
Helpful Tools
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
SendMessae (User32)MouseClick (user32)
TODO - a short description

C# Signature:

  public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam);

User-Defined Types:


Alternative Managed API:

Do you know one? Please contribute it!


I did try in vs2017.

비주얼 스튜디오 2017 버전에서 테스트 했습니다.

Mouse Position is must from selected in windows form.

마우스 좌표는 선택된 창의 내부 좌표를 넣어야 합니다.

Get Window position function is...

윈도우 포지션 가져오기 참고...


Tips & Tricks:

Please add some!

Sample Code:

for C#

  public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam);

  public const uint WM_LBUTTONDOWN = 0x0201;
  public const uint WM_LBUTTONUP = 0x0202;
  public static void SendMouseClick(int iHandle, int X, int Y)
      int X = X - WindowRect.left;
      int Y = Y -;
      int lparm = (Y << 16) + X;
      int lngResult = SendMessage(iHandle, WM_LBUTTONDOWN, 0, lparm);
      int lngResult2 = SendMessage(iHandle, WM_LBUTTONUP, 0, lparm);


Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

Access directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version