首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > WinCE >

ShellExecuteEx启动A.exe,然后A.exe最小化隐藏,请教怎么能让A.exe界面显示出来

2012-03-30 
ShellExecuteEx启动A.exe,然后A.exe最小化隐藏,请问如何能让A.exe界面显示出来如题FindWindow(null,Text(

ShellExecuteEx启动A.exe,然后A.exe最小化隐藏,请问如何能让A.exe界面显示出来
如题

FindWindow(null,Text("A"))找不到A程序的窗口句柄

[解决办法]
第二个参数是程序的窗口标题 

C/C++ code
CWnd::FindWindow This   method   retrieves   the   top-level   CWnd   whose   window   class   is   specified   by   lpszClassName   and   whose   window   name,   or   title,   is   specified   by   lpszWindowName.   This   method   does   not   search   child   windows. static   CWnd*   PASCAL   FindWindow(   LPCTSTR   lpszClassName,   LPCTSTR   lpszWindowName   );   Parameters lpszClassName   Points   to   a   null-terminated   string   that   specifies   the   window   class   name,   a   WNDCLASS   structure.   If   the   lpClassName   parameter   is   NULL,   then   all   class   names   result   as   a   successful   match.   lpszWindowName   Points   to   a   null-terminated   string   that   specifies   the   window   name,   the   window   title.   If   the   lpWindowName   parameter   is   NULL,   then   all   window   names   result   as   a   successful   match.   Return   Value Identifies   the   window   that   has   the   specified   class   name   and   window   name.   It   is   NULL   if   no   such   window   is   found.   The   CWnd*   may   be   temporary   and   should   not   be   stored   for   later   use. Example //   Activate   an   application   with   a   window   with   a   specific   class   name.         BOOL   COneT32App::FirstInstance()         {             CWnd   *pWndPrev,   *pWndChild;             //   Determine   if   a   window   with   the   class   name   exists...             if   (pWndPrev   =   CWnd::FindWindow(_T( "MyNewClass "),NULL))             {                 //   If   so,   does   it   have   any   popups?                 pWndChild   =   pWndPrev-> GetLastActivePopup();                 //   If   iconic,   restore   the   main   window.                 if   (pWndPrev-> IsIconic())                     pWndPrev-> ShowWindow(SW_RESTORE);                 //   Bring   the   main   window   or   its   popup   to   the   foreground                 pWndChild-> SetForegroundWindow();                 //   and   you   are   done   activating   the   other   application.                 return   FALSE;             }         } 

热点排行