CodePudding user response:
Set up automatic display interface for the login interface engineering OPTION can be set inside,Login successful shows main interface
Otherwise, exit the program,
CodePudding user response:
Or cannot be achieved, and I set is landing interface is the interface to display, but two window will pop up,,CodePudding user response:
WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int)
{
Try
{
//bool kk=run login interface showmodel
//if (kk==false) return 0;
Application - & gt; The Initialize ();
Application - & gt; CreateForm (__classid (TForm1), & amp; Form1);
Application - & gt; The Run ();
}
The catch (Exception & amp; The exception)
{
Application - & gt; ShowException (& amp; The exception);
}
The catch (... )
{
Try
{
Throw Exception (" ");
}
The catch (Exception & amp; The exception)
{
Application - & gt; ShowException (& amp; The exception);
}
}
return 0;
}
CodePudding user response:
With the breakpoint see the main interface when loadedCodePudding user response:
Can the MainForm - & gt; Placed inside the Create login interface,CodePudding user response:
Login screen window can be set to give priority to the Main window Form, after the success of the login again to hide the Main window, don't adopt other window automatically created (in the Project Forms in the Options TAB, removed from the list of Auto - create Forms to the right the Available Forms)CodePudding user response:
WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int){
Try
{
TFormLogin * pFormLogin=new TFormLogin (NULL);
If (mrOk!=pFormLogin - & gt; ShowModule ())//login unsuccessful
{
return;
}
Application - & gt; The Initialize ();
Application - & gt; CreateForm (__classid (TForm1), & amp; Form1);
Application - & gt; The Run ();
}
The catch (Exception & amp; The exception)
{
Application - & gt; ShowException (& amp; The exception);
}
The catch (... )
{
Try
{
Throw Exception (" ");
}
The catch (Exception & amp; The exception)
{
Application - & gt; ShowException (& amp; The exception);
}
}
return 0;
}