Ignore:
Timestamp:
Sep 5, 2001, 3:54:53 PM (24 years ago)
Author:
bird
Message:

Added $Id:$ keyword.

File:
1 edited

Legend:

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

    r5618 r6650  
     1/* $Id: systray.c,v 1.3 2001-09-05 13:47:01 bird Exp $ */
    12/*
    2  *      Systray
     3 *  Systray
    34 *
    4  *      Copyright 1999 Kai Morich       <kai.morich@bigfoot.de>
     5 *  Copyright 1999 Kai Morich   <kai.morich@bigfoot.de>
    56 *
    67 *  Manage the systray window. That it actually appears in the docking
     
    6667    while (ptrayItem) {
    6768      if (ptrayItem->hWnd==hWnd) {
    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;
     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;
    7879      }
    7980      ptrayItem = ptrayItem->nextTrayItem;
     
    119120    while (ptrayItem) {
    120121      if (ptrayItem->hWnd == hWnd) {
    121         if (ptrayItem->notifyIcon.hWnd && ptrayItem->notifyIcon.uCallbackMessage) {
     122    if (ptrayItem->notifyIcon.hWnd && ptrayItem->notifyIcon.uCallbackMessage) {
    122123          if (!PostMessageA(ptrayItem->notifyIcon.hWnd, ptrayItem->notifyIcon.uCallbackMessage,
    123124                            (WPARAM)ptrayItem->notifyIcon.uID, (LPARAM)message)) {
    124               ERR("PostMessage(SystrayWindow 0x%08x) failed -> removing SystrayItem %p\n", hWnd, ptrayItem);
    125               SYSTRAY_Delete(&ptrayItem->notifyIcon);
    126             }
     125          ERR("PostMessage(SystrayWindow 0x%08x) failed -> removing SystrayItem %p\n", hWnd, ptrayItem);
     126          SYSTRAY_Delete(&ptrayItem->notifyIcon);
    127127        }
    128         break;
     128        }
     129    break;
    129130      }
    130131      ptrayItem = ptrayItem->nextTrayItem;
     
    219220{
    220221  if(ptrayItem->notifyIcon.hIcon)
    221      DestroyIcon(ptrayItem->notifyIcon.hIcon);   
     222     DestroyIcon(ptrayItem->notifyIcon.hIcon);
    222223  if(ptrayItem->hWndToolTip)
    223224      DestroyWindow(ptrayItem->hWndToolTip);
     
    345346
    346347/*************************************************************************
    347  * Shell_NotifyIconA                    [SHELL32.297][SHELL32.296]
     348 * Shell_NotifyIconA            [SHELL32.297][SHELL32.296]
    348349 */
    349350BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid )
     
    367368
    368369/*************************************************************************
    369  * Shell_NotifyIconW                    [SHELL32.298]
     370 * Shell_NotifyIconW            [SHELL32.298]
    370371 */
    371372BOOL WINAPI Shell_NotifyIconW (DWORD dwMessage, PNOTIFYICONDATAW pnid )
    372373{
    373         BOOL ret;
    374 
    375         PNOTIFYICONDATAA p = HeapAlloc(GetProcessHeap(),0,sizeof(NOTIFYICONDATAA));
    376         memcpy(p, pnid, sizeof(NOTIFYICONDATAA));
     374    BOOL ret;
     375
     376    PNOTIFYICONDATAA p = HeapAlloc(GetProcessHeap(),0,sizeof(NOTIFYICONDATAA));
     377    memcpy(p, pnid, sizeof(NOTIFYICONDATAA));
    377378        WideCharToMultiByte( CP_ACP, 0, pnid->szTip, -1, p->szTip, sizeof(p->szTip), NULL, NULL );
    378379        p->szTip[sizeof(p->szTip)-1] = 0;
    379380
    380         ret = Shell_NotifyIconA(dwMessage, p );
    381 
    382         HeapFree(GetProcessHeap(),0,p);
    383         return ret;
    384 }
     381    ret = Shell_NotifyIconA(dwMessage, p );
     382
     383    HeapFree(GetProcessHeap(),0,p);
     384    return ret;
     385}
Note: See TracChangeset for help on using the changeset viewer.