-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ TMain = class(TForm) | |
var | ||
Main: TMain; | ||
Notifications, ExcludeList: TStringList; | ||
WM_TaskBarCreated: Cardinal; | ||
WM_TASKBARCREATED: Cardinal; | ||
IconIndex: byte; | ||
IconFull: TIcon; | ||
IDS_NOTIFICATIONS, IDS_DELETE_ALL, IDS_UNKNOWN_APP, IDS_BLOCK_QUESTION, IDS_LAST_UPDATE: string; | ||
|
@@ -71,7 +71,7 @@ implementation | |
|
||
procedure Tray(ActInd: integer); //1 - äîáàâèòü, 2 - óäàëèòü, 3 - çàìåíèòü | ||
var | ||
nim: TNotifyIconData; | ||
NIM: TNotifyIconData; | ||
begin | ||
with NIM do begin | ||
cbSize:=SizeOf(nim); | ||
|
@@ -88,9 +88,9 @@ implementation | |
StrCopy(szTip, PChar(Application.Title)); | ||
end; | ||
case ActInd of | ||
1: Shell_NotifyIcon(NIM_ADD, @nim); | ||
2: Shell_NotifyIcon(NIM_DELETE, @nim); | ||
3: Shell_NotifyIcon(NIM_MODIFY, @nim); | ||
1: Shell_NotifyIcon(NIM_ADD, @NIM); | ||
2: Shell_NotifyIcon(NIM_DELETE, @NIM); | ||
3: Shell_NotifyIcon(NIM_MODIFY, @NIM); | ||
end; | ||
end; | ||
|
||
|
@@ -107,8 +107,10 @@ procedure TMain.NotificationCenterShow; | |
(WebView.Document as IHTMLDocument2).ParentWindow.Focus; | ||
ShowWindow(Handle, SW_SHOW); | ||
|
||
//Âûêëþ÷àåì "àíèìàöèþ" èêîíêè | ||
// Âûêëþ÷àåì "àíèìàöèþ" èêîíêè | ||
ChangeIcon.Enabled:=false; | ||
if ScrollState then // Íàâåðíÿêà âûêëþ÷àåì, èíîãäà îñòàâàëñÿ | ||
PressScroll; | ||
|
||
IconIndex:=0; | ||
Tray(3); | ||
|
@@ -286,7 +288,7 @@ procedure TMain.WebViewDocumentComplete(Sender: TObject; | |
sUrl: string; | ||
begin | ||
if pDisp = (Sender as TWebBrowser).Application then begin | ||
sUrl:=ExtractFileName(StringReplace(url, '/', '\', [rfReplaceAll])); | ||
sUrl:=ExtractFileName(StringReplace(URL, '/', '\', [rfReplaceAll])); | ||
if sUrl = 'main.html' then begin | ||
Application.ProcessMessages; | ||
if WebView.Document <> nil then begin | ||
|
@@ -317,6 +319,7 @@ procedure TMain.WMCopyData(var Msg: TWMCopyData); | |
NotifyMsg:=TStringList.Create; | ||
NotifyMsg.Text:=PChar(TWMCopyData(Msg).CopyDataStruct.lpData); | ||
NotifyMsg.Text:=StringReplace(NotifyMsg.Text, #9, #13#10, [rfReplaceAll]); | ||
NotifyMsg.Text:=StringReplace(NotifyMsg.Text, '&&', '&', [rfReplaceAll]); | ||
NotifyMsg.Delete(0); | ||
|
||
NotifyTitle:=IDS_UNKNOWN_APP; | ||
|
@@ -345,25 +348,25 @@ procedure TMain.WMCopyData(var Msg: TWMCopyData); | |
BigIcon:=SmallIcon; | ||
|
||
case NotifyColor[1] of | ||
'0': NotifyColor:='#00acee'; | ||
'1': NotifyColor:='#235d82'; | ||
'2': NotifyColor:='#018399'; | ||
'3': NotifyColor:='#008a00'; | ||
'4': NotifyColor:='#5133ab'; | ||
'5': NotifyColor:='#8b0094'; | ||
'6': NotifyColor:='#ac193d'; | ||
'7': NotifyColor:='#222222'; | ||
'0': NotifyColor:='#3591ce'; // Ñâåòëî-ñèíèé | ||
'1': NotifyColor:='#235d82'; // Òåìíî-ñèíèé | ||
'2': NotifyColor:='#018399'; // Ñèíå-çåëåíûé | ||
'3': NotifyColor:='#008a00'; // Çåë¸íûé | ||
'4': NotifyColor:='#2933ab'; // Ôèîëåòîâûé | ||
'5': NotifyColor:='#8d44ad'; // Òåìíî-ðîçîâûé | ||
'6': NotifyColor:='#c0392b'; // Êðàñíûé | ||
'7': NotifyColor:='#2c3e50'; // ׸ðíûé | ||
else | ||
NotifyColor:='#018399'; | ||
NotifyColor:='#3591ce'; // Ñâåòëî-ñèíèé | ||
end; | ||
|
||
//Èñêëþ÷àåì èñêëþ÷åííûå ñîîáùåíèÿ | ||
// Èñêëþ÷àåì èñêëþ÷åííûå ñîîáùåíèÿ | ||
if Pos(NotifyTitle, ExcludeList.Text) = 0 then begin | ||
Notifications.Add(NotifyTitle + #9 + NotifyDesc + #9 + CurrentTimeHM + #9 + DateToStr(Date) + #9 + BigIcon + #9 + NotifyColor); | ||
AddNotification(Notifications.Count - 1, NotifyTitle, NotifyDesc, CurrentTimeHM, DateToStr(Date), BigIcon, NotifyColor); | ||
IconIndex:=1; | ||
Tray(3); | ||
//Âêëþ÷àåì "àíèìàöèþ" èêîíêè | ||
// Âêëþ÷àåì "àíèìàöèþ" èêîíêè | ||
ChangeIcon.Enabled:=true; | ||
PressScroll; | ||
Notifications.SaveToFile(ExtractFilePath(ParamStr(0)) + 'Notifications.txt'); | ||
|
@@ -406,8 +409,8 @@ procedure TMain.DefaultHandler(var Message); | |
|
||
procedure TMain.AboutBtnClick(Sender: TObject); | ||
begin | ||
Application.MessageBox(PChar(Application.Title + ' 0.7.5' + #13#10 + | ||
IDS_LAST_UPDATE + ' 05.03.2021' + #13#10 + | ||
Application.MessageBox(PChar(Application.Title + ' 0.7.6' + #13#10 + | ||
IDS_LAST_UPDATE + ' 03.03.24' + #13#10 + | ||
'https://r57zone.github.io' + #13#10 + | ||
'[email protected]'), PChar(AboutBtn.Caption), MB_ICONINFORMATION); | ||
end; | ||
|