vc中如何 *** 作外部程序

vc中如何 *** 作外部程序,第1张

EnableWindow(hwnd,TRUE)

或者看看

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 to

be 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是不是个有效的可执行程序双击能运行起来嘛


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/11058117.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-13
下一篇 2023-05-13

发表评论

登录后才能评论

评论列表(0条)

保存