Ok, here I have some code (very stripped down so it isn't too boring to read):
Code:
HWND dlg = CreateDialog(hinst, MAKEINTRESOURCE(IDD_TRANSFER),
parent, UploadProc);
ShowWindow(dlg, SW_SHOW);
MSG msg;
bool done = false;
while(!done && !file.eof()) //I don't think file is the problem
{
while(PeekMessage(&msg, dlg, 0, 0, PM_REMOVE))
{
if(msg.message == WM_CLOSE ||
(msg.message == WM_COMMAND && LOWORD(msg.wParam) == IDCANCEL))
{
done = true;
server->send(ICV_OP_CANCEL);
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if(done)
break;
//Other stuff
}
DestroyWindow(dlg);
IDCANCEL is a button that says "cancel". For some reason, this message loop doesn't seem to want to quit, and I can't figure out for the life of me why, since clicking the x in the corner of the dialogbox should (in my world) send WM_CLOSE. Can anybody help me out here? It's sorta a big thing for me, since I thought I had Windows messages all sorted out already