X-Git-Url: http://git.jankratochvil.net/?p=reactos.git;a=blobdiff_plain;f=subsys%2Fsystem%2Fexplorer%2Ftaskbar%2Ftraynotify.h;fp=subsys%2Fsystem%2Fexplorer%2Ftaskbar%2Ftraynotify.h;h=db318f2be5ef4e6c94824602957de2d609e2f452;hp=0000000000000000000000000000000000000000;hb=ee8b63255465d8c28be3e7bd11628015708fc1ab;hpb=c99688ef1ab339c8746ecc385bde679623084c71 diff --git a/subsys/system/explorer/taskbar/traynotify.h b/subsys/system/explorer/taskbar/traynotify.h new file mode 100644 index 0000000..db318f2 --- /dev/null +++ b/subsys/system/explorer/taskbar/traynotify.h @@ -0,0 +1,124 @@ +/* + * Copyright 2003 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + // + // Explorer and Desktop clone + // + // traynotify.h + // + // Martin Fuchs, 22.08.2003 + // + + +#define CLASSNAME_TRAYNOTIFY _T("TrayNotifyWnd") +#define TITLE_TRAYNOTIFY _T("") + +#define CLASSNAME_CLOCKWINDOW _T("TrayClockWClass") + +#define NOTIFYAREA_WIDTH 244 +#define CLOCKWINDOW_WIDTH 32 + + +struct NotifyIconIndex +{ + NotifyIconIndex(NOTIFYICONDATA* pnid); + + // sort operator + friend bool operator<(const NotifyIconIndex& a, const NotifyIconIndex& b) + {return a._hWnd NotifyIconMap; +typedef set NotifyIconSet; + + + /// tray notification area aka "tray" +struct NotifyArea : public Window +{ + typedef Window super; + + NotifyArea(HWND hwnd); + ~NotifyArea(); + + static HWND Create(HWND hwndParent); + + LRESULT ProcessTrayNotification(int notify_code, NOTIFYICONDATA* pnid); + +protected: + NotifyIconMap _icon_map; + NotifyIconSet _sorted_icons; + int _next_idx; + + WindowHandle _hwndClock; + + LRESULT Init(LPCREATESTRUCT pcs); + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + + void Refresh(); + void Paint(); + void TimerTick(); + void CancelModes(); + + NotifyIconSet::iterator IconHitTest(const POINT& pos); +}; + + + /// window for displaying the time in the tray notification area +struct ClockWindow : public Window +{ + typedef Window super; + + ClockWindow(HWND hwnd); + + static HWND Create(HWND hwndParent); + + void TimerTick(); + +protected: + LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + int Notify(int id, NMHDR* pnmh); + + bool FormatTime(); + void Paint(); + + TCHAR _time[16]; + ToolTip _tooltip; +};