如图所示,广联达二级窗口,总是卡在两个屏幕的中间,需要拖动一下,每天拖动几百次,很麻烦啊,有没有解决的办法~
可以写一个程序驻留在后台,发现这个对话框,就自动帮你移动下。
代码如下:
// Q701761.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "windows.h"
int _tmain(int argc, _TCHAR* argv[])
{
while (true)
{
HWND h = FindWindow(NULL, _T("测试.txt - Notepad")); //这里换成你窗口标题的文字。比如“请输入”
if (h != 0)
{
RECT rect;
GetWindowRect(h, &rect);
MoveWindow(h, 0, 0, rect.right - rect.left, rect.bottom - rect.top, true);
printf("found the window!\n");
Sleep(1000);
}
else
{
Sleep(100);
}
}
return 0;
}