2 * Non-client area window functions
4 * Copyright 1994 Alexandre Julliard
7 static char Copyright
[] = "Copyright Alexandre Julliard, 1994";
12 #include "sysmetrics.h"
17 static HBITMAP hbitmapClose
= 0;
18 static HBITMAP hbitmapMDIClose
= 0;
19 static HBITMAP hbitmapMinimize
= 0;
20 static HBITMAP hbitmapMinimizeD
= 0;
21 static HBITMAP hbitmapMaximize
= 0;
22 static HBITMAP hbitmapMaximizeD
= 0;
23 static HBITMAP hbitmapRestore
= 0;
24 static HBITMAP hbitmapRestoreD
= 0;
26 #define SC_ABOUTWINE (SC_SCREENSAVE+1)
27 extern HINSTANCE hSysRes
;
28 extern BOOL
AboutWine_Proc( HWND hDlg
, WORD msg
, WORD wParam
, LONG lParam
);
30 extern void WINPOS_GetMinMaxInfo( HWND hwnd
, POINT
*maxSize
, POINT
*maxPos
,
31 POINT
*minTrack
, POINT
*maxTrack
); /* winpos.c */
32 extern void CURSOR_SetWinCursor( HWND hwnd
, HCURSOR hcursor
); /* cursor.c */
33 extern WORD
MENU_GetMenuBarHeight( HWND hwnd
, WORD menubarWidth
,
34 int orgX
, int orgY
); /* menu.c */
35 extern void MENU_TrackMouseMenuBar( HWND hwnd
, POINT pt
); /* menu.c */
36 extern void MENU_TrackKbdMenuBar( HWND hwnd
, WORD wParam
); /* menu.c */
37 extern WORD
MENU_DrawMenuBar( HDC hDC
, LPRECT lprect
,
38 HMENU hmenu
, BOOL suppress_draw
); /* menu.c */
41 /* Some useful macros */
42 #define HAS_DLGFRAME(style,exStyle) \
43 (((style) & WS_DLGFRAME) && \
44 (((exStyle) & WS_EX_DLGMODALFRAME) || !((style) & WS_BORDER)))
46 #define HAS_THICKFRAME(style) \
47 (((style) & WS_THICKFRAME) && \
48 !(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME))
50 #define HAS_MENU(w) (!((w)->dwStyle & WS_CHILD) && ((w)->wIDmenu != 0))
52 #define ON_LEFT_BORDER(hit) \
53 (((hit) == HTLEFT) || ((hit) == HTTOPLEFT) || ((hit) == HTBOTTOMLEFT))
54 #define ON_RIGHT_BORDER(hit) \
55 (((hit) == HTRIGHT) || ((hit) == HTTOPRIGHT) || ((hit) == HTBOTTOMRIGHT))
56 #define ON_TOP_BORDER(hit) \
57 (((hit) == HTTOP) || ((hit) == HTTOPLEFT) || ((hit) == HTTOPRIGHT))
58 #define ON_BOTTOM_BORDER(hit) \
59 (((hit) == HTBOTTOM) || ((hit) == HTBOTTOMLEFT) || ((hit) == HTBOTTOMRIGHT))
61 /***********************************************************************
64 * Compute the size of the window rectangle from the size of the
67 static void NC_AdjustRect( LPRECT rect
, DWORD style
, BOOL menu
, DWORD exStyle
)
69 if (HAS_DLGFRAME( style
, exStyle
))
70 InflateRect( rect
, SYSMETRICS_CXDLGFRAME
, SYSMETRICS_CYDLGFRAME
);
73 if (HAS_THICKFRAME(style
))
74 InflateRect( rect
, SYSMETRICS_CXFRAME
, SYSMETRICS_CYFRAME
);
75 if (style
& WS_BORDER
)
76 InflateRect( rect
, SYSMETRICS_CXBORDER
, SYSMETRICS_CYBORDER
);
79 if ((style
& WS_CAPTION
) == WS_CAPTION
)
80 rect
->top
-= SYSMETRICS_CYCAPTION
- SYSMETRICS_CYBORDER
;
81 if (menu
) rect
->top
-= SYSMETRICS_CYMENU
+ SYSMETRICS_CYBORDER
;
83 if (style
& WS_VSCROLL
) rect
->right
+= SYSMETRICS_CXVSCROLL
;
84 if (style
& WS_HSCROLL
) rect
->bottom
+= SYSMETRICS_CYHSCROLL
;
88 /***********************************************************************
89 * AdjustWindowRect (USER.102)
91 void AdjustWindowRect( LPRECT rect
, DWORD style
, BOOL menu
)
93 AdjustWindowRectEx( rect
, style
, menu
, 0 );
97 /***********************************************************************
98 * AdjustWindowRectEx (USER.454)
100 void AdjustWindowRectEx( LPRECT rect
, DWORD style
, BOOL menu
, DWORD exStyle
)
102 /* Correct the window style */
104 if (!(style
& (WS_POPUP
| WS_CHILD
))) /* Overlapped window */
106 if (exStyle
& WS_EX_DLGMODALFRAME
) style
&= ~WS_THICKFRAME
;
108 #ifdef DEBUG_NONCLIENT
109 printf( "AdjustWindowRectEx: (%d,%d)-(%d,%d) %08x %d %08x\n",
110 rect
->left
, rect
->top
, rect
->right
, rect
->bottom
, style
, menu
, exStyle
);
113 NC_AdjustRect( rect
, style
, menu
, exStyle
);
117 /***********************************************************************
118 * NC_HandleNCCalcSize
120 * Handle a WM_NCCALCSIZE message. Called from DefWindowProc().
122 LONG
NC_HandleNCCalcSize( HWND hwnd
, NCCALCSIZE_PARAMS
*params
)
124 RECT tmpRect
= { 0, 0, 0, 0 };
125 WND
*wndPtr
= WIN_FindWndPtr( hwnd
);
127 if (!wndPtr
) return 0;
129 NC_AdjustRect( &tmpRect
, wndPtr
->dwStyle
, FALSE
, wndPtr
->dwExStyle
);
130 params
->rgrc
[0].left
-= tmpRect
.left
;
131 params
->rgrc
[0].top
-= tmpRect
.top
;
132 params
->rgrc
[0].right
-= tmpRect
.right
;
133 params
->rgrc
[0].bottom
-= tmpRect
.bottom
;
135 if (HAS_MENU(wndPtr
))
137 params
->rgrc
[0].top
+= MENU_GetMenuBarHeight( hwnd
,
138 params
->rgrc
[0].right
- params
->rgrc
[0].left
,
139 -tmpRect
.left
, -tmpRect
.top
) + 1;
145 /***********************************************************************
148 * Get the 'inside' rectangle of a window, i.e. the whole window rectangle
149 * but without the borders (if any).
150 * The rectangle is in window coordinates (for drawing with GetWindowDC()).
152 void NC_GetInsideRect( HWND hwnd
, RECT
*rect
)
154 WND
* wndPtr
= WIN_FindWndPtr( hwnd
);
156 rect
->top
= rect
->left
= 0;
157 rect
->right
= wndPtr
->rectWindow
.right
- wndPtr
->rectWindow
.left
;
158 rect
->bottom
= wndPtr
->rectWindow
.bottom
- wndPtr
->rectWindow
.top
;
160 /* Remove frame from rectangle */
161 if (HAS_DLGFRAME( wndPtr
->dwStyle
, wndPtr
->dwExStyle
))
163 InflateRect( rect
, -SYSMETRICS_CXDLGFRAME
, -SYSMETRICS_CYDLGFRAME
);
164 if (wndPtr
->dwExStyle
& WS_EX_DLGMODALFRAME
) InflateRect( rect
, -1, 0);
168 if (HAS_THICKFRAME( wndPtr
->dwStyle
))
169 InflateRect( rect
, -SYSMETRICS_CXFRAME
, -SYSMETRICS_CYFRAME
);
170 if (wndPtr
->dwStyle
& WS_BORDER
)
171 InflateRect( rect
, -SYSMETRICS_CXBORDER
, -SYSMETRICS_CYBORDER
);
176 /***********************************************************************
177 * NC_InternalNCHitTest
179 * Perform the hit test calculation, but whithout testing the capture
182 static LONG
NC_InternalNCHitTest( HWND hwnd
, POINT pt
)
185 WND
*wndPtr
= WIN_FindWndPtr( hwnd
);
186 if (!wndPtr
) return HTERROR
;
188 GetWindowRect( hwnd
, &rect
);
189 if (!PtInRect( &rect
, pt
)) return HTNOWHERE
;
193 if (HAS_THICKFRAME( wndPtr
->dwStyle
))
195 InflateRect( &rect
, -SYSMETRICS_CXFRAME
, -SYSMETRICS_CYFRAME
);
196 if (wndPtr
->dwStyle
& WS_BORDER
)
197 InflateRect( &rect
, -SYSMETRICS_CXBORDER
, -SYSMETRICS_CYBORDER
);
198 if (!PtInRect( &rect
, pt
))
200 /* Check top sizing border */
203 if (pt
.x
< rect
.left
+SYSMETRICS_CXSIZE
) return HTTOPLEFT
;
204 if (pt
.x
>= rect
.right
-SYSMETRICS_CXSIZE
) return HTTOPRIGHT
;
207 /* Check bottom sizing border */
208 if (pt
.y
>= rect
.bottom
)
210 if (pt
.x
< rect
.left
+SYSMETRICS_CXSIZE
) return HTBOTTOMLEFT
;
211 if (pt
.x
>= rect
.right
-SYSMETRICS_CXSIZE
) return HTBOTTOMRIGHT
;
214 /* Check left sizing border */
215 if (pt
.x
< rect
.left
)
217 if (pt
.y
< rect
.top
+SYSMETRICS_CYSIZE
) return HTTOPLEFT
;
218 if (pt
.y
>= rect
.bottom
-SYSMETRICS_CYSIZE
) return HTBOTTOMLEFT
;
221 /* Check right sizing border */
222 if (pt
.x
>= rect
.right
)
224 if (pt
.y
< rect
.top
+SYSMETRICS_CYSIZE
) return HTTOPRIGHT
;
225 if (pt
.y
>= rect
.bottom
-SYSMETRICS_CYSIZE
) return HTBOTTOMRIGHT
;
230 else /* No thick frame */
232 if (HAS_DLGFRAME( wndPtr
->dwStyle
, wndPtr
->dwExStyle
))
233 InflateRect(&rect
, -SYSMETRICS_CXDLGFRAME
, -SYSMETRICS_CYDLGFRAME
);
234 else if (wndPtr
->dwStyle
& WS_BORDER
)
235 InflateRect(&rect
, -SYSMETRICS_CXBORDER
, -SYSMETRICS_CYBORDER
);
236 if (!PtInRect( &rect
, pt
)) return HTBORDER
;
241 if ((wndPtr
->dwStyle
& WS_CAPTION
) == WS_CAPTION
)
243 rect
.top
+= SYSMETRICS_CYCAPTION
- 1;
244 if (!PtInRect( &rect
, pt
))
246 /* Check system menu */
247 if (wndPtr
->dwStyle
& WS_SYSMENU
)
248 rect
.left
+= SYSMETRICS_CXSIZE
;
249 if (pt
.x
<= rect
.left
) return HTSYSMENU
;
250 /* Check maximize box */
251 if (wndPtr
->dwStyle
& WS_MAXIMIZEBOX
)
252 rect
.right
-= SYSMETRICS_CXSIZE
+ 1;
253 if (pt
.x
>= rect
.right
) return HTMAXBUTTON
;
254 /* Check minimize box */
255 if (wndPtr
->dwStyle
& WS_MINIMIZEBOX
)
256 rect
.right
-= SYSMETRICS_CXSIZE
+ 1;
257 if (pt
.x
>= rect
.right
) return HTMINBUTTON
;
262 /* Check client area */
264 ScreenToClient( hwnd
, &pt
);
265 GetClientRect( hwnd
, &rect
);
266 if (PtInRect( &rect
, pt
)) return HTCLIENT
;
268 /* Check vertical scroll bar */
270 if (wndPtr
->dwStyle
& WS_VSCROLL
)
272 rect
.right
+= SYSMETRICS_CXVSCROLL
;
273 if (PtInRect( &rect
, pt
)) return HTVSCROLL
;
276 /* Check horizontal scroll bar */
278 if (wndPtr
->dwStyle
& WS_HSCROLL
)
280 rect
.bottom
+= SYSMETRICS_CYHSCROLL
;
281 if (PtInRect( &rect
, pt
))
284 if ((wndPtr
->dwStyle
& WS_VSCROLL
) &&
285 (pt
.x
>= rect
.right
- SYSMETRICS_CXVSCROLL
))
293 if (HAS_MENU(wndPtr
))
295 if ((pt
.y
< 0) && (pt
.x
>= 0) && (pt
.x
< rect
.right
))
299 /* Should never get here */
304 /***********************************************************************
307 * Handle a WM_NCHITTEST message. Called from DefWindowProc().
309 LONG
NC_HandleNCHitTest( HWND hwnd
, POINT pt
)
311 #ifdef DEBUG_NONCLIENT
312 printf( "NC_HandleNCHitTest: hwnd=%x pt=%d,%d\n", hwnd
, pt
.x
, pt
.y
);
314 if (hwnd
== GetCapture()) return HTCLIENT
;
315 return NC_InternalNCHitTest( hwnd
, pt
);
319 /***********************************************************************
322 void NC_DrawSysButton( HWND hwnd
, HDC hdc
, BOOL down
)
325 WND
*wndPtr
= WIN_FindWndPtr( hwnd
);
326 HDC hdcMem
= CreateCompatibleDC( hdc
);
329 NC_GetInsideRect( hwnd
, &rect
);
330 if (wndPtr
->dwStyle
& WS_CHILD
)
331 SelectObject( hdcMem
, hbitmapMDIClose
);
333 SelectObject( hdcMem
, hbitmapClose
);
334 BitBlt( hdc
, rect
.left
, rect
.top
, SYSMETRICS_CXSIZE
,
335 SYSMETRICS_CYSIZE
, hdcMem
, 1, 1, down
? NOTSRCCOPY
: SRCCOPY
);
341 /***********************************************************************
344 static void NC_DrawMaxButton( HWND hwnd
, HDC hdc
, BOOL down
)
347 HDC hdcMem
= CreateCompatibleDC( hdc
);
350 NC_GetInsideRect( hwnd
, &rect
);
352 SelectObject( hdcMem
, down
? hbitmapRestoreD
: hbitmapRestore
);
353 else SelectObject( hdcMem
, down
? hbitmapMaximizeD
: hbitmapMaximize
);
354 BitBlt( hdc
, rect
.right
- SYSMETRICS_CXSIZE
- 1, rect
.top
- 1,
355 SYSMETRICS_CXSIZE
+2, SYSMETRICS_CYSIZE
+2, hdcMem
, 0, 0, SRCCOPY
);
361 /***********************************************************************
364 static void NC_DrawMinButton( HWND hwnd
, HDC hdc
, BOOL down
)
367 WND
*wndPtr
= WIN_FindWndPtr( hwnd
);
368 HDC hdcMem
= CreateCompatibleDC( hdc
);
371 NC_GetInsideRect( hwnd
, &rect
);
372 if (wndPtr
->dwStyle
& WS_MAXIMIZEBOX
)
373 rect
.right
-= SYSMETRICS_CXSIZE
+ 1;
374 if (down
) SelectObject( hdcMem
, hbitmapMinimizeD
);
375 else SelectObject( hdcMem
, hbitmapMinimize
);
376 BitBlt( hdc
, rect
.right
- SYSMETRICS_CXSIZE
- 1, rect
.top
- 1,
377 SYSMETRICS_CXSIZE
+2, SYSMETRICS_CYSIZE
+2, hdcMem
, 0, 0, SRCCOPY
);
383 /***********************************************************************
386 * Draw a window frame inside the given rectangle, and update the rectangle.
387 * The correct pen and brush must be selected in the DC.
389 static void NC_DrawFrame( HDC hdc
, RECT
*rect
, BOOL dlgFrame
)
391 short width
, height
, tmp
;
395 width
= SYSMETRICS_CXDLGFRAME
- 1;
396 height
= SYSMETRICS_CYDLGFRAME
- 1;
400 width
= SYSMETRICS_CXFRAME
- 1;
401 height
= SYSMETRICS_CYFRAME
- 1;
405 PatBlt( hdc
, rect
->left
, rect
->top
,
406 rect
->right
- rect
->left
, height
, PATCOPY
);
407 PatBlt( hdc
, rect
->left
, rect
->top
,
408 width
, rect
->bottom
- rect
->top
, PATCOPY
);
409 PatBlt( hdc
, rect
->left
, rect
->bottom
,
410 rect
->right
- rect
->left
, -height
, PATCOPY
);
411 PatBlt( hdc
, rect
->right
, rect
->top
,
412 -width
, rect
->bottom
- rect
->top
, PATCOPY
);
416 InflateRect( rect
, -width
, -height
);
420 /* Draw inner rectangle */
421 MoveTo( hdc
, rect
->left
+width
, rect
->top
+height
);
422 LineTo( hdc
, rect
->right
-width
-1, rect
->top
+height
);
423 LineTo( hdc
, rect
->right
-width
-1, rect
->bottom
-height
-1 );
424 LineTo( hdc
, rect
->left
+width
, rect
->bottom
-height
-1 );
425 LineTo( hdc
, rect
->left
+width
, rect
->top
+height
);
427 /* Draw the decorations */
428 tmp
= rect
->top
+ SYSMETRICS_CYFRAME
+ SYSMETRICS_CYSIZE
;
429 MoveTo( hdc
, rect
->left
, tmp
);
430 LineTo( hdc
, rect
->left
+width
, tmp
);
431 MoveTo( hdc
, rect
->right
-width
-1, tmp
);
432 LineTo( hdc
, rect
->right
-1, tmp
);
434 tmp
= rect
->bottom
- 1 - SYSMETRICS_CYFRAME
- SYSMETRICS_CYSIZE
;
435 MoveTo( hdc
, rect
->left
, tmp
);
436 LineTo( hdc
, rect
->left
+width
, tmp
);
437 MoveTo( hdc
, rect
->right
-width
-1, tmp
);
438 LineTo( hdc
, rect
->right
-1, tmp
);
440 tmp
= rect
->left
+ SYSMETRICS_CXFRAME
+ SYSMETRICS_CXSIZE
;
441 MoveTo( hdc
, tmp
, rect
->top
);
442 LineTo( hdc
, tmp
, rect
->top
+height
);
443 MoveTo( hdc
, tmp
, rect
->bottom
-height
-1 );
444 LineTo( hdc
, tmp
, rect
->bottom
-1 );
446 tmp
= rect
->right
- 1 - SYSMETRICS_CXFRAME
- SYSMETRICS_CYSIZE
;
447 MoveTo( hdc
, tmp
, rect
->top
);
448 LineTo( hdc
, tmp
, rect
->top
+height
);
449 MoveTo( hdc
, tmp
, rect
->bottom
-height
-1 );
450 LineTo( hdc
, tmp
, rect
->bottom
-1 );
452 InflateRect( rect
, -width
-1, -height
-1 );
456 /***********************************************************************
459 * Draw the frame used when moving or resizing window.
461 static void NC_DrawMovingFrame( HDC hdc
, RECT
*rect
, BOOL thickframe
)
465 SelectObject( hdc
, GetStockObject( GRAY_BRUSH
) );
466 PatBlt( hdc
, rect
->left
, rect
->top
,
467 rect
->right
- rect
->left
- SYSMETRICS_CXFRAME
,
468 SYSMETRICS_CYFRAME
, PATINVERT
);
469 PatBlt( hdc
, rect
->left
, rect
->top
+ SYSMETRICS_CYFRAME
,
471 rect
->bottom
- rect
->top
- SYSMETRICS_CYFRAME
, PATINVERT
);
472 PatBlt( hdc
, rect
->left
+ SYSMETRICS_CXFRAME
, rect
->bottom
,
473 rect
->right
- rect
->left
- SYSMETRICS_CXFRAME
,
474 -SYSMETRICS_CYFRAME
, PATINVERT
);
475 PatBlt( hdc
, rect
->right
, rect
->top
, -SYSMETRICS_CXFRAME
,
476 rect
->bottom
- rect
->top
- SYSMETRICS_CYFRAME
, PATINVERT
);
478 else DrawFocusRect( hdc
, rect
);
482 /***********************************************************************
485 * Draw the window caption.
486 * The correct pen for the window frame must be selected in the DC.
488 static void NC_DrawCaption( HDC hdc
, RECT
*rect
, HWND hwnd
,
489 DWORD style
, BOOL active
)
492 WND
* wndPtr
= WIN_FindWndPtr( hwnd
);
497 if (!(hbitmapClose
= LoadBitmap( 0, MAKEINTRESOURCE(OBM_CLOSE
) )))
499 if (!(hbitmapMDIClose
= LoadBitmap( 0, MAKEINTRESOURCE(OBM_OLD_CLOSE
) )))
501 hbitmapMinimize
= LoadBitmap( 0, MAKEINTRESOURCE(OBM_REDUCE
) );
502 hbitmapMinimizeD
= LoadBitmap( 0, MAKEINTRESOURCE(OBM_REDUCED
) );
503 hbitmapMaximize
= LoadBitmap( 0, MAKEINTRESOURCE(OBM_ZOOM
) );
504 hbitmapMaximizeD
= LoadBitmap( 0, MAKEINTRESOURCE(OBM_ZOOMD
) );
505 hbitmapRestore
= LoadBitmap( 0, MAKEINTRESOURCE(OBM_RESTORE
) );
506 hbitmapRestoreD
= LoadBitmap( 0, MAKEINTRESOURCE(OBM_RESTORED
) );
509 if (wndPtr
->dwExStyle
& WS_EX_DLGMODALFRAME
)
511 HBRUSH hbrushOld
= SelectObject( hdc
, sysColorObjects
.hbrushWindow
);
512 PatBlt( hdc
, r
.left
, r
.top
, 1, r
.bottom
-r
.top
+1,PATCOPY
);
513 PatBlt( hdc
, r
.right
-1, r
.top
, 1, r
.bottom
-r
.top
+1, PATCOPY
);
514 PatBlt( hdc
, r
.left
, r
.top
-1, r
.right
-r
.left
, 1, PATCOPY
);
517 SelectObject( hdc
, hbrushOld
);
520 MoveTo( hdc
, r
.left
, r
.bottom
);
521 LineTo( hdc
, r
.right
-1, r
.bottom
);
523 if (style
& WS_SYSMENU
)
525 NC_DrawSysButton( hwnd
, hdc
, FALSE
);
526 r
.left
+= SYSMETRICS_CXSIZE
+ 1;
527 MoveTo( hdc
, r
.left
- 1, r
.top
);
528 LineTo( hdc
, r
.left
- 1, r
.bottom
);
530 if (style
& WS_MAXIMIZEBOX
)
532 NC_DrawMaxButton( hwnd
, hdc
, FALSE
);
533 r
.right
-= SYSMETRICS_CXSIZE
+ 1;
535 if (style
& WS_MINIMIZEBOX
)
537 NC_DrawMinButton( hwnd
, hdc
, FALSE
);
538 r
.right
-= SYSMETRICS_CXSIZE
+ 1;
541 FillRect( hdc
, &r
, active
? sysColorObjects
.hbrushActiveCaption
:
542 sysColorObjects
.hbrushInactiveCaption
);
544 if (GetWindowText( hwnd
, buffer
, 256 ))
546 if (active
) SetTextColor( hdc
, GetSysColor( COLOR_CAPTIONTEXT
) );
547 else SetTextColor( hdc
, GetSysColor( COLOR_INACTIVECAPTIONTEXT
) );
548 SetBkMode( hdc
, TRANSPARENT
);
549 DrawText( hdc
, buffer
, -1, &r
, DT_SINGLELINE
| DT_CENTER
| DT_VCENTER
);
554 /***********************************************************************
557 * Paint the non-client area.
558 * 'hrgn' is the update rgn to use (in client coords) or 1 if no update rgn.
560 void NC_DoNCPaint( HWND hwnd
, HRGN hrgn
, BOOL active
, BOOL suppress_menupaint
)
565 WND
*wndPtr
= WIN_FindWndPtr( hwnd
);
567 #ifdef DEBUG_NONCLIENT
568 printf( "NC_DoNCPaint: %d %d\n", hwnd
, hrgn
);
570 if (!wndPtr
|| !hrgn
) return;
571 if ((!(wndPtr
->dwStyle
& (WS_BORDER
| WS_DLGFRAME
| WS_THICKFRAME
))) ||
572 (!(wndPtr
->dwStyle
& WS_VISIBLE
)))
573 return; /* Nothing to do! */
575 if (hrgn
== 1) hdc
= GetDCEx( hwnd
, 0, DCX_CACHE
| DCX_WINDOW
);
578 /* Make region relative to window area */
579 int xoffset
= wndPtr
->rectWindow
.left
- wndPtr
->rectClient
.left
;
580 int yoffset
= wndPtr
->rectWindow
.top
- wndPtr
->rectClient
.top
;
581 OffsetRgn( hrgn
, -xoffset
, -yoffset
);
582 hdc
= GetDCEx( hwnd
, hrgn
, DCX_CACHE
| DCX_WINDOW
| DCX_INTERSECTRGN
);
583 OffsetRgn( hrgn
, xoffset
, yoffset
); /* Restore region */
586 if (ExcludeVisRect( hdc
, wndPtr
->rectClient
.left
-wndPtr
->rectWindow
.left
,
587 wndPtr
->rectClient
.top
-wndPtr
->rectWindow
.top
,
588 wndPtr
->rectClient
.right
-wndPtr
->rectWindow
.left
,
589 wndPtr
->rectClient
.bottom
-wndPtr
->rectWindow
.top
)
592 ReleaseDC( hwnd
, hdc
);
596 rect
.top
= rect
.left
= 0;
597 rect
.right
= wndPtr
->rectWindow
.right
- wndPtr
->rectWindow
.left
;
598 rect
.bottom
= wndPtr
->rectWindow
.bottom
- wndPtr
->rectWindow
.top
;
600 SelectObject( hdc
, sysColorObjects
.hpenWindowFrame
);
601 SelectObject( hdc
, active
? sysColorObjects
.hbrushActiveBorder
:
602 sysColorObjects
.hbrushInactiveBorder
);
604 if ((wndPtr
->dwStyle
& WS_BORDER
) || (wndPtr
->dwStyle
& WS_DLGFRAME
))
607 LineTo( hdc
, rect
.right
-1, 0 );
608 LineTo( hdc
, rect
.right
-1, rect
.bottom
-1 );
609 LineTo( hdc
, 0, rect
.bottom
-1 );
611 InflateRect( &rect
, -1, -1 );
614 if (HAS_DLGFRAME( wndPtr
->dwStyle
, wndPtr
->dwExStyle
))
615 NC_DrawFrame( hdc
, &rect
, TRUE
);
616 else if (wndPtr
->dwStyle
& WS_THICKFRAME
)
617 NC_DrawFrame(hdc
, &rect
, FALSE
);
619 if ((wndPtr
->dwStyle
& WS_CAPTION
) == WS_CAPTION
)
622 r
.bottom
= rect
.top
+ SYSMETRICS_CYSIZE
;
623 rect
.top
+= SYSMETRICS_CYSIZE
+ SYSMETRICS_CYBORDER
;
624 NC_DrawCaption( hdc
, &r
, hwnd
, wndPtr
->dwStyle
, active
);
627 if (HAS_MENU(wndPtr
))
630 r
.bottom
= rect
.top
+ SYSMETRICS_CYMENU
; /* default height */
631 rect
.top
+= MENU_DrawMenuBar( hdc
, &r
, (HMENU
)wndPtr
->wIDmenu
,
632 suppress_menupaint
);
635 if (wndPtr
->dwStyle
& (WS_VSCROLL
| WS_HSCROLL
)) {
636 if ((wndPtr
->dwStyle
& WS_VSCROLL
) && (wndPtr
->VScroll
!= NULL
) &&
637 (wndPtr
->scroll_flags
& 0x0001)) {
638 int bottom
= rect
.bottom
;
639 if ((wndPtr
->dwStyle
& WS_HSCROLL
) && (wndPtr
->scroll_flags
& 0x0001))
640 bottom
-= SYSMETRICS_CYHSCROLL
;
641 SetRect(&rect2
, rect
.right
- SYSMETRICS_CXVSCROLL
,
642 rect
.top
, rect
.right
, bottom
);
643 StdDrawScrollBar(hwnd
, hdc
, SB_VERT
, &rect2
, (LPHEADSCROLL
)wndPtr
->VScroll
);
645 if ((wndPtr
->dwStyle
& WS_HSCROLL
) && wndPtr
->HScroll
!= NULL
&&
646 (wndPtr
->scroll_flags
& 0x0002)) {
647 int right
= rect
.right
;
648 if ((wndPtr
->dwStyle
& WS_VSCROLL
) && (wndPtr
->scroll_flags
& 0x0001))
649 right
-= SYSMETRICS_CYVSCROLL
;
650 SetRect(&rect2
, rect
.left
, rect
.bottom
- SYSMETRICS_CYHSCROLL
,
652 StdDrawScrollBar(hwnd
, hdc
, SB_HORZ
, &rect2
, (LPHEADSCROLL
)wndPtr
->HScroll
);
655 if ((wndPtr
->dwStyle
& WS_VSCROLL
) && (wndPtr
->dwStyle
& WS_HSCROLL
) &&
656 (wndPtr
->scroll_flags
& 0x0003) == 0x0003) {
658 r
.left
= r
.right
- SYSMETRICS_CXVSCROLL
;
659 r
.top
= r
.bottom
- SYSMETRICS_CYHSCROLL
;
660 FillRect( hdc
, &r
, sysColorObjects
.hbrushScrollbar
);
664 ReleaseDC( hwnd
, hdc
);
668 NC_DoNCPaintIcon(HWND hwnd
)
670 WND
*wndPtr
= WIN_FindWndPtr(hwnd
);
679 printf("painting icon\n");
680 if (wndPtr
== NULL
) {
681 printf("argh, can't find an icon to draw\n");
684 hdc
= BeginPaint(hwnd
, &ps
);
686 ret
= DrawIcon(hdc
, 100/2 - 16, 0, wndPtr
->hIcon
);
687 printf("ret is %d\n", ret
);
689 if (s
=GetWindowText(hwnd
, buffer
, 256))
691 /*SetBkColor(hdc, TRANSPARENT); */
692 TextOut(hdc
, 0, 32, buffer
, s
);
696 printf("done painting icon\n");
701 LONG
NC_HandleNCPaintIcon( HWND hwnd
)
703 NC_DoNCPaintIcon(hwnd
);
709 /***********************************************************************
712 * Handle a WM_NCPAINT message. Called from DefWindowProc().
714 LONG
NC_HandleNCPaint( HWND hwnd
, HRGN hrgn
)
716 NC_DoNCPaint( hwnd
, hrgn
, hwnd
== GetActiveWindow(), FALSE
);
721 /***********************************************************************
722 * NC_HandleNCActivate
724 * Handle a WM_NCACTIVATE message. Called from DefWindowProc().
726 LONG
NC_HandleNCActivate( HWND hwnd
, WORD wParam
)
728 NC_DoNCPaint( hwnd
, (HRGN
)1, wParam
, FALSE
);
733 /***********************************************************************
736 * Handle a WM_SETCURSOR message. Called from DefWindowProc().
738 LONG
NC_HandleSetCursor( HWND hwnd
, WORD wParam
, LONG lParam
)
740 if (hwnd
!= wParam
) return 0; /* Don't set the cursor for child windows */
742 switch(LOWORD(lParam
))
746 WORD msg
= HIWORD( lParam
);
747 if ((msg
== WM_LBUTTONDOWN
) || (msg
== WM_MBUTTONDOWN
) ||
748 (msg
== WM_RBUTTONDOWN
))
757 if (!(wndPtr
= WIN_FindWndPtr( hwnd
))) break;
758 if (!(classPtr
= CLASS_FindClassPtr( wndPtr
->hClass
))) break;
759 if (classPtr
->wc
.hCursor
)
761 CURSOR_SetWinCursor( hwnd
, classPtr
->wc
.hCursor
);
769 CURSOR_SetWinCursor( hwnd
, LoadCursor( 0, IDC_SIZEWE
) );
774 CURSOR_SetWinCursor( hwnd
, LoadCursor( 0, IDC_SIZENS
) );
779 CURSOR_SetWinCursor( hwnd
, LoadCursor( 0, IDC_SIZENWSE
) );
784 CURSOR_SetWinCursor( hwnd
, LoadCursor( 0, IDC_SIZENESW
) );
788 /* Default cursor: arrow */
789 CURSOR_SetWinCursor( hwnd
, LoadCursor( 0, IDC_ARROW
) );
794 /***********************************************************************
797 * Initialisation of a move or resize, when initiatied from a menu choice.
798 * Return hit test code for caption or sizing border.
800 static LONG
NC_StartSizeMove( HWND hwnd
, WORD wParam
, POINT
*capturePoint
)
805 WND
* wndPtr
= WIN_FindWndPtr( hwnd
);
807 if ((wParam
& 0xfff0) == SC_MOVE
)
809 /* Move pointer at the center of the caption */
811 NC_GetInsideRect( hwnd
, &rect
);
812 if (wndPtr
->dwStyle
& WS_SYSMENU
)
813 rect
.left
+= SYSMETRICS_CXSIZE
+ 1;
814 if (wndPtr
->dwStyle
& WS_MINIMIZEBOX
)
815 rect
.right
-= SYSMETRICS_CXSIZE
+ 1;
816 if (wndPtr
->dwStyle
& WS_MAXIMIZEBOX
)
817 rect
.right
-= SYSMETRICS_CXSIZE
+ 1;
818 pt
.x
= wndPtr
->rectWindow
.left
+ (rect
.right
- rect
.left
) / 2;
819 pt
.y
= wndPtr
->rectWindow
.top
+ rect
.top
+ SYSMETRICS_CYSIZE
/2;
820 if (wndPtr
->dwStyle
& WS_CHILD
)
821 ClientToScreen( wndPtr
->hwndParent
, &pt
);
829 MSG_GetHardwareMessage( &msg
);
833 hittest
= NC_InternalNCHitTest( hwnd
, msg
.pt
);
835 if ((hittest
< HTLEFT
) || (hittest
> HTBOTTOMRIGHT
))
847 pt
.x
=(wndPtr
->rectWindow
.left
+wndPtr
->rectWindow
.right
)/2;
848 pt
.y
= wndPtr
->rectWindow
.top
+ SYSMETRICS_CYFRAME
/ 2;
852 pt
.x
=(wndPtr
->rectWindow
.left
+wndPtr
->rectWindow
.right
)/2;
853 pt
.y
= wndPtr
->rectWindow
.bottom
- SYSMETRICS_CYFRAME
/ 2;
857 pt
.x
= wndPtr
->rectWindow
.left
+ SYSMETRICS_CXFRAME
/ 2;
858 pt
.y
=(wndPtr
->rectWindow
.top
+wndPtr
->rectWindow
.bottom
)/2;
862 pt
.x
= wndPtr
->rectWindow
.right
- SYSMETRICS_CXFRAME
/ 2;
863 pt
.y
=(wndPtr
->rectWindow
.top
+wndPtr
->rectWindow
.bottom
)/2;
866 case VK_ESCAPE
: return 0;
872 SetCursorPos( capturePoint
->x
, capturePoint
->y
);
873 NC_HandleSetCursor( hwnd
, hwnd
, MAKELONG( hittest
, WM_MOUSEMOVE
));
878 /***********************************************************************
881 * Perform SC_MOVE and SC_SIZE commands.
883 static void NC_DoSizeMove( HWND hwnd
, WORD wParam
, POINT pt
)
887 RECT sizingRect
, mouseRect
;
890 POINT minTrack
, maxTrack
, capturePoint
= pt
;
891 WND
* wndPtr
= WIN_FindWndPtr( hwnd
);
893 if (IsZoomed(hwnd
) || IsIconic(hwnd
) || !IsWindowVisible(hwnd
)) return;
894 hittest
= wParam
& 0x0f;
895 thickframe
= HAS_THICKFRAME( wndPtr
->dwStyle
);
897 if ((wParam
& 0xfff0) == SC_MOVE
)
899 if (!(wndPtr
->dwStyle
& WS_CAPTION
)) return;
900 if (!hittest
) hittest
= NC_StartSizeMove( hwnd
, wParam
, &capturePoint
);
901 if (!hittest
) return;
905 if (!thickframe
) return;
906 if (hittest
) hittest
+= HTLEFT
-1;
910 hittest
= NC_StartSizeMove( hwnd
, wParam
, &capturePoint
);
919 /* Get min/max info */
921 WINPOS_GetMinMaxInfo( hwnd
, NULL
, NULL
, &minTrack
, &maxTrack
);
922 sizingRect
= wndPtr
->rectWindow
;
923 if (wndPtr
->dwStyle
& WS_CHILD
)
924 GetClientRect( wndPtr
->hwndParent
, &mouseRect
);
925 else SetRect( &mouseRect
, 0, 0, SYSMETRICS_CXSCREEN
, SYSMETRICS_CYSCREEN
);
926 if (ON_LEFT_BORDER(hittest
))
928 mouseRect
.left
= max( mouseRect
.left
, sizingRect
.right
-maxTrack
.x
);
929 mouseRect
.right
= min( mouseRect
.right
, sizingRect
.right
-minTrack
.x
);
931 else if (ON_RIGHT_BORDER(hittest
))
933 mouseRect
.left
= max( mouseRect
.left
, sizingRect
.left
+minTrack
.x
);
934 mouseRect
.right
= min( mouseRect
.right
, sizingRect
.left
+maxTrack
.x
);
936 if (ON_TOP_BORDER(hittest
))
938 mouseRect
.top
= max( mouseRect
.top
, sizingRect
.bottom
-maxTrack
.y
);
939 mouseRect
.bottom
= min( mouseRect
.bottom
,sizingRect
.bottom
-minTrack
.y
);
941 else if (ON_BOTTOM_BORDER(hittest
))
943 mouseRect
.top
= max( mouseRect
.top
, sizingRect
.top
+minTrack
.y
);
944 mouseRect
.bottom
= min( mouseRect
.bottom
, sizingRect
.top
+maxTrack
.y
);
946 SendMessage( hwnd
, WM_ENTERSIZEMOVE
, 0, 0 );
948 if (GetCapture() != hwnd
) SetCapture( hwnd
);
950 if (wndPtr
->dwStyle
& WS_CHILD
) hdc
= GetDC( wndPtr
->hwndParent
);
952 { /* Grab the server only when moving top-level windows without desktop */
954 if (rootWindow
== DefaultRootWindow(display
)) XGrabServer( display
);
956 NC_DrawMovingFrame( hdc
, &sizingRect
, thickframe
);
962 MSG_GetHardwareMessage( &msg
);
964 /* Exit on button-up, Return, or Esc */
965 if ((msg
.message
== WM_LBUTTONUP
) ||
966 ((msg
.message
== WM_KEYDOWN
) &&
967 ((msg
.wParam
== VK_RETURN
) || (msg
.wParam
== VK_ESCAPE
)))) break;
969 if ((msg
.message
!= WM_KEYDOWN
) && (msg
.message
!= WM_MOUSEMOVE
))
970 continue; /* We are not interested in other messages */
973 if (wndPtr
->dwStyle
& WS_CHILD
)
974 ScreenToClient( wndPtr
->hwndParent
, &pt
);
977 if (msg
.message
== WM_KEYDOWN
) switch(msg
.wParam
)
979 case VK_UP
: pt
.y
-= 8; break;
980 case VK_DOWN
: pt
.y
+= 8; break;
981 case VK_LEFT
: pt
.x
-= 8; break;
982 case VK_RIGHT
: pt
.x
+= 8; break;
985 pt
.x
= max( pt
.x
, mouseRect
.left
);
986 pt
.x
= min( pt
.x
, mouseRect
.right
);
987 pt
.y
= max( pt
.y
, mouseRect
.top
);
988 pt
.y
= min( pt
.y
, mouseRect
.bottom
);
990 dx
= pt
.x
- capturePoint
.x
;
991 dy
= pt
.y
- capturePoint
.y
;
995 if (msg
.message
== WM_KEYDOWN
) SetCursorPos( pt
.x
, pt
.y
);
998 RECT newRect
= sizingRect
;
1000 if (hittest
== HTCAPTION
) OffsetRect( &newRect
, dx
, dy
);
1001 if (ON_LEFT_BORDER(hittest
)) newRect
.left
+= dx
;
1002 else if (ON_RIGHT_BORDER(hittest
)) newRect
.right
+= dx
;
1003 if (ON_TOP_BORDER(hittest
)) newRect
.top
+= dy
;
1004 else if (ON_BOTTOM_BORDER(hittest
)) newRect
.bottom
+= dy
;
1005 NC_DrawMovingFrame( hdc
, &sizingRect
, thickframe
);
1006 NC_DrawMovingFrame( hdc
, &newRect
, thickframe
);
1008 sizingRect
= newRect
;
1013 NC_DrawMovingFrame( hdc
, &sizingRect
, thickframe
);
1015 if (wndPtr
->dwStyle
& WS_CHILD
) ReleaseDC( wndPtr
->hwndParent
, hdc
);
1018 ReleaseDC( 0, hdc
);
1019 if (rootWindow
== DefaultRootWindow(display
)) XUngrabServer( display
);
1021 SendMessage( hwnd
, WM_EXITSIZEMOVE
, 0, 0 );
1023 /* If Esc key, don't move the window */
1024 if ((msg
.message
== WM_KEYDOWN
) && (msg
.wParam
== VK_ESCAPE
)) return;
1026 if (hittest
!= HTCAPTION
)
1027 SetWindowPos( hwnd
, 0, sizingRect
.left
, sizingRect
.top
,
1028 sizingRect
.right
- sizingRect
.left
,
1029 sizingRect
.bottom
- sizingRect
.top
,
1030 SWP_NOACTIVATE
| SWP_NOZORDER
);
1031 else SetWindowPos( hwnd
, 0, sizingRect
.left
, sizingRect
.top
, 0, 0,
1032 SWP_NOACTIVATE
| SWP_NOSIZE
| SWP_NOZORDER
);
1036 /***********************************************************************
1039 * Track a mouse button press on the minimize or maximize box.
1041 static void NC_TrackMinMaxBox( HWND hwnd
, WORD wParam
)
1044 HDC hdc
= GetWindowDC( hwnd
);
1045 BOOL pressed
= TRUE
;
1048 if (wParam
== HTMINBUTTON
) NC_DrawMinButton( hwnd
, hdc
, TRUE
);
1049 else NC_DrawMaxButton( hwnd
, hdc
, TRUE
);
1053 BOOL oldstate
= pressed
;
1054 MSG_GetHardwareMessage( &msg
);
1056 pressed
= (NC_InternalNCHitTest( hwnd
, msg
.pt
) == wParam
);
1057 if (pressed
!= oldstate
)
1059 if (wParam
== HTMINBUTTON
) NC_DrawMinButton( hwnd
, hdc
, pressed
);
1060 else NC_DrawMaxButton( hwnd
, hdc
, pressed
);
1062 } while (msg
.message
!= WM_LBUTTONUP
);
1064 if (wParam
== HTMINBUTTON
) NC_DrawMinButton( hwnd
, hdc
, FALSE
);
1065 else NC_DrawMaxButton( hwnd
, hdc
, FALSE
);
1068 ReleaseDC( hwnd
, hdc
);
1069 if (!pressed
) return;
1071 if (wParam
== HTMINBUTTON
)
1072 SendMessage( hwnd
, WM_SYSCOMMAND
, SC_MINIMIZE
, *(LONG
*)&msg
.pt
);
1074 SendMessage( hwnd
, WM_SYSCOMMAND
,
1075 IsZoomed(hwnd
) ? SC_RESTORE
: SC_MAXIMIZE
, *(LONG
*)&msg
.pt
);
1079 /***********************************************************************
1082 * Track a mouse button press on the horizontal or vertical scroll-bar.
1084 static void NC_TrackScrollBar( HWND hwnd
, WORD wParam
, POINT pt
)
1088 if ((wParam
& 0xfff0) == SC_HSCROLL
)
1090 if ((wParam
& 0x0f) != HTHSCROLL
) return;
1091 scrollbar
= SB_HORZ
;
1093 else /* SC_VSCROLL */
1095 if ((wParam
& 0x0f) != HTVSCROLL
) return;
1096 scrollbar
= SB_VERT
;
1099 ScreenToClient( hwnd
, &pt
);
1100 ScrollBarButtonDown( hwnd
, scrollbar
, pt
.x
, pt
.y
);
1105 MSG_GetHardwareMessage( &msg
);
1106 ScreenToClient( msg
.hwnd
, &msg
.pt
);
1110 ScrollBarButtonUp( hwnd
, scrollbar
, msg
.pt
.x
, msg
.pt
.y
);
1113 ScrollBarMouseMove(hwnd
, scrollbar
, msg
.wParam
, msg
.pt
.x
,msg
.pt
.y
);
1116 } while (msg
.message
!= WM_LBUTTONUP
);
1120 /***********************************************************************
1123 * Track a mouse button press on the system menu.
1125 static void NC_TrackSysMenu( HWND hwnd
, HDC hdc
, POINT pt
)
1128 WND
*wndPtr
= WIN_FindWndPtr( hwnd
);
1130 if (!(wndPtr
->dwStyle
& WS_SYSMENU
)) return;
1131 /* If window has a menu, track the menu bar normally */
1132 if (HAS_MENU(wndPtr
)) MENU_TrackMouseMenuBar( hwnd
, pt
);
1135 /* Otherwise track the system menu like a normal popup menu */
1136 NC_GetInsideRect( hwnd
, &rect
);
1137 OffsetRect( &rect
, wndPtr
->rectWindow
.left
, wndPtr
->rectWindow
.top
);
1138 if (wndPtr
->dwStyle
& WS_CHILD
)
1139 ClientToScreen( wndPtr
->hwndParent
, (POINT
*)&rect
);
1140 rect
.right
= rect
.left
+ SYSMETRICS_CXSIZE
;
1141 rect
.bottom
= rect
.top
+ SYSMETRICS_CYSIZE
;
1142 NC_DrawSysButton( hwnd
, hdc
, TRUE
);
1143 TrackPopupMenu( wndPtr
->hSysMenu
, TPM_LEFTALIGN
| TPM_LEFTBUTTON
,
1144 rect
.left
, rect
.bottom
, 0, hwnd
, &rect
);
1145 NC_DrawSysButton( hwnd
, hdc
, FALSE
);
1150 /***********************************************************************
1151 * NC_HandleNCLButtonDown
1153 * Handle a WM_NCLBUTTONDOWN message. Called from DefWindowProc().
1155 LONG
NC_HandleNCLButtonDown( HWND hwnd
, WORD wParam
, LONG lParam
)
1157 HDC hdc
= GetWindowDC( hwnd
);
1159 switch(wParam
) /* Hit test */
1162 SendMessage( hwnd
, WM_SYSCOMMAND
, SC_MOVE
+ HTCAPTION
, lParam
);
1166 NC_TrackSysMenu( hwnd
, hdc
, MAKEPOINT(lParam
) );
1170 SendMessage( hwnd
, WM_SYSCOMMAND
, SC_MOUSEMENU
, lParam
);
1174 SendMessage( hwnd
, WM_SYSCOMMAND
, SC_HSCROLL
+ HTHSCROLL
, lParam
);
1178 SendMessage( hwnd
, WM_SYSCOMMAND
, SC_VSCROLL
+ HTVSCROLL
, lParam
);
1183 NC_TrackMinMaxBox( hwnd
, wParam
);
1194 SendMessage( hwnd
, WM_SYSCOMMAND
, SC_SIZE
+ wParam
- HTLEFT
+1, lParam
);
1201 ReleaseDC( hwnd
, hdc
);
1206 /***********************************************************************
1207 * NC_HandleNCLButtonDblClk
1209 * Handle a WM_NCLBUTTONDBLCLK message. Called from DefWindowProc().
1211 LONG
NC_HandleNCLButtonDblClk( HWND hwnd
, WORD wParam
, LONG lParam
)
1213 switch(wParam
) /* Hit test */
1216 SendMessage( hwnd
, WM_SYSCOMMAND
, SC_MAXIMIZE
, lParam
);
1220 SendMessage( hwnd
, WM_SYSCOMMAND
, SC_CLOSE
, lParam
);
1227 /***********************************************************************
1228 * NC_HandleSysCommand
1230 * Handle a WM_SYSCOMMAND message. Called from DefWindowProc().
1232 LONG
NC_HandleSysCommand( HWND hwnd
, WORD wParam
, POINT pt
)
1234 WND
*wndPtr
= WIN_FindWndPtr( hwnd
);
1236 #ifdef DEBUG_NONCLIENT
1237 printf( "Handling WM_SYSCOMMAND %x %d,%d\n", wParam
, pt
.x
, pt
.y
);
1240 if (wndPtr
->dwStyle
& WS_CHILD
) ScreenToClient( wndPtr
->hwndParent
, &pt
);
1242 switch (wParam
& 0xfff0)
1246 NC_DoSizeMove( hwnd
, wParam
, pt
);
1250 ICON_Iconify( hwnd
);
1251 /*ShowWindow( hwnd, SW_MINIMIZE );*/
1255 ShowWindow( hwnd
, SW_MAXIMIZE
);
1259 ICON_Deiconify(hwnd
);
1260 ShowWindow( hwnd
, SW_RESTORE
);
1268 return SendMessage( hwnd
, WM_CLOSE
, 0, 0 );
1272 if (wndPtr
->dwStyle
& WS_CHILD
) ClientToScreen(wndPtr
->hwndParent
, &pt
);
1273 NC_TrackScrollBar( hwnd
, wParam
, pt
);
1277 MENU_TrackMouseMenuBar( hwnd
, pt
);
1281 MENU_TrackKbdMenuBar( hwnd
, wParam
);
1288 /* WinExec( "taskman.exe", SW_SHOWNORMAL ); */
1295 if (wParam
== SC_ABOUTWINE
)
1296 DialogBox( hSysRes
, MAKEINTRESOURCE(2),
1297 hwnd
, (FARPROC
)AboutWine_Proc
);