|
-
July 30th, 1999, 03:52 AM
#1
destroy another window
Hi!
I want to destroy another windows.
I coded it.
==================================
HWND hWnd;
hWnd = ::FindWindow(NULL,"test");
: estroyWindow(hWnd);
==================================
But I can't destroy "test window".
What's wrong there? or How do I destroy window?
Buy..^-^ <: <: ....
-
July 30th, 1999, 04:16 AM
#2
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 )
{
: estroyWindow(hWnd);
delete pWnd;
}
Let me know if this help you
Regards,
Ovidiu
-
July 30th, 1999, 07:40 AM
#3
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);
-
July 30th, 1999, 08:30 AM
#4
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);
-
July 30th, 1999, 08:33 AM
#5
Re: destroy another window
yep its that.. i made mistake.. sorry..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|