C++Builder logo
Hide Application from the taskbar Cacher l'application dans la barre des tâches
 
To hide the application from the taskbar, you have to include two lines in the project1.cpp file. So, the window doesn't appear when launched and its name doesn't appear in a button in the taskbar. Pour cacher le nom de l'application de la barre de tâches et pour que la fenêtre principale du programme ne s'affiche pas, il suffit d'ajouter deux lignes au fichier project1.cpp.

WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int

 try 
 { 
  Application->Initialize(); 
  Application->CreateForm(__classid(TForm1), &Form1); 
  ShowWindow(Application->Handle,SW_HIDE);          //Add this line 
  //Form not shown at startup 
  Application->ShowMainForm=false;                  //Add this line 
  Application->Run(); 
 } 
 catch (Exception &exception) 
 { 
  Application->ShowException(&exception); 
 } 
 return 0; 
}


In your code, if you want your window to show up, add these lines : Si, dans le programme, vous voulez faire réapparaître la fenêtre, ajoutez ces lignes à votre code :

ShowWindow(Application->Handle,SW_SHOW); 
Visible=true;


If you want in your code to hide the window previously shown up, add this : Pour faire disparaître la fenêtre par code après l'avoir afficher, faites ceci :

ShowWindow(Application->Handle,SW_HIDE); 
Visible=false;