Hello,
Recently I've been doing some Windows API programming and I came across a problem. I want to make a console program that accepts commands, when the command 'win' shows up it will create a window with some automated features.
Lets say I had a command sendfile [file-path] [where]. I'd like the GUI to allow me to browse the file, and select where from a list of some kind. But the problem I'm having is I'm unsure how to make it so when you close the GUI window it will simply hide and I can call it back through my console window. Currently I've managed to make it go away once but when you try win again it doesn't show up. I also made it so every time you type win it will create the window. That works but it wont save previous data on the forum because it is destroying it and recreating.
Does anyone know how to cancel the close event and make the window hide instead.?
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_QUIT:
// cancel ?
ShowWwindow(hwnd,SW_HIDE);
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
Thank you in advance for reading my long and useless explanation.