Ignore:
Timestamp:
Sep 15, 2001, 11:26:26 AM (24 years ago)
Author:
sandervl
Message:

restored old version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/systray.c

    r6650 r6709  
    1 /* $Id: systray.c,v 1.3 2001-09-05 13:47:01 bird Exp $ */
    21/*
    3  *  Systray
     2 *      Systray
    43 *
    5  *  Copyright 1999 Kai Morich   <kai.morich@bigfoot.de>
     4 *      Copyright 1999 Kai Morich       <kai.morich@bigfoot.de>
    65 *
    76 *  Manage the systray window. That it actually appears in the docking
     
    6766    while (ptrayItem) {
    6867      if (ptrayItem->hWnd==hWnd) {
    69     if (ptrayItem->notifyIcon.hIcon) {
    70       hdc = BeginPaint(hWnd, &ps);
    71       GetClientRect(hWnd, &rc);
    72       if (!DrawIconEx(hdc, rc.left+ICON_BORDER, rc.top+ICON_BORDER, ptrayItem->notifyIcon.hIcon,
    73               ICON_SIZE, ICON_SIZE, 0, 0, DI_DEFAULTSIZE|DI_NORMAL)) {
    74         ERR("Paint(SystrayWindow 0x%08x) failed -> removing SystrayItem %p\n", hWnd, ptrayItem);
    75         SYSTRAY_Delete(&ptrayItem->notifyIcon);
    76       }
    77     }
    78     break;
     68        if (ptrayItem->notifyIcon.hIcon) {
     69          hdc = BeginPaint(hWnd, &ps);
     70          GetClientRect(hWnd, &rc);
     71          if (!DrawIconEx(hdc, rc.left+ICON_BORDER, rc.top+ICON_BORDER, ptrayItem->notifyIcon.hIcon,
     72                          ICON_SIZE, ICON_SIZE, 0, 0, DI_DEFAULTSIZE|DI_NORMAL)) {
     73            ERR("Paint(SystrayWindow 0x%08x) failed -> removing SystrayItem %p\n", hWnd, ptrayItem);
     74            SYSTRAY_Delete(&ptrayItem->notifyIcon);
     75          }
     76        }
     77        break;
    7978      }
    8079      ptrayItem = ptrayItem->nextTrayItem;
     
    120119    while (ptrayItem) {
    121120      if (ptrayItem->hWnd == hWnd) {
    122     if (ptrayItem->notifyIcon.hWnd && ptrayItem->notifyIcon.uCallbackMessage) {
     121        if (ptrayItem->notifyIcon.hWnd && ptrayItem->notifyIcon.uCallbackMessage) {
    123122          if (!PostMessageA(ptrayItem->notifyIcon.hWnd, ptrayItem->notifyIcon.uCallbackMessage,
    124123                            (WPARAM)ptrayItem->notifyIcon.uID, (LPARAM)message)) {
    125           ERR("PostMessage(SystrayWindow 0x%08x) failed -> removing SystrayItem %p\n", hWnd, ptrayItem);
    126           SYSTRAY_Delete(&ptrayItem->notifyIcon);
     124              ERR("PostMessage(SystrayWindow 0x%08x) failed -> removing SystrayItem %p\n", hWnd, ptrayItem);
     125              SYSTRAY_Delete(&ptrayItem->notifyIcon);
     126            }
    127127        }
    128         }
    129     break;
     128        break;
    130129      }
    131130      ptrayItem = ptrayItem->nextTrayItem;
     
    220219{
    221220  if(ptrayItem->notifyIcon.hIcon)
    222      DestroyIcon(ptrayItem->notifyIcon.hIcon);
     221     DestroyIcon(ptrayItem->notifyIcon.hIcon);   
    223222  if(ptrayItem->hWndToolTip)
    224223      DestroyWindow(ptrayItem->hWndToolTip);
     
    346345
    347346/*************************************************************************
    348  * Shell_NotifyIconA            [SHELL32.297][SHELL32.296]
     347 * Shell_NotifyIconA                    [SHELL32.297][SHELL32.296]
    349348 */
    350349BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid )
     
    368367
    369368/*************************************************************************
    370  * Shell_NotifyIconW            [SHELL32.298]
     369 * Shell_NotifyIconW                    [SHELL32.298]
    371370 */
    372371BOOL WINAPI Shell_NotifyIconW (DWORD dwMessage, PNOTIFYICONDATAW pnid )
    373372{
    374     BOOL ret;
    375 
    376     PNOTIFYICONDATAA p = HeapAlloc(GetProcessHeap(),0,sizeof(NOTIFYICONDATAA));
    377     memcpy(p, pnid, sizeof(NOTIFYICONDATAA));
     373        BOOL ret;
     374
     375        PNOTIFYICONDATAA p = HeapAlloc(GetProcessHeap(),0,sizeof(NOTIFYICONDATAA));
     376        memcpy(p, pnid, sizeof(NOTIFYICONDATAA));
    378377        WideCharToMultiByte( CP_ACP, 0, pnid->szTip, -1, p->szTip, sizeof(p->szTip), NULL, NULL );
    379378        p->szTip[sizeof(p->szTip)-1] = 0;
    380379
    381     ret = Shell_NotifyIconA(dwMessage, p );
    382 
    383     HeapFree(GetProcessHeap(),0,p);
    384     return ret;
    385 }
     380        ret = Shell_NotifyIconA(dwMessage, p );
     381
     382        HeapFree(GetProcessHeap(),0,p);
     383        return ret;
     384}
Note: See TracChangeset for help on using the changeset viewer.