Alle Formulare/Programm beenden
-
Ich habe in meinem Programm mehrere Formulare und möchte nun eine art Programm beenden Button einbinden. Gibt es einen Befehl womit ich das ganze Programm schließen kann und ich nicht die einzelnen Formulare beenden muss???
-
Hehe... Wie wärs mit exit(0);
Application Terminate();
-
Super, geht wirklich prima. Und wie ist der Befehl um alles in der Taskleiste verschwinden zu lassen? Wenn ich WindowsState=wsMinimized mache dann befindet sich das minimierte Fenster immernoch auf dem Desktop, das ist nicht ganz was ich will.
-
DWORD dwExStyle=GetWindowLong(Application->Handle,GWL_EXSTYLE);
dwExStyle |= WS_EX_TOOLWINDOW;
SetWindowLong(Application->Handle,GWL_EXSTYLE,dwExStyle);*dank an fatman

-
Da Passiert bei mir nichts, kommt auch keine Fehlermeldung. Könnte das vielleicht an meiner BorderStyle Einstellung der Form liegen?
-
Hier der komplette Artike (ich hoffe das ist keine Copyrightverletzung, stammt von den ehemaligen BCBDEV-Seiten, Howe's FAQs)
Q: Hide the application's taskbar icon
Answer:
First, let's get some terminology straight. The system tray is the little box in the corner of the task bar where programs can display small icons. Some examples include the SysAgent icon, and the Outlook icon when you get new mail. The taskbar is the toolbar that stretches across the screen. This is where program icons are located. To hide a program's taskbar icon, you call the ShowWindow function and pass the Application->Handle window handle.ShowWindow(Application->Handle, SW_HIDE);
To make the taskbar icon re-appear, simply change SW_HIDE to SW_SHOW.
ShowWindow(Application->Handle, SW_SHOW);
Note: You can hide the main form by setting its Visible property to false.
Note: Hiding the form's taskbar icon with ShowWindow is not permanent. Certain actions will cause the taskbar icon to reappear. You can remove a program's taskbar icon and prevent it from ever appearing again by making the hidden application window a tool window. Tool windows never have a taskbar icon. Making the application window a tool window has the side effect of removing the program from the list of programs that appear when the user presses ALT-TAB. You can make the application window a tool window by calling the API GetWindowLong and SetWindowLong functions.
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { DWORD dwExStyle = GetWindowLong(Application->Handle, GWL_EXSTYLE); dwExStyle |= WS_EX_TOOLWINDOW; SetWindowLong(Application->Handle, GWL_EXSTYLE, dwExStyle); try { Application->Initialize(); Application->CreateForm(__classid(TForm1), &Form1); Application->Run(); } catch (Exception &exception) { Application->ShowException(&exception); } return 0;
-
carisma83 schrieb:
Und wie ist der Befehl um alles in der Taskleiste verschwinden zu lassen?
Hallo,falls ich das richtig verstanden habe, wolltest du wissen wie du die Anwedung minimieren kannst ???
Application->Minimize();