MFC DLG - Killing an app
-
Hi, Im using the FindWindow() function to find an application called Fullscreen.exe and then sending a WM_CLOSE call to it. However I get this error: nPOSDlg.cpp(367) : error C2440: '=' : cannot convert from 'class CWnd *' to 'struct HWND__ *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast nPOSDlg.cpp(374) : error C2660: 'SendMessageA' : function does not take 4 parameters This is the code that I have put into my OnAppExit(); because I want it to kill Fullscreen.exe when nPOSdlg closes.
HWND hWnd; hWnd = FindWindow(NULL, TEXT("Fullscreen")); if(hWnd == NULL) { } else { SendMessage(hWnd, WM_CLOSE, 0, 0); }
How do I convert from CWnd to HWND or what do I need to do? Please help, thanks! Ashman -
Hi, Im using the FindWindow() function to find an application called Fullscreen.exe and then sending a WM_CLOSE call to it. However I get this error: nPOSDlg.cpp(367) : error C2440: '=' : cannot convert from 'class CWnd *' to 'struct HWND__ *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast nPOSDlg.cpp(374) : error C2660: 'SendMessageA' : function does not take 4 parameters This is the code that I have put into my OnAppExit(); because I want it to kill Fullscreen.exe when nPOSdlg closes.
HWND hWnd; hWnd = FindWindow(NULL, TEXT("Fullscreen")); if(hWnd == NULL) { } else { SendMessage(hWnd, WM_CLOSE, 0, 0); }
How do I convert from CWnd to HWND or what do I need to do? Please help, thanks! Ashman