Ich möchte eine GUI erstellen, die alle Elemente der Standard Titelleiste anzeigt aber nicht den Close-Button. Aber das ist wohl nicht möglich.
Oder hat das jemand mal hinbekommen. Ich habe keine große Lust, mir eine eigene Titelbar zu erstellen.
Ich möchte eine GUI erstellen, die alle Elemente der Standard Titelleiste anzeigt aber nicht den Close-Button. Aber das ist wohl nicht möglich.
Oder hat das jemand mal hinbekommen. Ich habe keine große Lust, mir eine eigene Titelbar zu erstellen.
Hier ein Beispiel, um das Close Button zu deaktivieren: https://www.autoitscript.com/f…ndComment&comment=1185617
Was anderes habe ich momentan nicht gefunden.
Hier ein Beispiel, um das Close Button zu deaktivieren
Ja Danke, aber das ist in etwa derselbe Aufwand, wie eine eigene Titlebar. Werde ich mir in Ruhe überlegen, was besser ist.
EDIT:
Der Close Button wird damit nur funktionslos, das geht genauso mit umleiten der Msg. Ich hätte den Button gerne komplett weg.
Der Close Button wird damit nur funktionslos, das geht genauso mit umleiten der Msg. Ich hätte den Button gerne komplett weg.
Annähernd dein Wunschergebnis:
;https://www.autoitscript.com/forum/topic/162915-re-enable-closure-x/?do=findComment&comment=1185617
$hGUI = GUICreate("Example", 200, 22, -1, -1, BitOR($WS_CAPTION, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SYSMENU))
The menu item to be enabled, disabled, or grayed, as determined by the uEnable parameter. This parameter specifies an item in a menu bar, menu, or submenu.
Controls the interpretation of the $iItem parameter and indicate whether the menu item is enabled, disabled, or grayed. This parameter must be a combination of the following values.
Indicates that $iItem gives the identifier of the menu item. If neither the MF_BYCOMMAND nor MF_BYPOSITION flag is specified, the MF_BYCOMMAND flag is the default flag.
Indicates that the menu item is enabled and restored from a grayed state so that it can be selected.
The return value specifies the previous state of the menu item (it is either MF_DISABLED, MF_ENABLED, or MF_GRAYED).
$aResult = DllCall("user32.dll", "bool", "EnableMenuItem", "hwnd", $hMenu, "uint", $iItem, "uint", $iEnable)
If this parameter is FALSE, GetSystemMenu returns a handle to the copy of the window menu currently in use. The copy is initially identical to the window menu, but it can be modified.
If this parameter is TRUE, GetSystemMenu resets the window menu back to the default state. The previous window menu, if any, is destroyed.
mfg (auto)Bert
Danke für eure Tipps. Disablen geht so ganz praktisch.
Ich versuche mal weiter, ob man den Button auch vom Menü entfernen kann.
Mit der MetroGUI-UDF soltle das auch gehen.
Gruß gmmg
There's a script in this thread that removes the close button, not only disable...
There's a script in this thread that removes the close button, not only disable...
That's not the issue. Bugfix asked if it's possible to remove the close button only, that means you have still the min/max buttons available.
UEZ, seems i misunderstood the thread i linked to, i thought one could remove either, like remove the close button only.
So is it, remove the min/max buttons, but keep the close button, or remove all only, not the close button alone ?
Would it be possible to remove them all and then add the min/max buttons?
(cant check myself right now :p )
um neben dem Ausgrauen des Close-Buttons wie bei autoBerts Vorschlag auch noch die System-Menü-Einträge zu verstecken
Das ist leider nicht zielführend. Ich kann ja den Close-Button kpl. "verschwinden" lassen durch Überzeichnen. Aber dann sind die Min/Max-Button etwas "verloren" positioniert. Dann schon lieber disabled.
Ich hatte schon probiert, eine neue Menüleiste zu erstellen und alle Elemente außer dem Close-Button zu kopieren und dann mit anderer Position zu platzieren. Leider ist diese Menüleiste wohl tief im System verankert. Mir gelingt es bisher nicht die Informationen der einzelnen Menüelemente vollständig zu rekonstruieren.
Aber dann sind die Min/Max-Button etwas "verloren" positioniert. Dann schon lieber disabled.
Ist das denn so schlimm, dass der Close-Button zwar vorhanden ist, aber halt disabled?
Ich denke, das ist doch einfach der "Look an feel" von Windows. Ein Fenster ohne Close-Button wirkt IMHO eher wie ein Exot (zumindest wenn es sich nicht um ein Fenster komplett ohne Systemmenü handelt).
Ist das denn so schlimm, dass der Close-Button zwar vorhanden ist, aber halt disabled?
Nein, ist nicht schlimm. Kann ich durchaus mit leben. - Aber irgendwie ärgert es einen, wenn man es nicht verbiegen kann.