Using WM_QUERYENDSESSION with no defined windows
Posted on 2002-06-18
I'm quite sure this is probably a stupid question. I know a bit of C++, but not Visual C++.
I have a project that runs without any created windows (it's a background process). I need for it to run continuously in the background, respond to messages (I have a working WndProc, I think) and terminate only when the user logs out.
I have a VC++ book in front of me, and it goes on about creating windows and registering window classes and stuff, but I don't want a window. Is this Window class just something you need to be able to get messages? Will it create a window?
My WndProc looks like this:
LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return(DefWindowProc(hwnd, uMsg, wParam, lParam));