1.
Void _ fastcall tfrmloghook: formcreate (tobject * sender)
{
DWORD dwexstyle = getwindowlong (Application-> handle, gwl_exstyle); // these three rows are the task bar after running
Dwexstyle | = ws_ex_toolwindow; // The program cannot be viewed.
Setwindowlong (Application-> handle, gwl_exstyle, dwexstyle); // neither can the Alt + TAB be seen, but can only be seen in the task manager.
}
2.
Winapi winmain (hinstance, hinstance, lpstr, INT)
{
Try
{
Application-> initialize ();
Application-> createform (_ classid (tform1), & form1 );
Application-> showmainform = false; // Add this line and the following line
Showwindow (Application-> handle, sw_hide );
Application-> Run ();
}
Catch (exception & exception)
{
Application-> showexception (& exception );
}
Catch (...)
{
Try
{
Throw exception ("");
}
Catch (exception & exception)
{
Application-> showexception (& exception );
}
}
Return 0;
}
//---------------------------------------------------------------------------