> I have tried to add an icon for my app. at the task bar ,
>
> I did it , but still don't know how to make that icon responds to
events
> such as mouse right click ,
>
> when I right click the mouse on it I want to show a popup that restores
> or closes my application any help will be very appreciated (pls some
> code)
You need to handle the task icon message. For example, define a message
handler
somewhere in your unit like,
const WM_TASKICON = WM_USER+0;
..
procedure WMTASKICON(var msg : TMessage); message WM_TASKICON;
Then implement this handler to handle mouse events like,
procedure TTaskIcon.WMTASKICON(var msg : TMessage);
begin
case msg.lParam of
WM_LBUTTONDBLCLK : DoSomething;
WM_LBUTTONUP : DoSomething;
WM_RBUTTONUP : DoSomething;
end;
end;
Then assign this message to the uCallbackMessage member of TNOTIFYICONDATA
variable like,
var
idata : TNOTIFYICONDATA;
..
idata.uCallbackMessage := WM_TASKICON;