我试图点击名为 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));
// }
/
LINQ to SQL 和并发问题LINQ to SQL and Concurrency Issues(LINQ to SQL 和并发问题)
try/catch 块的收益回报Yield return from a try/catch block(try/catch 块的收益回报)
重用带有事务的 SqlCommand 时,我应该调用 ParameShould I call Parameters.Clear when reusing a SqlCommand with a transation?(重用带有事务的 SqlCommand 时,我应该调用 Parameters.Clear 吗
处理时不带变量的 using 语句有什么作用?what does a using statement without variable do when disposing?(处理时不带变量的 using 语句有什么作用?)
为什么 TransactionScope 不适用于实体框架?Why doesn#39;t TransactionScope work with Entity Framework?(为什么 TransactionScope 不适用于实体框架?)
如何在可取消的 async/await 中处理 TransactionScope?How to dispose TransactionScope in cancelable async/await?(如何在可取消的 async/await 中处理 TransactionScope?)