Re: destroy another window
I'm not sure will work but try this:
HWND hWnd;
hWnd = ::FindWindow(NULL,"test");
CWnd* pWnd = FromHandle( hWnd );
if( NULL != pWnd )
{
::DestroyWindow(hWnd);
delete pWnd;
}
Let me know if this help you
Regards,
Ovidiu
Re: destroy another window
u can try this but i thinks that is the same..
PostMessage(hWnd,WM_DESTROY,NULL,NULL);
i found it in MSDN : "A thread cannot use DestroyWindow to destroy a window created by a different thread."
maybe for your is better to use this if u want close other window..:
PostQuitMessage(hWnd,WM_CLOSE,NULL,NULL);
Re: destroy another window
This works jus' fine fer me....
CString strTitle = "Input your title here"
HWND hWnd;
hWnd = ::FindWindow(strTitle);
::PostMessage(hWnd,WM_CLOSE,NULL,NULL);
Re: destroy another window
yep its that.. i made mistake.. sorry..