void CMouse_testDlg::OnButton1()
{
// TODO: Add your control notification handler code here
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si,sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwX=0;
si.dwY=0;
si.dwFlags=STARTF_USEPOSITION;
si.cbReserved2=0;
si.lpReserved2=NULL;
si.wShowWindow=SW_SHOW;
::CreateProcess("E:\\QQ\\QQ.exe", NULL,
NULL, // process info
NULL, // thread info
FALSE, // inheritable
0, // creation flags
NULL, // environment
NULL, // current directory
&si, & pi);
}
这样新建的QQ进程,怎么没在我si.dwX=0,si.dwY=0的位置。
目标:使QQ窗口,坐标在桌面0,0坐标位置(左上角);
help~~或者有没有更好的办法啊。
{
// TODO: Add your control notification handler code here
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si,sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwX=0;
si.dwY=0;
si.dwFlags=STARTF_USEPOSITION;
si.cbReserved2=0;
si.lpReserved2=NULL;
si.wShowWindow=SW_SHOW;
::CreateProcess("E:\\QQ\\QQ.exe", NULL,
NULL, // process info
NULL, // thread info
FALSE, // inheritable
0, // creation flags
NULL, // environment
NULL, // current directory
&si, & pi);
}
这样新建的QQ进程,怎么没在我si.dwX=0,si.dwY=0的位置。
目标:使QQ窗口,坐标在桌面0,0坐标位置(左上角);
help~~或者有没有更好的办法啊。
看msdn的说明,还要对应的exe 程序在调用 CreateWindow 时,
带有 CW_USEDEFAULT 这个标记,估计 QQ 没有取窗体句柄,用setwindowpos吧
可不可以
不用::FindWindow();的。
有别的方法有吗?//
QQ估计FindWindow搞不定的,你看看他的方法