VirtualBox

Changeset 33966 in vbox


Ignore:
Timestamp:
Nov 11, 2010 10:32:07 AM (14 years ago)
Author:
vboxsync
Message:

VBoxTray: Cleaning up, refactoring, grouping window messages.

Location:
trunk/src/VBox/Additions/WINNT/VBoxTray
Files:
10 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/Makefile.kmk

    r32881 r33966  
    3636        VBoxVRDP.cpp \
    3737        VBoxRestore.cpp \
    38         helpers.cpp \
     38        VBoxHelpers.cpp \
    3939        VBoxTray.rc
    4040ifdef VBOX_WITH_GUEST_PROPS
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp

    r32431 r33966  
    1818
    1919#include "VBoxTray.h"
    20 #include "helpers.h"
     20#include "VBoxHelpers.h"
    2121
    2222#include <VBox/HostServices/VBoxClipboardSvc.h>
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp

    r33595 r33966  
    1818#include <windows.h>
    1919#include "VBoxTray.h"
     20#include "VBoxHelpers.h"
    2021#include "VBoxSeamless.h"
    2122#include <VBoxHook.h>
     
    2324#include <VBox/VMMDev.h>
    2425#include <iprt/assert.h>
    25 #include "helpers.h"
    2626#include <malloc.h>
    2727#include <VBoxGuestInternal.h>
     
    367367        && paDeviceModes[Id].dmBitsPerPel == BitsPerPixel)
    368368    {
    369         Log(("VBoxTray: ResizeDisplayDevice: Already at desired resolution.\n"));
     369        Log(("VBoxTray: ResizeDisplayDevice: Already at desired resolution\n"));
    370370        return FALSE;
    371371    }
    372372
    373     resizeRect(paRects, NumDevices, DevPrimaryNum, Id, Width, Height);
     373    hlpResizeRect(paRects, NumDevices, DevPrimaryNum, Id, Width, Height);
    374374#ifdef Log
    375375    for (i = 0; i < NumDevices; i++)
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxHelpers.cpp

    r33955 r33966  
    44
    55/*
    6  * Copyright (C) 2006-2007 Oracle Corporation
     6 * Copyright (C) 2006-2010 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2323#include <VBoxGuestInternal.h>
    2424
    25 #include "helpers.h"
     25#include "VBoxHelpers.h"
    2626#include "resource.h"
    2727
    28 static unsigned nextAdjacentRectXP (RECTL *paRects, unsigned nRects, unsigned iRect)
    29 {
    30     unsigned i;
    31     for (i = 0; i < nRects; i++)
    32     {
    33         if (paRects[iRect].right == paRects[i].left)
    34         {
    35             return i;
    36         }
    37     }
    38     return ~0;
    39 }
    40 
    41 static unsigned nextAdjacentRectXN (RECTL *paRects, unsigned nRects, unsigned iRect)
    42 {
    43     unsigned i;
    44     for (i = 0; i < nRects; i++)
    45     {
    46         if (paRects[iRect].left == paRects[i].right)
    47         {
    48             return i;
    49         }
    50     }
    51     return ~0;
    52 }
    53 
    54 static unsigned nextAdjacentRectYP (RECTL *paRects, unsigned nRects, unsigned iRect)
    55 {
    56     unsigned i;
    57     for (i = 0; i < nRects; i++)
    58     {
    59         if (paRects[iRect].bottom == paRects[i].top)
    60         {
    61             return i;
    62         }
    63     }
    64     return ~0;
    65 }
    66 
    67 unsigned nextAdjacentRectYN (RECTL *paRects, unsigned nRects, unsigned iRect)
    68 {
    69     unsigned i;
    70     for (i = 0; i < nRects; i++)
    71     {
    72         if (paRects[iRect].top == paRects[i].bottom)
    73         {
    74             return i;
    75         }
    76     }
    77     return ~0;
    78 }
    79 
    80 void resizeRect(RECTL *paRects, unsigned nRects, unsigned iPrimary, unsigned iResized, int NewWidth, int NewHeight)
    81 {
    82     DDCLOG(("nRects %d, iPrimary %d, iResized %d, NewWidth %d, NewHeight %d\n", nRects, iPrimary, iResized, NewWidth, NewHeight));
     28static unsigned hlpNextAdjacentRectXP(RECTL *paRects, unsigned nRects, unsigned uRect)
     29{
     30    unsigned i;
     31    for (i = 0; i < nRects; i++)
     32    {
     33        if (paRects[uRect].right == paRects[i].left)
     34            return i;
     35    }
     36    return ~0;
     37}
     38
     39static unsigned hlpNextAdjacentRectXN(RECTL *paRects, unsigned nRects, unsigned uRect)
     40{
     41    unsigned i;
     42    for (i = 0; i < nRects; i++)
     43    {
     44        if (paRects[uRect].left == paRects[i].right)
     45            return i;
     46    }
     47    return ~0;
     48}
     49
     50static unsigned hlpNextAdjacentRectYP(RECTL *paRects, unsigned nRects, unsigned uRect)
     51{
     52    unsigned i;
     53    for (i = 0; i < nRects; i++)
     54    {
     55        if (paRects[uRect].bottom == paRects[i].top)
     56            return i;
     57    }
     58    return ~0;
     59}
     60
     61static unsigned hlpNextAdjacentRectYN(RECTL *paRects, unsigned nRects, unsigned uRect)
     62{
     63    unsigned i;
     64    for (i = 0; i < nRects; i++)
     65    {
     66        if (paRects[uRect].top == paRects[i].bottom)
     67            return i;
     68    }
     69    return ~0;
     70}
     71
     72void hlpResizeRect(RECTL *paRects, unsigned nRects, unsigned uPrimary,
     73                   unsigned uResized, int iNewWidth, int iNewHeight)
     74{
     75    DDCLOG(("nRects %d, iPrimary %d, iResized %d, NewWidth %d, NewHeight %d\n", nRects, uPrimary, uResized, iNewWidth, iNewHeight));
    8376
    8477    RECTL *paNewRects = (RECTL *)alloca (sizeof (RECTL) * nRects);
    8578    memcpy (paNewRects, paRects, sizeof (RECTL) * nRects);
    86     paNewRects[iResized].right += NewWidth - (paNewRects[iResized].right - paNewRects[iResized].left);
    87     paNewRects[iResized].bottom += NewHeight - (paNewRects[iResized].bottom - paNewRects[iResized].top);
     79    paNewRects[uResized].right += iNewWidth - (paNewRects[uResized].right - paNewRects[uResized].left);
     80    paNewRects[uResized].bottom += iNewHeight - (paNewRects[uResized].bottom - paNewRects[uResized].top);
    8881
    8982    /* Verify all pairs of originally adjacent rectangles for all 4 directions.
     
    9891    {
    9992        /* Find the next adjacent original rect in x positive direction. */
    100         unsigned iNextRect = nextAdjacentRectXP (paRects, nRects, iRect);
    101         DDCLOG(("next %d -> %d\n", iRect, iNextRect));
    102 
    103         if (iNextRect == ~0 || iNextRect == iPrimary)
     93        unsigned iNextRect = hlpNextAdjacentRectXP(paRects, nRects, iRect);
     94        DDCLOG(("next %d -> %d\n", iRect, iNextRect));
     95
     96        if (iNextRect == ~0 || iNextRect == uPrimary)
    10497        {
    10598            continue;
     
    126119    {
    127120        /* Find the next adjacent original rect in x negative direction. */
    128         unsigned iNextRect = nextAdjacentRectXN (paRects, nRects, iRect);
    129         DDCLOG(("next %d -> %d\n", iRect, iNextRect));
    130 
    131         if (iNextRect == ~0 || iNextRect == iPrimary)
     121        unsigned iNextRect = hlpNextAdjacentRectXN(paRects, nRects, iRect);
     122        DDCLOG(("next %d -> %d\n", iRect, iNextRect));
     123
     124        if (iNextRect == ~0 || iNextRect == uPrimary)
    132125        {
    133126            continue;
     
    154147    {
    155148        /* Find the next adjacent original rect in y positive direction. */
    156         unsigned iNextRect = nextAdjacentRectYP (paRects, nRects, iRect);
    157         DDCLOG(("next %d -> %d\n", iRect, iNextRect));
    158 
    159         if (iNextRect == ~0 || iNextRect == iPrimary)
     149        unsigned iNextRect = hlpNextAdjacentRectYP(paRects, nRects, iRect);
     150        DDCLOG(("next %d -> %d\n", iRect, iNextRect));
     151
     152        if (iNextRect == ~0 || iNextRect == uPrimary)
    160153        {
    161154            continue;
     
    182175    {
    183176        /* Find the next adjacent original rect in x negative direction. */
    184         unsigned iNextRect = nextAdjacentRectYN (paRects, nRects, iRect);
    185         DDCLOG(("next %d -> %d\n", iRect, iNextRect));
    186 
    187         if (iNextRect == ~0 || iNextRect == iPrimary)
     177        unsigned iNextRect = hlpNextAdjacentRectYN(paRects, nRects, iRect);
     178        DDCLOG(("next %d -> %d\n", iRect, iNextRect));
     179
     180        if (iNextRect == ~0 || iNextRect == uPrimary)
    188181        {
    189182            continue;
     
    210203}
    211204
    212 int showBalloonTip (HINSTANCE hInst, HWND hWnd, UINT uID, const char *pszMsg, const char *pszTitle, UINT uTimeout, DWORD dwInfoFlags)
     205int hlpShowBalloonTip(HINSTANCE hInst, HWND hWnd, UINT uID,
     206                      const char *pszMsg, const char *pszTitle,
     207                      UINT uTimeout, DWORD dwInfoFlags)
    213208{
    214209    NOTIFYICONDATA niData;
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxHelpers.h

    r33955 r33966  
    11/* $Id$ */
    22/** @file
    3  * helpers - Guest Additions Service helper functions header
     3 * helpers - Guest Additions Service helper functions header.
    44 */
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2727#endif /* !DEBUG_DISPLAY_CHANGE */
    2828
    29 void resizeRect(RECTL *paRects, unsigned nRects, unsigned iPrimary, unsigned iResized, int NewWidth, int NewHeight);
    30 int showBalloonTip (HINSTANCE hInst, HWND hWnd, UINT uID, const char *pszMsg, const char *pszTitle, UINT uTimeout, DWORD dwInfoFlags);
     29extern void hlpResizeRect(RECTL *paRects, unsigned nRects, unsigned uPrimary, unsigned uResized, int iNewWidth, int iNewHeight);
     30extern int hlpShowBalloonTip(HINSTANCE hInst, HWND hWnd, UINT uID, const char *pszMsg, const char *pszTitle, UINT uTimeout, DWORD dwInfoFlags);
    3131
    3232#endif /* !___VBOXTRAY_HELPERS_H */
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxHostVersion.cpp

    r31002 r33966  
    1919#include "VBoxHostVersion.h"
    2020#include "VBoxTray.h"
    21 #include "helpers.h"
     21#include "VBoxHelpers.h"
    2222
    2323#include <VBox/VBoxGuestLib.h>
     
    2626/** @todo Move this part in VbglR3 and just provide a callback for the platform-specific
    2727          notification stuff, since this is very similar to the VBoxClient code. */
    28 int VBoxCheckHostVersion ()
     28int VBoxCheckHostVersion()
    2929{
    3030    int rc;
     
    5151                                                "install option from the Devices menu.", pszGuestVersion, pszHostVersion);
    5252
    53                 rc = showBalloonTip(gInstance, gToolWindow, ID_TRAYICON, szMsg, szTitle, 5000, 0);
     53                rc = hlpShowBalloonTip(gInstance, gToolWindow, ID_TRAYICON, szMsg, szTitle, 5000, 0);
    5454                if (RT_FAILURE(rc))
    5555                    Log(("VBoxTray: Guest Additions update found; however: could not show version notifier balloon tooltip! rc = %d\n", rc));
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxRestore.cpp

    r33595 r33966  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1818#include <windows.h>
    1919#include "VBoxTray.h"
     20#include "VBoxHelpers.h"
    2021#include "VBoxRestore.h"
    2122#include <VBoxDisplay.h>
     
    2324#include <VBoxGuestInternal.h>
    2425#include <iprt/assert.h>
    25 #include "helpers.h"
     26
    2627
    2728typedef struct _VBOXRESTORECONTEXT
     
    6465void VBoxRestoreCheckVRDP()
    6566{
    66     DWORD ret;
    6767    VBOXDISPIFESCAPE escape = {0};
    6868    escape.escapeCode = VBOXESC_ISVRDPACTIVE;
    69     /* Check VRDP activity */
     69    /* Check VRDP activity. */
    7070
    71     /* send to display driver */
    72     ret = VBoxDispIfEscape(&gCtx.pEnv->dispIf, &escape, 0);
    73     Log(("VBoxTray: VBoxRestoreSession -> VRDP activate state = %d\n", ret));
     71    /* Send to display driver. */
     72    DWORD dwRet = VBoxDispIfEscape(&gCtx.pEnv->dispIf, &escape, 0);
     73    Log(("VBoxTray: VBoxRestoreCheckVRDP -> VRDP activate state = %d\n", dwRet));
    7474
    75     if (ret != gCtx.fRDPState)
     75    if (dwRet != gCtx.fRDPState)
    7676    {
    77         DWORD cbReturned;
    78 
    79         if (!DeviceIoControl (gCtx.pEnv->hDriver, ret == NO_ERROR ? VBOXGUEST_IOCTL_ENABLE_VRDP_SESSION : VBOXGUEST_IOCTL_DISABLE_VRDP_SESSION, NULL, 0, NULL, 0, &cbReturned, NULL))
     77        DWORD cbReturnIgnored;
     78        if (!DeviceIoControl(gCtx.pEnv->hDriver,
     79                             dwRet == NO_ERROR
     80                             ? VBOXGUEST_IOCTL_ENABLE_VRDP_SESSION
     81                             : VBOXGUEST_IOCTL_DISABLE_VRDP_SESSION,
     82                             NULL, 0, NULL, 0, &cbReturnIgnored, NULL))
    8083        {
    81             Log(("VBoxTray: VBoxRestoreThread: DeviceIOControl(CtlMask) failed, SeamlessChangeThread exited\n"));
     84            Log(("VBoxTray: VBoxRestoreCheckVRDP: DeviceIOControl failed, error = %ld\n", GetLastError()));
    8285        }
    83         gCtx.fRDPState = ret;
     86        gCtx.fRDPState = dwRet;
    8487    }
    8588}
     
    127130            /* did we get the right event? */
    128131            if (waitEvent.u32EventFlagsOut & VMMDEV_EVENT_RESTORED)
    129                 PostMessage(gToolWindow, WM_VBOX_RESTORED, 0, 0);
     132                PostMessage(gToolWindow, WM_VBOXTRAY_VM_RESTORED, 0, 0);
    130133            else
    131134                /** @todo Don't poll, but wait for connect/disconnect events */
    132                 PostMessage(gToolWindow, WM_VBOX_CHECK_VRDP, 0, 0);
     135                PostMessage(gToolWindow, WM_VBOXTRAY_VRDP_CHECK, 0, 0);
    133136        }
    134137        else
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSeamless.cpp

    r33595 r33966  
    1818#include <windows.h>
    1919#include "VBoxTray.h"
     20#include "VBoxHelpers.h"
    2021#include "VBoxSeamless.h"
    2122#include <VBoxHook.h>
     
    2425#include <iprt/assert.h>
    2526#include <VBoxGuestInternal.h>
    26 #include "helpers.h"
    2727
    2828typedef struct _VBOXSEAMLESSCONTEXT
     
    324324            if (waitEvent.u32EventFlagsOut & VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST)
    325325            {
    326                 Log(("VBoxTray: VBoxTray: going to get seamless change information.\n"));
     326                Log(("VBoxTray: VBoxTray: going to get seamless change information\n"));
    327327
    328328                /* We got at least one event. Read the requested resolution
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSharedFolders.cpp

    r33464 r33966  
    1818#include "VBoxSharedFolders.h"
    1919#include "VBoxTray.h"
    20 #include "helpers.h"
     20#include "VBoxHelpers.h"
    2121
    2222#include <iprt/mem.h>
     
    105105                            if (chDrive > 'Z')
    106106                            {
    107                                 LogRel(("VBoxTray: No free driver letter found to assign shared folder \"%s\", aborting.\n", pszName));
     107                                LogRel(("VBoxTray: No free driver letter found to assign shared folder \"%s\", aborting\n", pszName));
    108108                                break;
    109109                            }
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp

    r32622 r33966  
    1515 */
    1616
     17
     18/*******************************************************************************
     19*   Header Files                                                               *
     20*******************************************************************************/
    1721#include "VBoxTray.h"
     22#include "VBoxHelpers.h"
    1823#include "VBoxSeamless.h"
    1924#include "VBoxClipboard.h"
     
    2833#include <VBoxGuestInternal.h>
    2934
    30 #include "helpers.h"
    3135#include <sddl.h>
    3236
    3337#include <iprt/buildconfig.h>
    3438
    35 /* global variables */
     39
     40/*******************************************************************************
     41*   Global Variables                                                           *
     42*******************************************************************************/
    3643HANDLE                gVBoxDriver;
    3744HANDLE                gStopSem;
     
    103110    gNotifyIconData.uID              = ID_TRAYICON;
    104111    gNotifyIconData.uFlags           = NIF_ICON | NIF_MESSAGE | NIF_TIP;
    105     gNotifyIconData.uCallbackMessage = WM_VBOX_TRAY;
     112    gNotifyIconData.uCallbackMessage = WM_VBOXTRAY_TRAY_ICON;
    106113    gNotifyIconData.hIcon            = hIcon;
    107114
     
    140147static int vboxStartServices(VBOXSERVICEENV *pEnv, VBOXSERVICEINFO *pTable)
    141148{
    142     Log(("VBoxTray: Starting services...\n"));
     149    Log(("VBoxTray: Starting services ...\n"));
    143150
    144151    pEnv->hStopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
     
    152159    while (pTable->pszName)
    153160    {
    154         Log(("VBoxTray: Starting %s...\n", pTable->pszName));
     161        Log(("VBoxTray: Starting %s ...\n", pTable->pszName));
    155162
    156163        int rc = VINF_SUCCESS;
     
    163170
    164171        if (pTable->pfnInit)
    165         {
    166172            rc = pTable->pfnInit (pEnv, &pTable->pInstance, &fStartThread);
    167         }
    168 
    169         if (RT_FAILURE (rc))
    170         {
    171             Log(("VBoxTray: Failed to initialize rc = %Rrc.\n", rc));
     173
     174        if (RT_FAILURE(rc))
     175        {
     176            Log(("VBoxTray: Failed to initialize rc = %Rrc\n", rc));
    172177        }
    173178        else
     
    176181            {
    177182                unsigned threadid;
    178 
    179183                pTable->hThread = (HANDLE)_beginthreadex (NULL,  /* security */
    180184                                                          0,     /* stacksize */
     
    185189
    186190                if (pTable->hThread == (HANDLE)(0))
    187                 {
    188191                    rc = VERR_NOT_SUPPORTED;
    189                 }
    190             }
    191 
    192             if (RT_FAILURE (rc))
    193             {
    194                 Log(("VBoxTray: Failed to start the thread.\n"));
    195 
     192            }
     193
     194            if (RT_SUCCESS(rc))
     195                pTable->fStarted = true;
     196            else
     197            {
     198                Log(("VBoxTray: Failed to start the thread\n"));
    196199                if (pTable->pfnDestroy)
    197                 {
    198                     pTable->pfnDestroy (pEnv, pTable->pInstance);
    199                 }
    200             }
    201             else
    202             {
    203                 pTable->fStarted = true;
     200                    pTable->pfnDestroy(pEnv, pTable->pInstance);
    204201            }
    205202        }
     
    215212{
    216213    if (!pEnv->hStopEvent)
    217     {
    218214        return;
    219     }
    220215
    221216    /* Signal to all threads. */
     
    231226                WaitForSingleObject(pTable->hThread, INFINITE);
    232227
    233                 CloseHandle (pTable->hThread);
     228                CloseHandle(pTable->hThread);
    234229                pTable->hThread = 0;
    235230            }
    236231
    237232            if (pTable->pfnDestroy)
    238             {
    239233                pTable->pfnDestroy (pEnv, pTable->pInstance);
    240             }
    241 
    242234            pTable->fStarted = false;
    243235        }
     
    247239    }
    248240
    249     CloseHandle (pEnv->hStopEvent);
    250 }
    251 
    252 
    253 /** Attempt to force Windows to reload the cursor image by attaching to the
     241    CloseHandle(pEnv->hStopEvent);
     242}
     243
     244
     245/**
     246 * Attempt to force Windows to reload the cursor image by attaching to the
    254247 * thread of the window currently under the mouse, hiding the cursor and
    255248 * showing it again.  This could fail to work in any number of ways (no
    256249 * window under the cursor, the cursor has moved to a different window while
    257250 * we are processing), but we just accept this, as the cursor will be reloaded
    258  * at some point anyway. */
     251 * at some point anyway.
     252 */
    259253void VBoxServiceReloadCursor(void)
    260254{
     
    340334    if (GetVersionEx(&info))
    341335    {
    342         Log(("VBoxTray: Windows version major %d minor %d.\n", info.dwMajorVersion, info.dwMinorVersion));
     336        Log(("VBoxTray: Windows version major %d minor %d\n", info.dwMajorVersion, info.dwMinorVersion));
    343337        gMajorVersion = info.dwMajorVersion;
    344338    }
     
    451445        /* Check in 10 seconds (@todo make seconds configurable) ... */
    452446        SetTimer(gToolWindow,
    453                  WM_VBOX_CHECK_HOSTVERSION,
     447                 TIMERID_VBOXTRAY_CHECK_HOSTVERSION,
    454448                 10 * 1000, /* 10 seconds */
    455449                 NULL       /* No timerproc */);
     
    479473
    480474        /* Only enable for message debugging, lots of traffic! */
    481         //Log(("VBoxTray: Wait result  = %ld.\n", waitResult));
     475        //Log(("VBoxTray: Wait result  = %ld\n", waitResult));
    482476
    483477        if (waitResult == 0)
    484478        {
    485             Log(("VBoxTray: Event 'Exit' triggered.\n"));
     479            Log(("VBoxTray: Event 'Exit' triggered\n"));
    486480            /* exit */
    487481            break;
     
    490484                 && (ghSeamlessNotifyEvent!=0)) /* Only jump in, if seamless is active! */
    491485        {
    492             Log(("VBoxTray: Event 'Seamless' triggered.\n"));
     486            Log(("VBoxTray: Event 'Seamless' triggered\n"));
    493487
    494488            /* seamless window notification */
     
    563557        return rc;
    564558
    565     LogRel(("VBoxTray: %s r%s started.\n", RTBldCfgVersion(), RTBldCfgRevisionStr()));
     559    LogRel(("VBoxTray: %s r%s started\n", RTBldCfgVersion(), RTBldCfgRevisionStr()));
    566560
    567561    gInstance = hInstance;
    568562    VBoxServiceStart();
    569563
    570     LogRel(("VBoxTray: Ended.\n"));
     564    LogRel(("VBoxTray: Ended\n"));
    571565
    572566    /* Release instance mutex. */
     
    590584    {
    591585        case WM_CREATE:
    592             Log(("VBoxTray: Tool window created.\n"));
     586            Log(("VBoxTray: Tool window created\n"));
    593587            s_uTaskbarCreated = RegisterWindowMessage(TEXT("TaskbarCreated"));
    594588            if (!s_uTaskbarCreated)
     
    600594
    601595        case WM_DESTROY:
    602             Log(("VBoxTray: Tool window destroyed.\n"));
    603             KillTimer(gToolWindow, WM_VBOX_CHECK_HOSTVERSION);
     596            Log(("VBoxTray: Tool window destroyed\n"));
     597            KillTimer(gToolWindow, TIMERID_VBOXTRAY_CHECK_HOSTVERSION);
    604598            break;
    605599
     
    607601            switch (wParam)
    608602            {
    609                 case WM_VBOX_CHECK_HOSTVERSION:
     603                case WM_VBOXTRAY_CHECK_HOSTVERSION:
    610604                    if (RT_SUCCESS(VBoxCheckHostVersion()))
    611605                    {
    612606                        /* After successful run we don't need to check again. */
    613                         KillTimer(gToolWindow, WM_VBOX_CHECK_HOSTVERSION);
     607                        KillTimer(gToolWindow, TIMERID_VBOXTRAY_CHECK_HOSTVERSION);
    614608                    }
    615609                    return 0;
     
    621615            break;
    622616
    623         case WM_VBOX_TRAY:
     617        case WM_VBOXTRAY_TRAY_ICON:
    624618            switch (lParam)
    625619            {
     
    644638            break;
    645639
    646         case WM_VBOX_RESTORED:
     640        case WM_VBOXTRAY_VM_RESTORED:
    647641            VBoxRestoreSession();
    648642            break;
    649643
    650         case WM_VBOX_CHECK_VRDP:
     644        case WM_VBOXTRAY_VRDP_CHECK:
    651645            VBoxRestoreCheckVRDP();
    652646            break;
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.h

    r31145 r33966  
    3636#include "VBoxDispIf.h"
    3737
    38 #define WM_VBOX_RESTORED                WM_APP + 1
    39 #define WM_VBOX_CHECK_VRDP              WM_APP + 2
    40 #define WM_VBOX_CHECK_HOSTVERSION       WM_APP + 3
    41 #define WM_VBOX_TRAY                    WM_APP + 4
     38/*
     39 * Windows messsages.
     40 */
    4241
     42/**
     43 * General VBoxTray messages.
     44 */
     45#define WM_VBOXTRAY_TRAY_ICON                   WM_APP + 40
     46#define WM_VBOXTRAY_TRAY_DISPLAY_BALLOON        WM_APP + 41
     47/**
     48 * VM/VMMDev related messsages.
     49 */
     50#define WM_VBOXTRAY_VM_RESTORED                 WM_APP + 100
     51/**
     52 * VRDP messages.
     53 */
     54#define WM_VBOXTRAY_VRDP_CHECK                  WM_APP + 301
     55/**
     56 * Misc. utility functions.
     57 */
     58#define WM_VBOXTRAY_CHECK_HOSTVERSION           WM_APP + 1000
     59
     60
     61/* The tray icon's ID. */
    4362#define ID_TRAYICON                     2000
    4463
     64
     65/*
     66 * Timer IDs.
     67 */
     68#define TIMERID_VBOXTRAY_CHECK_HOSTVERSION      1000
    4569
    4670/* The environment information for services. */
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxVRDP.cpp

    r33595 r33966  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#include <windows.h>
    2121#include "VBoxTray.h"
     22#include "VBoxHelpers.h"
    2223#include "VBoxVRDP.h"
    2324#include <VBox/VMMDev.h>
    2425#include <VBoxGuestInternal.h>
    2526#include <iprt/assert.h>
    26 #include "helpers.h"
    2727
    2828
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette