分类: C/C++
2010-07-19 10:18:00
Application->Initialize();
SetWindowLong(Application->Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW); // 不显示在任务栏
Application->CreateForm(__classid(TForm1), &Form1);
Application->CreateForm(__classid(TForm2), &Form2);
Application->Run();
void __fastcall TForm1::CreateParams(Controls::TCreateParams &Params)
{
TForm::CreateParams(Params);
Params.ExStyle |= WS_EX_APPWINDOW;
Params.WndParent = GetDesktopWindow();
}
void __fastcall TForm1::MyShow()
{
SetWindowLong(Application->Handle,GWL_EXSTYLE,WS_EX_OVERLAPPEDWINDOW);
Show();
}
void __fastcall TForm2::MyShow()
{
SetWindowLong(Application->Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);
Show();
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Form1->Hide();
Form2->MyShow();
}