我要触发在我的应用程序按钮的Click事件,
我有按钮句柄,并已通过处理SendMessage的功能,但仍是不是我的程序点击按钮...
代码示例
Process notePad = new Process();
notePad.StartInfo.FileName = @"C:\Users\Fahad\Downloads\Programs\ccleaner.exe";
notePad.Start();
uint processID = 0;
uint threadId = GetWindowThreadProcessId(notePad.MainWindowHandle, out processID);
AttachThreadInput(GetCurrentThreadId(), threadId, true);
SetActiveWindow(notePad.MainWindowHandle);
IntPtr btnHandlr = FindWindowEx(notePad.MainWindowHandle, IntPtr.Zero, "Button", "OK");
SendMessage(btnHandlr, BM_CLICK, 0, 0);
CloseHandle(Handle);
请帮助......的SendMessage()不工作
anyother方式,如果请告诉...