Changeset 21591 for trunk/src/shell32/systray_os2.c
- Timestamp:
- Mar 16, 2011, 4:52:43 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/systray_os2.c
r21590 r21591 6 6 * date: 1 May 2004 7 7 * 8 * Notes: what's about HAB at lines 113, 118 ?9 *10 8 */ 11 12 9 13 10 #define INCL_WIN … … 19 16 #include <winconst.h> 20 17 18 #include "systray_os2.h" 21 19 22 20 #define WM_TRAYADDME (WM_USER+1) … … 28 26 #define SZTOPIC "TRAY" 29 27 30 31 BOOL DoWin32PostMessage(HWND, ULONG, MPARAM, MPARAM);32 BOOL DoWin32CharToOem(const char *s, char *t);33 34 28 static HWND hwndTrayServer = 0; 35 29 36 37 typedef struct _NOTIFYICONDATAA 38 { ULONG cbSize; 39 HWND hWnd; 40 ULONG uID; 41 ULONG uFlags; 42 ULONG uCallbackMessage; 43 HPOINTER hIcon; 44 CHAR szTip[64]; 45 } NOTIFYICONDATAA, *PNOTIFYICONDATAA; 46 47 48 typedef struct SystrayItem { 49 HWND hWndFrame; 50 HWND hWndClient; 51 NOTIFYICONDATAA notifyIcon; 52 struct SystrayItem *nextTrayItem; 53 } SystrayItem; 54 55 56 57 58 static MRESULT EXPENTRY SYSTRAY_WndProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2) 30 static MRESULT EXPENTRY SYSTRAY_Old_WndProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2) 59 31 { 60 32 SystrayItem *ptrayItem = (SystrayItem *)WinQueryWindowULong(hWnd, QWL_USER); … … 111 83 } 112 84 113 //extern HAB hab; 114 const char * const systraysupclass = "Odin32SystraySupport"; 85 static const char * const systraysupclass = "Odin32SystraySupport"; 115 86 116 BOOL SYSTRAY_RegisterClass(void)87 static BOOL SYSTRAY_Old_RegisterClass(void) 117 88 { 118 //WinRegisterClass( hab, systraysupclass, SYSTRAY_ WndProc, 0, sizeof(ULONG) );119 WinRegisterClass(0, systraysupclass, SYSTRAY_ WndProc, 0, sizeof(ULONG) );89 //WinRegisterClass( hab, systraysupclass, SYSTRAY_Old_WndProc, 0, sizeof(ULONG) ); 90 WinRegisterClass(0, systraysupclass, SYSTRAY_Old_WndProc, 0, sizeof(ULONG) ); 120 91 return TRUE; 121 92 } 122 93 123 94 124 BOOL SYSTRAY_ItemInit(SystrayItem *ptrayItem)95 static BOOL SYSTRAY_Old_ItemInit(SystrayItem *ptrayItem) 125 96 { 126 97 ULONG fcf = FCF_TITLEBAR; 127 98 128 if ( !SYSTRAY_ RegisterClass() )99 if ( !SYSTRAY_Old_RegisterClass() ) 129 100 { 130 101 return FALSE; … … 152 123 } 153 124 154 void SYSTRAY_ItemTerm(SystrayItem *ptrayItem)125 static void SYSTRAY_Old_ItemTerm(SystrayItem *ptrayItem) 155 126 { 156 127 HPOINTER hIcon = (HPOINTER)WinSendMsg(ptrayItem->hWndFrame, WM_QUERYICON, NULL, NULL); … … 162 133 163 134 164 void SYSTRAY_ItemSetMessage(SystrayItem *ptrayItem, ULONG uCallbackMessage)135 static void SYSTRAY_Old_ItemSetMessage(SystrayItem *ptrayItem, ULONG uCallbackMessage) 165 136 { 166 137 ptrayItem->notifyIcon.uCallbackMessage = uCallbackMessage; … … 168 139 169 140 170 void SYSTRAY_ItemSetIcon(SystrayItem *ptrayItem, HPOINTER hIcon)141 static void SYSTRAY_Old_ItemSetIcon(SystrayItem *ptrayItem, HPOINTER hIcon) 171 142 { 172 143 // Windows seems to make a copy of icons displayed in the tray area. At … … 174 145 // Shell_NotifyIcon() doesn't harm the icon displayed in the tray. Behave 175 146 // similarly on OS/2 (some applications do call DestroyIcon()). The copy is 176 // deleted in SYSTRAY_ ItemTerm().147 // deleted in SYSTRAY_Old_ItemTerm(). 177 148 178 149 POINTERINFO Info; … … 193 164 194 165 195 void SYSTRAY_ItemSetTip(SystrayItem *ptrayItem, CHAR* szTip, int modify)166 static void SYSTRAY_Old_ItemSetTip(SystrayItem *ptrayItem, CHAR* szTip, int modify) 196 167 { 197 168 char tmp[ 64 ]; … … 204 175 } 205 176 177 178 BOOL SYSTRAY_Init(void) 179 { 180 // try the new xsystray API first 181 if (SYSTRAY_Ex_Init()) 182 return TRUE; 183 184 // fallback to the old API 185 SYSTRAY_ItemInit = SYSTRAY_Old_ItemInit; 186 SYSTRAY_ItemTerm = SYSTRAY_Old_ItemTerm; 187 SYSTRAY_ItemSetMessage = SYSTRAY_Old_ItemSetMessage; 188 SYSTRAY_ItemSetIcon = SYSTRAY_Old_ItemSetIcon; 189 SYSTRAY_ItemSetTip = SYSTRAY_Old_ItemSetTip; 190 191 return TRUE; 192 } 193
Note:
See TracChangeset
for help on using the changeset viewer.