From 8409869f55b178214d4a20f39e19603817d55105 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Fri, 19 Sep 2014 15:44:56 +0100 Subject: Windows: Just for fun, allow the ability to hook into the System Menu This means we can easily add an "About fpGUI" menu item in the System Menu of a window. --- src/corelib/gdi/fpg_gdi.pas | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/corelib/gdi') diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index f1372928..159d73d5 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -347,6 +347,10 @@ var OldMousePos: TPoint; // used to detect fake MouseMove events NeedToUnitialize: Boolean; + +const + ID_ABOUT = 200001; + // some required keyboard functions {$INCLUDE fpg_keys_gdi.inc} @@ -1204,6 +1208,13 @@ begin Windows.EndPaint(w.WinHandle, @PaintStruct); end; + WM_SYSCOMMAND: + begin + if wParam = ID_ABOUT then + fpgSendMessage(nil, w, FPGM_ABOUT, msgp) + else + Windows.DefWindowProc(hwnd, uMsg, wParam, lParam); + end else Result := Windows.DefWindowProc(hwnd, uMsg, wParam, lParam); end; -- cgit v1.2.3-70-g09d2