From 954b32b0dfb9b7d9ecb99f290b18bbe93e2db58e Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Thu, 25 Mar 2010 22:13:18 +0000 Subject: [PATCH] Display "HeidiSQL Portable" in window title --- source/helpers.pas | 9 ++++++++- source/main.pas | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/source/helpers.pas b/source/helpers.pas index 5167840e..c4133910 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -255,6 +255,7 @@ type var MainReg: TRegistry; RegPath: String = '\Software\' + APPNAME + '\'; + PortableMode: Boolean = False; MutexHandle: THandle = 0; dbgCounter: Integer = 0; DecimalSeparatorSystemdefault: Char; @@ -3513,8 +3514,14 @@ begin Exit; // Open the right key - if StartupMode then + if StartupMode then begin RegPath := '\Software\' + APPNAME + ' Portable '+IntToStr(GetCurrentThreadId)+'\'; + PortableMode := True; + end else begin + // Do not work like a portable on exit, if at application start we didn't either + if not PortableMode then + Exit; + end; Screen.Cursor := crHourGlass; try diff --git a/source/main.pas b/source/main.pas index 93b79d69..3a3dd15f 100644 --- a/source/main.pas +++ b/source/main.pas @@ -8799,7 +8799,10 @@ begin Cap := Cap + ' /' + ActiveDatabase; if SelectedTable.Name <> '' then Cap := Cap + '/' + SelectedTable.Name; - Cap := Cap + ' - ' + APPNAME + ' ' + AppVersion; + Cap := Cap + ' - ' + APPNAME; + if PortableMode then + Cap := Cap + ' Portable'; + Cap := Cap + ' ' + AppVersion; Caption := Cap; Application.Title := Cap; end;