1 2 //--------------------------------------------------------------------------- 3 4 #include <vcl.h> 5 #pragma hdrstop 6 //--------------------------------------------------------------------------- 7 USEFORM("Unit1.cpp", Form1); 8 //--------------------------------------------------------------------------- 9 WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 10 { 11 try 12 { 13 Application->Initialize(); 14 Application->CreateForm(__classid(TForm1), &Form1); 15 //add this line to your Project1.cpp 16 Application->ShowMainForm =false; 17 Application->Run(); 18 } 19 catch (Exception &exception) 20 { 21 Application->ShowException(&exception); 22 } 23 catch (...) 24 { 25 try 26 { 27 throw Exception(""); 28 } 29 catch (Exception &exception) 30 { 31 Application->ShowException(&exception); 32 } 33 } 34 return 0; 35 } 36 //---------------------------------------------------------------------------