Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


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

SendMessage (User32)MouseClick (user32)
 
.
Summary
Mouse click to inactive windows form - 비활성 창 마우스 클릭 방법

C# Signature:

[DllImport("user32.dll")]
  public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam);

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

I did try in vs2017.

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

Mouse Position is must from selected in windows form.

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

Get Window position function is...

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

GetWindowRect

Tips & Tricks:

Please add some!

Sample Code:

for C#

  [DllImport("user32.dll")]
  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 - winsowRect.top;
      int lparm = (Y << 16) + X;
      int lngResult = SendMessage(iHandle, WM_LBUTTONDOWN, 0, lparm);
      int lngResult2 = SendMessage(iHandle, WM_LBUTTONUP, 0, lparm);
  }

Documentation

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 PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions