Destory window not working

It is required to   close  other  application  from  my  project .I  am  able to find window  by  FindWindow,but  destoy window does  not  destory  it.Will  any  one  able to tell  what should I  do?

CWnd* wnd = CWnd::FindWindow(NULL,_T("EIAQUANT REPORT"));
	DestroyWindow(wnd->m_hWnd);

Open in new window

ADITYA RAOSoftware DeveloperAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Tom ChadaraviciusConnect With a Mentor Senior DeveloperCommented:
::SendMessage(wnd->m_hWnd,WM_CLOSE,0,0);
or
::SendMessage(wnd->m_hWnd,WM_DESTROY,0,0);
0
 
ADITYA RAOSoftware DeveloperAuthor Commented:
::SendMessage(wnd->m_hWnd,WM_DESTROY,0,0);  this worked perfectly
1
All Courses

From novice to tech pro — start learning today.