Ignore:
Timestamp:
Apr 28, 2001, 3:33:49 PM (24 years ago)
Author:
sandervl
Message:

resync with latest wine

File:
1 edited

Legend:

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

    r4121 r5618  
    1 /* $Id: systray.c,v 1.1 2000-08-30 13:53:01 sandervl Exp $ */
    21/*
    32 *      Systray
     
    109 *
    1110 */
    12 #ifdef __WIN32OS2__
    13 #define ICOM_CINTERFACE 1
    14 #include <odin.h>
    15 #else
     11
     12#ifndef __WIN32OS2__
    1613#include <unistd.h>
    1714#endif
     
    1916#include <string.h>
    2017
    21 #ifndef __WIN32OS2__
    22 #include "heap.h"
    23 #endif
     18#include "winnls.h"
     19#include "shlobj.h"
    2420#include "shellapi.h"
    2521#include "shell32_main.h"
    26 #include "windows.h"
    2722#include "commctrl.h"
    2823#include "debugtools.h"
     24#include "heap.h"
    2925#include "config.h"
    3026
    31 DEFAULT_DEBUG_CHANNEL(shell)
     27DEFAULT_DEBUG_CHANNEL(shell);
    3228
    3329typedef struct SystrayItem {
     
    186182  return FALSE;
    187183#else
     184
    188185  /* Initialize the window size. */
    189186  rect.left   = 0;
     
    215212  }
    216213  return TRUE;
    217 #endif  //__WIN32OS2__
     214#endif
    218215}
    219216
     
    221218static void SYSTRAY_ItemTerm(SystrayItem *ptrayItem)
    222219{
     220  if(ptrayItem->notifyIcon.hIcon)
     221     DestroyIcon(ptrayItem->notifyIcon.hIcon);   
    223222  if(ptrayItem->hWndToolTip)
    224223      DestroyWindow(ptrayItem->hWndToolTip);
     
    237236void SYSTRAY_ItemSetIcon(SystrayItem *ptrayItem, HICON hIcon)
    238237{
    239   ptrayItem->notifyIcon.hIcon = hIcon; /* do we need a copy? */
     238  ptrayItem->notifyIcon.hIcon = CopyIcon(hIcon);
    240239  InvalidateRect(ptrayItem->hWnd, NULL, TRUE);
    241240}
     
    346345
    347346/*************************************************************************
    348  * Shell_NotifyIconA                    [SHELL32.297]
     347 * Shell_NotifyIconA                    [SHELL32.297][SHELL32.296]
    349348 */
    350349BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid )
     
    368367
    369368/*************************************************************************
    370  * Shell_NotifyIconW                    [SHELL32.297]
     369 * Shell_NotifyIconW                    [SHELL32.298]
    371370 */
    372371BOOL WINAPI Shell_NotifyIconW (DWORD dwMessage, PNOTIFYICONDATAW pnid )
     
    376375        PNOTIFYICONDATAA p = HeapAlloc(GetProcessHeap(),0,sizeof(NOTIFYICONDATAA));
    377376        memcpy(p, pnid, sizeof(NOTIFYICONDATAA));
    378         if (*(pnid->szTip))
    379           lstrcpynWtoA (p->szTip, pnid->szTip, 64 );
     377        WideCharToMultiByte( CP_ACP, 0, pnid->szTip, -1, p->szTip, sizeof(p->szTip), NULL, NULL );
     378        p->szTip[sizeof(p->szTip)-1] = 0;
    380379
    381380        ret = Shell_NotifyIconA(dwMessage, p );
     
    384383        return ret;
    385384}
    386 
    387 /*************************************************************************
    388  * Shell_NotifyIcon                     [SHELL32.296]
    389  */
    390 BOOL WINAPI Shell_NotifyIcon(DWORD dwMessage, PNOTIFYICONDATAA pnid)
    391 {
    392   return Shell_NotifyIconA(dwMessage, pnid);
    393 }
Note: See TracChangeset for help on using the changeset viewer.