-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColorPicker_Elite.dpr
More file actions
70 lines (63 loc) · 3.01 KB
/
Copy pathColorPicker_Elite.dpr
File metadata and controls
70 lines (63 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
program ColorPicker_Elite;
uses
Windows,
SysUtils,
Vcl.Forms,
Unit1 in 'Unit1.pas' {QCPUI},
uColorConverter in 'Units\uColorConverter.pas',
uHistoryItemX in 'Units\uHistoryItemX.pas',
uAssignKey in 'Units\uAssignKey.pas' {Form2},
CPLibrary in 'Units\CPLibrary.pas',
uColorPreview in 'Units\uColorPreview.pas' {frmColorPreview},
uStringCollections in 'Units\uStringCollections.pas',
uColorContrast in 'Units\uColorContrast.pas',
uResourceProtector in 'Units\uResourceProtector.pas',
Vcl.Themes,
Vcl.Styles,
uColorPickerControls in 'Units\uColorPickerControls.pas',
uColorUtils in 'Units\uColorUtils.pas',
uCustomColorDlg in 'Units\uCustomColorDlg.pas',
uBorderlessWindow in 'Units\uBorderlessWindow.pas',
uAbout in 'Units\uAbout.pas' {About};
{$R 'Library\Color_Picker.res'}
var ColorPickerMutexHandle: THandle;
const FormResources: array[0..6] of record Name: string; Hash: string; ResType: PChar; end = (
(Name: 'APPLOGO'; Hash: 'EDAEE18FB884D3F09BFD1CD20455EED0'; ResType: 'PNG'), //About box Log
(Name: 'MAINICON'; Hash: '4D9A779AF377C06BA842BAF97E01A4B3'; ResType: RT_GROUP_ICON), //Icon
(Name: 'DARK'; Hash: '38D38CDAF024C2F470F73C8162E18EA3'; ResType: 'VCLSTYLE'), //Theme File
(Name: 'TQCPUI'; Hash: '04F27776FD307028082902FC32BCF45D'; ResType: RT_RCDATA), // Main Form
(Name: 'TfrmColorPreview'; Hash: '209CE7713BA9A593B00136F1E64EDF8C'; ResType: RT_RCDATA), // Color Combine
(Name: 'TForm2'; Hash: '608BFA491A9F9E303509881202BDEA70'; ResType: RT_RCDATA), // Hotkey Change Form
(Name: 'TAbout'; Hash: '49F56E8AD04F4E622364DC4A1F3FBE3D'; ResType: RT_RCDATA)); // About Form
procedure CheckFormsIntegrity;
var i: Integer; ActualHash: string; MyExeName: string;
begin
MyExeName := ExtractFileName(ParamStr(0));
for i := 0 to High(FormResources) do
begin
ActualHash := CalculateUniversalResourceHash(FormResources[i].Name, FormResources[i].ResType);
if (ActualHash = 'ERROR') or (not SameText(ActualHash, FormResources[i].Hash)) then
begin
MessageBoxW(Application.Handle, PWideChar('The application was unable to start correctly (0xC0000005).' + sLineBreak + 'Click OK to close the application.'), PWideChar(MyExeName + ' - Application Error'), MB_OK or MB_ICONERROR or MB_TOPMOST);
Halt(0);
end;
end;
end;
procedure CheckSingleInstance;
begin
ColorPickerMutexHandle := CreateMutex(nil, True,'Global\SRStudio_QuickColorPicker_3');
if (ColorPickerMutexHandle <> 0) and(GetLastError = ERROR_ALREADY_EXISTS) then
begin
MessageBox(0,'Quick Color Picker is already running.','Quick Color Picker',MB_OK or MB_ICONWARNING OR MB_TOPMOST);
Halt(1);
end;
end;
begin
CheckFormsIntegrity;
CheckSingleInstance;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.Title := 'Quick Color Picker';
Application.CreateForm(TQCPUI, QCPUI);
Application.Run;
end.