|
From: Noorez K. <lor...@ho...> - 2005-08-19 04:32:58
|
void TaskBarHandler(HWND main, WPARAM wParam, LPARAM lParam)
{
HMENU popupMenu, subMenu;
POINT curPos;
popupMenu = CreatePopupMenu();
AppendMenu(popupMenu, MF_STRING , (UINT)ID_TASKBAR_SHOW, "Show Window");
AppendMenu(popupMenu, MF_STRING, (UINT)ID_TASKBAR_HIDE, "Hide Window");
AppendMenu(popupMenu, MF_STRING, (UINT)ID_TASKBAR_EXIT, "Exit");
if(!popupMenu) cout << "INvalid HMENU!";
UINT uID = (UINT)wParam;
// Determine what the message was
switch(uID)
{
case TASKBAR_ICON: // Task bar icon
switch( LOWORD(lParam) )
{
case WM_RBUTTONUP: // Display the popup menu
GetCursorPos(&curPos);
TrackPopupMenuEx( popupMenu,TPM_RIGHTALIGN,curPos.x,curPos.y,main,
NULL );
break;
case WM_LBUTTONDBLCLK: // Do defalut menu item action and show
window
{
ShowWindow(main,SW_RESTORE);
SetFocus( GetDlgItem(main, IDC_MAIN_EDIT) );
}
break;
}
break;
}
}
This function is supposed to receive events from the icon in the task bar.
But it only reads the case TASKBAR_ICON, it never reads the two mouse
events, even if i click like crazy!
_________________________________________________________________
Scan and help eliminate destructive viruses from your inbound and outbound
e-mail and attachments.
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
Start enjoying all the benefits of MSN® Premium right now and get the
first two months FREE*.
|