![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2006
Posts: 4
Rep Power: 0
![]() |
Shell_NotifyIcon
Hi, I’m trying to put my program as tray icon in a Taskbar of Windows, the Icon appears but when I try to use the mouse, he simply doesn’t work, this is code I’m using:
procedure TForm1.Button1Click(Sender: TObject); var LTrayI : PNotifyIconData; begin LTrayI.cbSize := SizeOf(LTrayI); LTrayI.Wnd := Application.Handle; LTrayI.uID := 1; LTrayI.uFlags := NIF_ICON or NIF_TIP or NIF_MESSAGE; LTrayI.uCallbackMessage := WM_LBUTTONDOWN; LTrayI.hIcon := Self.Icon.Handle; LTrayI.szTip := 'Tooltip test' + chr(0); Shell_NotifyIcon(NIM_ADD, LTrayI); end; |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Dec 2007
Posts: 8
Rep Power: 0
![]() |
Re: Shell_NotifyIcon
you correct.i just see you add icon action now.
example: the uCallBackMessage is pointer yourself defined message.no standard message. const WM_TRAYNOTIFY=WM_USER+100; LTrayI.uCallbackMessage:=WM_TRAYNOTIFY; after you can capture this message.declare this: procedure NotifyIconClick(var Msg:TMessage);message WM_TRAYNOTIFY; implement procedure TForm1.NotifyIconClick(var msg: tmessage); var IconPoint:TPoint; begin case Msg.LParam of WM_LBUTTONUP: begin end; WM_RBUTTONUP: begin GetCursorPos(IconPoint); PopupMenu.Popup(IconPoint.X,IconPoint.Y); end; end; end; |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|