(CodeLib-Manager)
Registriert seit: 10. Jun 2002
4.648 Beiträge
Delphi XE Professional
|
Re: TXStyleForm reloaded 1.1 beta 1 - Formular mit Skin
28. Feb 2009, 09:18
Hallo Sebastian, ich habe mal den Code im WMNCRButtonUp so angepasst, dass das Systemmenü angezeigt wird.
Delphi-Quellcode:
procedure TXStyleContainer.WMNCRButtonUp( var message: TWMNCRButtonUp);
const
A: array[Boolean] of Integer = (MF_BYCOMMAND or MF_GRAYED, MF_BYCOMMAND or MF_ENABLED);
var
hMenuHandle: HMENU;
hOwner: HWND;
Cmd: Cardinal;
begin
hOwner := GetWindow( Handle, GW_OWNER);
if hOwner <> 0 then
begin
hMenuHandle := GetSystemMenu(hOwner, false);
if hMenuHandle <> 0 then
begin
EnableMenuItem(hMenuHandle, SC_RESTORE, A[IsIconic(hOwner) or IsZoomed(hOwner)]);
EnableMenuItem(hMenuHandle, SC_MINIMIZE, A[ not IsIconic(hOwner)]);
EnableMenuItem(hMenuHandle, SC_MAXIMIZE, A[ not IsZoomed(hOwner)]);
Cmd := Cardinal(TrackPopupMenu(hMenuHandle, TPM_RETURNCMD, message.XCursor, message.YCursor, 0, hOwner, nil));
if Cmd <> 0 then
PostMessage(hOwner, WM_SYSCOMMAND, Cmd, 0);
end;
end;
end;
Thomas
|
|
Zitat
|