Win32 API实现系统托盘
50. GetCursorPos(&point) ;
51. SetForegroundWindow(hwnd) ;
52. TrackPopupMenu(hMenu, TPM_RIGHTBUTTON, point.x, point.y, 0, hwnd, NULL) ;
53. }
54. else if(lParam == WM_LBUTTONDOWN)
55. {
56. ShowWindow(hwnd, SW_SHOW);
57. }
58. return 0 ;
59.
60. case WM_DESTROY:
61. nid.uID = IDI_ICON1 ;
62. nid.hWnd = hwnd ;
63. Shell_NotifyIcon (NIM_DELETE, &nid) ;
64.
65. PostQuitMessage (0) ;
66. return 0 ;
67. }
68. return DefWindowProc (hwnd, message, wParam, lParam) ;
69.}