Mega Code Archive

 
Categories / Delphi / System
 

Programın systemtray a yerleşmesi

Uses ShellApi; Var stray:NOTIFYICONDATA; procedure TForm1.FormCreate(Sender: TObject); begin SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW); with stray do begin cbsize:=sizeof(stray); wnd:=form1.handle; hicon:=Application.icon.Handle; uID:=0; sztip:='Bekçi Çalışıyor'; uflags:=7; uCallBackMessage:=$200;//icon üzerine tıklama kontrolu için end; Shell_NotifyIcon(0,@stray); end; //Üstteki Kodu yazmak yeterlidir. Shell_NotifyIcon(2,@stray);//Gizlemek Shell_NotifyIcon(1,@stray);//Yenilemek //$205 farenin sağ tuşuna basılması procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var nokta:TPoint; begin getCursorPos(nokta); if (x=$205) then PopupMenu1.Popup(nokta.x,nokta.y); end; ferhatakkas@yahoo.com