PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

pWnd->SendMessage(WM_CLOSE) cannot close

I use this code.

CWnd* pWnd = CWnd::FindWindow(NULL,_T("Windows Media")
if(pWnd)
{pWnd->SendMessage(WM_CLOSE);

This work when the WMP stop playing the file.
Cannot when WMP is still Playing the file.

Thanks
Is pWnd pointing to something? You may be sending it to the wrong window. An app will have multiple windows, most all of the child windows. Make sure you're sending it to the topmost window.

Dan East