或者看看
bool CTest::EnumWin()
{
HWND hHWWnd = FindWindow( NULL, "我的窗口" )
if( hHWWnd == NULL )
{ AfxMessageBox("Faild")
return false}
else{
CString strT
strT.Format("hWnd: %X",hHWWnd )
AfxMessageBox( strT )
m_hHWWnd = hHWWnd }
EnumChildWindows( m_hHWWnd , (WNDENUMPROC)EnumChildProc, (LPARAM)NULL)
return true
}
BOOL CALLBACK EnumChildProc( HWND hwnd, LPARAM lParam)
{
if (hwnd)
{
//这里可以调用getclassname来的到控件类名,然后分别处理。。。
//。。。
char chText[MAX_PATH]
ZeroMemory( chText, MAX_PATH )
GetWindowText( hWnd, chText, MAX_PATH )
//...
return TRUE
}
return FALSE
}
The command line (file name plus optional parameters) for the application tobe executed. If the name of the executable file in the lpCmdLine
parameter does not contain a directory path, the system searches for the
executable file in this sequence:
The directory from which the application loaded.
The current directory.
The Windows system directory. The
GetSystemDirectory
function retrieves the path of this directory.
The Windows directory. The
GetWindowsDirectory
function retrieves the path of this directory.
The directories listed in the PATH environment variable
com.exe路径对不对?写成绝对路径试试。com.exe这个exe是不是个有效的可执行程序,双击能运行起来嘛
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)