how close a window using the SendMessage()?

i have a class destroctur:
1
2
3
4
5
6
7
8
~form()
        {
            if(IsWindowVisible(hwnd)==TRUE)
                FormCount=FormCount-1;
            DestroyCursor(hCursor);
            DestroyWindow(hwnd);
            hwnd = 0;
        }

how can send the WM_CLOSE with SendMessage() function?
Use EndTask if you want, this is what Task Manager uses for example:
https://msdn.microsoft.com/en-us/library/ms633492%28VS.85%29.aspx

AS for "how you send WM_CLOSE" see for yourself:
https://msdn.microsoft.com/en-us/library/ms632617%28v=vs.85%29.aspx

It will be:
SendMessage ( hwnd, WM_CLOSE, NULL, NULL ) ;
Topic archived. No new replies allowed.