Commit ecbf1d92 authored by Pascal Lessard's avatar Pascal Lessard Committed by Alexandre Julliard

Added the case of a user defined icon for the sysbutton hittest.

parent b101a5c6
......@@ -861,8 +861,18 @@ NC_DoNCHitTest95 (WND *wndPtr, POINT16 pt )
if (!PtInRect16( &rect, pt ))
{
/* Check system menu */
if ((wndPtr->dwStyle & WS_SYSMENU) && (!(wndPtr->dwStyle & DS_MODALFRAME)))
rect.left += GetSystemMetrics(SM_CYCAPTION) - 1;
if(wndPtr->dwStyle & WS_SYSMENU)
{
/* Check if there is an user icon */
HICON hIcon = (HICON) GetClassLongA(wndPtr->hwndSelf, GCL_HICONSM);
if(!hIcon) hIcon = (HICON) GetClassLongA(wndPtr->hwndSelf, GCL_HICON);
/* If there is an icon associated with the window OR */
/* If there is no hIcon specified and this is not a modal dialog, */
/* there is a system menu icon. */
if((hIcon != 0) || (!(wndPtr->dwStyle & DS_MODALFRAME)))
rect.left += GetSystemMetrics(SM_CYCAPTION) - 1;
}
if (pt.x < rect.left) return HTSYSMENU;
/* Check close button */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment