55 #pragma resource "*.dfm"
64 void __fastcall TfrmMain::TrayNotify(TMessage& Msg)
73 DoubleClickedR =
false;
80 if (GetCursorPos(&MousePos))
83 SetForegroundWindow(Handle);
84 pmnuMain->Popup(MousePos.x, MousePos.y);
88 case WM_RBUTTONDBLCLK:
89 DoubleClickedR =
true;
94 DoubleClickedL =
false;
102 case WM_LBUTTONDBLCLK:
112 DoubleClickedL =
true;
116 OutputDebugString(AnsiString(Msg.LParam).c_str());
120 TForm::Dispatch(&Msg);
131 tnd.cbSize =
sizeof(NOTIFYICONDATA);
134 tnd.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
137 if (dwMessage == NIM_MODIFY)
141 lstrcpyn(tnd.szTip, pszTip,
sizeof(tnd.szTip));
151 return (Shell_NotifyIcon(dwMessage, &tnd));
188 PSTR __fastcall TfrmMain::TipText(
void)
190 AnsiString str = SongTitle;
206 if ((AnsiString(str) + state).Length() > 64)
207 str = str.SubString(1, 60 - state.Length()) +
"..." + state;
210 strncpy(TipChars, str.c_str(),
sizeof(TipChars));
229 ShowWindow(Application->Handle, SW_HIDE);
231 DWORD dwExStyle = GetWindowLong(Application->Handle, GWL_EXSTYLE);
232 dwExStyle |= WS_EX_TOOLWINDOW;
233 SetWindowLong(Application->Handle, GWL_EXSTYLE, dwExStyle);
237 TRect FromRect, ToRect;
238 ToRect = TRect(Screen->Width - 16, Screen->Height, Screen->Width, Screen->Height - 16);
240 FromRect = BoundsRect;
244 #define IDANI_CLOSE 2
246 #ifndef IDANI_CAPTION
247 #define IDANI_CAPTION 3
250 DrawAnimatedRects(Handle,
IDANI_CAPTION, &FromRect, &ToRect);
294 void __fastcall TfrmMain::DisplayHint(TObject *)
296 sbMain->Panels->Items[1]->Text = GetShortHint(Application->Hint);
302 Application->OnException = AppException;
304 Application->OnHint = DisplayHint;
318 void __fastcall TfrmMain::AppException(TObject *, Exception *E)
328 void TfrmMain::UpdateIcon(
void)
330 int index, length = 0;
333 Cardinal UpdateTime = 1000 *
lstTimer->Items->Strings[
lstTimer->ItemIndex].ToIntDef(1);
335 bool previousConnected = connected;
346 if ( connected && !previousConnected )
551 pgSettings->Pages[PageIndex]->ImageIndex = ImageIndex;
563 DetailsForm->ShowModal();
576 imlTrayIcons->Draw(StatusBar->Canvas, Rect.Left + 3, Rect.Top + 3, fIconIndex,
true);
581 void __fastcall TfrmMain::AnimateForm(TForm * Form,
bool FormVisible)
584 TRect MainRect, FormRect;
588 OffsetRect(&MainRect,
pgSettings->ClientToScreen(TPoint(0,0)).x,
pgSettings->ClientToScreen(TPoint(0,0)).y);
591 MainRect = TRect(Screen->Width - 16, Screen->Height, Screen->Width, Screen->Height - 16);
593 FormRect = Form->BoundsRect;
596 DrawAnimatedRects(Form->Handle, IDANI_CAPTION, &FormRect, &MainRect);
598 DrawAnimatedRects(Form->Handle, IDANI_CAPTION, &MainRect, &FormRect);