問題描述
我試圖點擊名為 Media Subtitler 的程序中的菜單項,但無論我嘗試做什么,它都不起作用.
I'm trying to click on a menu item inside a program called Media Subtitler and whatever I'm trying to do it's not working.
首先,我嘗試使用函數 GetMenu 但它返回 IntPtr.Zero.然后,我嘗試使用 ALT 鍵 + 使用菜單的第一個字母(F 代表文件),但它什么也沒做.然后,我嘗試使用簡單的 MOUSEDOWN 和 MOUSEUP 消息,但同樣,它什么也沒做(我還嘗試創建一個循環,點擊該范圍內的所有內容,但沒有點擊該區域).
First, I tried to use the function GetMenu but it returned IntPtr.Zero. Then, I tried using the ALT key + using the first letter of my menu (F stands for file) but it did nothing. Then, I tried using a simple MOUSEDOWN and MOUSEUP messages but again, it did nothing (I also tried creating a loop that clicks on everything in that range but there was no click in that area).
我清楚地知道我在正確的窗口上工作.
What I clearly know is that I'm working on the correct window.
我做錯了什么?
如果有人想測試一下,您可以免費下載 Media Subtitler,它的重量并不大.
If someone wants to test it out you can download Media Subtitler for free and it doesn't weight that much.
另外,這是我一直在測試的代碼:
Also, Here's the code I've been testing:
Process p = Process.Start(@"C:Program FilesDivXLandMedia SubtitlerMediaSub.exe");
p.WaitForInputIdle(1500);
Thread.Sleep(3000);
SetForegroundWindow(p.MainWindowHandle);
ShowWindow(p.MainWindowHandle, SW_MAXIMIZE);
IntPtr handle = p.MainWindowHandle;
SendMessage(handle, WM_NCHITTEST, 0, MakeLParam(18, 29));
//for (int i = 0; i < 200; i++)
//{
// for (int x = 0; x < 200; x++)
// {
// SendMessage(p.MainWindowHandle, WM_LBUTTONDOWN, 0, MakeLParam(i, x));
// SendMessage(p.MainWindowHandle, WM_LBUTTONUP, 0, MakeLParam(i, x));
// }
/
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!