1
C#에서 sendmessage API의 버튼 클릭을 시뮬레이트하려면 어떻게해야합니까?버튼 sendmessage API에서 클릭
C#에서 sendmessage API의 버튼 클릭을 시뮬레이트하려면 어떻게해야합니까?버튼 sendmessage API에서 클릭
C 코드 :
#include <Windows.h>
//...
SendMessage(hWndButton, BM_CLICK, 0, 0);
C# 코드 :
[DllImport("user32.dll")]
static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
...
Button myButton = ...;
const int BM_CLICK = 0x00F5;
SendMessage(myButton.Handle, BM_CLICK, IntPtr.Zero, IntPtr.Zero);
그러나 C#으로, 당신은 그냥 쉽게 수행 할 수 있음을 유의하십시오
myButton.PerformClick();
는 u는이 학습과를 exaplin 수 있습니다 부디? –
정말 C#입니까? –
죄송합니다. C 버전의 힌트였습니다. C# 버전은 아래에 있습니다. 말 그대로해야 할 것은 정확한 'myButton' 함수를 호출하는 것입니다. – Mehrdad