Guillermo Gutierrez
2004-08-20 20:14:01 UTC
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 = "Q:\\QA\\2004-08 RC1\\lp4.exe";
char* cDestination = "C:\\Documents and Settings\\ggutierrez\\Desktop\\lp4.exe";
cout<<"gonna copy:\n";
cout<<"this ->" << cFileToCopy<<endl;
cout<<"to this->" << cDestination<<endl;
system("PAUSE");
if (CopyFile(cFileToCopy, cDestination, false) == 0)
{
MessageBox(NULL, "File Copy Failed", "Error", MB_OK);
}
MessageBox(NULL, "Files Copied Successfully.", "Copy Complete", MB_OK);
system("PAUSE");
return 0;
}
any suggestions?
Guillermo Gutierrez
Market Scan Information Systems
Software Q.A. Supervisor
(818) 575-2000 x2427
***@marketscan.com
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 = "Q:\\QA\\2004-08 RC1\\lp4.exe";
char* cDestination = "C:\\Documents and Settings\\ggutierrez\\Desktop\\lp4.exe";
cout<<"gonna copy:\n";
cout<<"this ->" << cFileToCopy<<endl;
cout<<"to this->" << cDestination<<endl;
system("PAUSE");
if (CopyFile(cFileToCopy, cDestination, false) == 0)
{
MessageBox(NULL, "File Copy Failed", "Error", MB_OK);
}
MessageBox(NULL, "Files Copied Successfully.", "Copy Complete", MB_OK);
system("PAUSE");
return 0;
}
any suggestions?
Guillermo Gutierrez
Market Scan Information Systems
Software Q.A. Supervisor
(818) 575-2000 x2427
***@marketscan.com