mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 20:50:20 +08:00
Add items "Check for updates" and "About" to window menu of session manager. Fixes issue #1296
This commit is contained in:
@ -52,6 +52,7 @@ begin
|
||||
Application.Title := APPNAME;
|
||||
Application.UpdateFormatSettings := False;
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.OnMessage := Mainform.OnMessageHandler;
|
||||
debug('perf: Main created.');
|
||||
|
||||
try
|
||||
|
@ -116,6 +116,7 @@ end;
|
||||
procedure Tconnform.FormCreate(Sender: TObject);
|
||||
var
|
||||
LastSession: String;
|
||||
hSysMenu: THandle;
|
||||
begin
|
||||
// Fix GUI stuff
|
||||
InheritFont(Font);
|
||||
@ -131,6 +132,11 @@ begin
|
||||
LastSession := GetRegValue(REGNAME_LASTSESSION, '');
|
||||
SelectNode(ListSessions, FSessionNames.IndexOf(LastSession));
|
||||
ValidateControls;
|
||||
// Add own menu items to system menu
|
||||
hSysMenu := GetSystemMenu(Handle, False);
|
||||
AppendMenu(hSysMenu, MF_SEPARATOR, 0, #0);
|
||||
AppendMenu(hSysMenu, MF_STRING, MSG_UPDATECHECK, PAnsiChar(Mainform.actUpdateCheck.Caption));
|
||||
AppendMenu(hSysMenu, MF_STRING, MSG_ABOUT, PAnsiChar(Mainform.actAboutBox.Caption));
|
||||
end;
|
||||
|
||||
|
||||
|
@ -33,6 +33,8 @@ const
|
||||
// number of seen (or simulated) rows the scrollbar should project.
|
||||
SIMULATE_INITIAL_ROWS = 10000;
|
||||
SIMULATE_MORE_ROWS = 20;
|
||||
MSG_UPDATECHECK = WM_USER + 1;
|
||||
MSG_ABOUT = WM_USER + 2;
|
||||
|
||||
type
|
||||
TMainForm = class(TForm)
|
||||
@ -876,6 +878,7 @@ type
|
||||
procedure SetEditorTabCaption(Editor: TFrame; ObjName: WideString);
|
||||
procedure ResetSelectedTableStuff;
|
||||
procedure SetWindowCaption;
|
||||
procedure OnMessageHandler(var Msg: TMsg; var Handled: Boolean);
|
||||
end;
|
||||
|
||||
|
||||
@ -9439,5 +9442,18 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMainForm.OnMessageHandler(var Msg: TMsg; var Handled: Boolean);
|
||||
begin
|
||||
// Clicks on system window menu get handled here
|
||||
if Msg.message = WM_SYSCOMMAND then begin
|
||||
case Msg.wParam of
|
||||
MSG_UPDATECHECK: Mainform.actUpdateCheck.Execute;
|
||||
MSG_ABOUT: Mainform.actAboutBox.Execute;
|
||||
end;
|
||||
Handled := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
Reference in New Issue
Block a user