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~~或者有没有更好的办法啊。

解决方案 »

  1.   

    For   GUI   processes,   this   is   used   only   the   first   time   the   new   process   calls   CreateWindow   to   create   an   overlapped   window   if   the   nWidth   parameter   of   CreateWindow   is   CW_USEDEFAULT.   
          
        
      看msdn的说明,还要对应的exe   程序在调用   CreateWindow   时,   
      带有   CW_USEDEFAULT   这个标记,估计   QQ  没有取窗体句柄,用setwindowpos吧
      

  2.   

    老大能不能告诉我,怎么取窗体句柄,
    可不可以
    不用::FindWindow();的。
    有别的方法有吗?//
      

  3.   

    http://topic.csdn.net/u/20081104/11/5c466939-b4d1-4a32-9fc9-868f87787391.html
    QQ估计FindWindow搞不定的,你看看他的方法