Posted: Sun Nov 20, 2005 8:17 pm Post subject: hide the dos window
pls tell me there is an easy way to get rid of the dos window.. i mean i'm making a window with winAPI and this stupid dos window shows in the back round all the time.
Sponsor Sponsor
wtd
Posted: Sun Nov 20, 2005 8:19 pm Post subject: (No subject)
Are you using an IDE?
Geminias
Posted: Sun Nov 20, 2005 8:29 pm Post subject: (No subject)
yeah dev c++
my fingers were getting sore from all the command line typing i had to do with mingw. dev c++ is a much more friendly way to go when you're constantly testing little programs.
wtd
Posted: Sun Nov 20, 2005 8:31 pm Post subject: (No subject)
Here's an idea... find the executable Dev-C++ created, if you can, and double-click it.
Geminias
Posted: Sun Nov 20, 2005 8:37 pm Post subject: (No subject)
did you misunderstand me or am i misunderstanding you? that is the question twirling through my brain.
you've seen me post here often enough to know that i certainly know how to run a compiled program. so i hope that isn't what you thought i was asking.
just because i am not an experienced programmer does not mean i am an idiot... but you already know that right? then why treat me like i was born yesterday? maybe you shouldn't help people if it annoys you?
Now for the question:
i use the windows.h preprocessor and winmain() instead of main.. i make my window and it shows up fine, but behind it there is a dos window, is there a way to remove it?
i dont like it there, it looks unprofessional to me.
wtd
Posted: Sun Nov 20, 2005 9:02 pm Post subject: (No subject)
My thinking was that the window was there because the executable was launched via the IDE, which was spawning that to show error output.
Geminias
Posted: Sun Nov 20, 2005 9:11 pm Post subject: (No subject)
hmm, no after my post i checked it by running the .exe but i had no luck. the console window still appeared behind it.
i will likely have to resort to CreateProcess() and make it run silent.. unless you know of a better way?
wtd
Posted: Sun Nov 20, 2005 9:16 pm Post subject: (No subject)
Trying to find something, though it's not easy considering how convoluted Microsoft's documentation is.
As for the IDE thing... I just like to rule out the simple stuff first.
Sponsor Sponsor
Geminias
Posted: Sun Nov 20, 2005 9:18 pm Post subject: (No subject)
yeah i always do a google and search around before i ask any questions here. I understand you're a linux man, but if you find anything let me know.
wtd
Posted: Sun Nov 20, 2005 9:20 pm Post subject: (No subject)
Can I see your code? I'm seeing an "int nCmdShow" arg to WinMain that looks like it might relate to this issue.
Geminias
Posted: Sun Nov 20, 2005 9:28 pm Post subject: (No subject)
I thought that also. It looks a lot like "show command" lol, which was the first thing i went after.
heres a link which should dissuade you from that line of thought.
// Find out if the window was created
if( !hWnd ) // If the window was not created,
return 0; // stop the application
// Display the window to the user
ShowWindow(hWnd, SW_SHOWNORMAL);
UpdateWindow(hWnd);
// Decode and treat the messages
// as long as the application is running
while( GetMessage(&Msg, NULL, 0, 0) )
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}
LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg,
WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
// If the user wants to close the application
case WM_DESTROY:
// then close it
PostQuitMessage(WM_QUIT);
break;
default:
// Process the left-over messages
return DefWindowProc(hWnd, Msg, wParam, lParam);
}
// If something was not done, let it go
return 0;
}
Geminias
Posted: Sun Nov 20, 2005 10:17 pm Post subject: (No subject)
linker error, and i can't do anything about that since i dont know how to make dll's and link them and stuff
wtd
Posted: Sun Nov 20, 2005 10:25 pm Post subject: (No subject)
So, C# is a decent language.
md
Posted: Sun Nov 20, 2005 10:27 pm Post subject: (No subject)
a linker error doesn't mean you need to make dlls, it just means you need to link against the right libraries. Unfortunately I don't know what they would be... but I know that they exist and that msdn should tell you what they are.