I'm just lightly delving into windows programming.
Not exactly sure what the difference is between the windows aPI and MFC (Though I hear the MFC is quite old and it sounds to me like another layer on top of the WinAPI).
Anyway the problem is this I am testing for the result of a message box and executing a conditional statement depending on the result, problem is the condition always seems to result to true. Anyway here's the portion of code that does that. Is there anything wrong with the logic??
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int answer; //stores the result of the message box
HINSTANCE hInstance = GetModuleHandle(NULL);
GetModuleFileName(hInstance, szFileName, MAX_PATH);
answer = MessageBox(hwnd, "Exit Applications Test Zone??", "Quit", MB_YESNO | MB_ICONINFORMATION);
if (answer = IDYES) DestroyWindow(hwnd); //Always seems to result to IDYES.... Why??
return DefWindowProc(hwnd, msg, wParam, lParam);