[Dev-C++] program with no window or console
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Guillermo G. <ggu...@ma...> - 2004-08-20 22:13:06
|
How would I get a program to run without displaying a console or a =
window?
I just want it to do its thing and then pop up a message box with a =
message at the end.
My program does what I want it to do, but I don't want a console or =
window to appear.
Here is my code:
_____________________________________________
#include <iostream>
#include <stdlib.h>
#include <windows.h>
#include <winbase.h>
using namespace std;
int main(int argc, char *argv[])
{
char* cFileToCopy =3D "Q:\\QA\\2004-08 RC1\\lp4.exe";
char* cDestination =3D "C:\\Documents and =
Settings\\ggutierrez\\Desktop\\lp4.exe";
=20
cout<<"gonna copy:\n";
cout<<"this ->" << cFileToCopy<<endl;
cout<<"to this->" << cDestination<<endl;
system("PAUSE");
=20
if (CopyFile(cFileToCopy, cDestination, false) =3D=3D 0) =20
{
MessageBox(NULL, "File Copy Failed", "Error", MB_OK);
} =20
MessageBox(NULL, "Files Copied Successfully.", "Copy Complete", =
MB_OK);
=20
system("PAUSE");=09
return 0;
}
any suggestions?
Guillermo Gutierrez
Market Scan Information Systems
Software Q.A. Supervisor
(818) 575-2000 x2427
ggu...@ma...
|