danielsmusic,
You only want to hide your window? I thought you wanted the process to completely disappear (not listed in the Task Manager).
Hiding your window is pretty easy, and doesn't require MFC at all, even less so .NET... :roll:
You simply need to use the Win32 API directly (windows.h), and it can be done in a console app. Note that there must be hundreds of ways to do this. Here's one :
Code:
#include <windows.h>
int main(int argc, char* argv[])
{
printf("Hello World!\n");
Sleep( 2000 );
HWND hw = FindWindow( "ConsoleWindowClass", "C:\\projects\\hidden\\release\\hidden.exe" );
ShowWindow( hw, SW_HIDE );
Sleep( 2000 );
ShowWindow( hw, SW_SHOW );
Sleep( 2000 );
return 0;
}
The absolute path must be replaced by the complete text shown in your console app window's title bar. Don't assume it's the complete path to your .exe. Some versions of Windows show different information in the title bar of console apps.
It's not an elegant solution, but like I said, there are several ways to do this, I just never had to do this with a console app, so that's the best I can come up with off the top of my head. Maybe a Win32 guru will chime in.
You obviously only need those 2 lines :
Code:
HWND hw = FindWindow( "ConsoleWindowClass", "C:\\projects\\hidden\\release\\hidden.exe" );
ShowWindow( hw, SW_HIDE );
But if you compile the first code snippet, you will get a demo program that'll confirm this will work on your Windows version, which I don't believe you've mentioned so far?... It works on XP, and probably all NT based Windows. Not sure about 95/98/ME, but chances are good.