VirtualBox

Ignore:
Timestamp:
Apr 23, 2013 10:26:14 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85200
Message:

VBoxTray/VBoxSeamless: Fix for the issue - A small rectangular bar appears over the start button for Vista and above in seamless mode when mouse is hovered over the start button..
Solution:
There is difference in the rectangle size of "Start" button and its shadow as reported by the API GetWindowRect. So , adjusting the size of the "Start" button to match the shadow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSeamless.cpp

    r45644 r45676  
    155155    if (GetWindowRect(hwnd, &rectWindow))
    156156    {
    157         rectVisible = rectWindow;
    158 
    159157        char szWindowText[256];
    160158        szWindowText[0] = 0;
     159        OSVERSIONINFO OSinfo;
     160        HWND hStart = NULL;
    161161        GetWindowText(hwnd, szWindowText, sizeof(szWindowText));
     162        OSinfo.dwOSVersionInfoSize = sizeof (OSinfo);
     163        GetVersionEx (&OSinfo);
     164        if (OSinfo.dwMajorVersion >= 6)
     165        {
     166            hStart = ::FindWindowEx(GetDesktopWindow(), NULL, "Button", "Start");
     167            if (  hwnd == hStart && szWindowText != NULL
     168                && !(strcmp(szWindowText, "Start"))
     169               )
     170            {
     171                /* for vista and above. To solve the issue of small bar above
     172                 * the Start button when mouse is hovered over the start button in seamless mode.
     173                 * Difference of 7 is observed in Win 7 platform between the dimensionsof rectangle with Start title and its shadow.
     174                 */
     175                rectWindow.top += 7;
     176                rectWindow.bottom -=7;
     177            }
     178        }
     179        rectVisible = rectWindow;
    162180
    163181#ifdef LOG_ENABLED
Note: See TracChangeset for help on using the changeset viewer.

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