Release 20000326.
[wine/wine-kai.git] / windows / defwnd.c
blob045aae94f5c1fb3c4687c30e32e3533f21f547ab
1 /*
2 * Default window procedure
4 * Copyright 1993, 1996 Alexandre Julliard
5 * 1995 Alex Korobka
6 */
8 #include <string.h>
10 #include "class.h"
11 #include "win.h"
12 #include "user.h"
13 #include "heap.h"
14 #include "nonclient.h"
15 #include "winpos.h"
16 #include "dce.h"
17 #include "debugtools.h"
18 #include "spy.h"
19 #include "tweak.h"
20 #include "cache.h"
21 #include "windef.h"
22 #include "wingdi.h"
23 #include "wine/winuser16.h"
25 DEFAULT_DEBUG_CHANNEL(win)
27 /* bits in the dwKeyData */
28 #define KEYDATA_ALT 0x2000
29 #define KEYDATA_PREVSTATE 0x4000
31 static short iF10Key = 0;
32 static short iMenuSysKey = 0;
34 /***********************************************************************
35 * DEFWND_HandleWindowPosChanged
37 * Handle the WM_WINDOWPOSCHANGED message.
39 static void DEFWND_HandleWindowPosChanged( WND *wndPtr, UINT flags )
41 WPARAM16 wp = SIZE_RESTORED;
43 if (!(flags & SWP_NOCLIENTMOVE))
44 SendMessage16( wndPtr->hwndSelf, WM_MOVE, 0,
45 MAKELONG(wndPtr->rectClient.left, wndPtr->rectClient.top));
46 if (!(flags & SWP_NOCLIENTSIZE))
48 if (wndPtr->dwStyle & WS_MAXIMIZE) wp = SIZE_MAXIMIZED;
49 else if (wndPtr->dwStyle & WS_MINIMIZE) wp = SIZE_MINIMIZED;
51 SendMessage16( wndPtr->hwndSelf, WM_SIZE, wp,
52 MAKELONG(wndPtr->rectClient.right-wndPtr->rectClient.left,
53 wndPtr->rectClient.bottom-wndPtr->rectClient.top));
58 /***********************************************************************
59 * DEFWND_SetText
61 * Set the window text.
63 void DEFWND_SetText( WND *wndPtr, LPCSTR text )
65 if (!text) text = "";
66 if (wndPtr->text) HeapFree( SystemHeap, 0, wndPtr->text );
67 wndPtr->text = HEAP_strdupA( SystemHeap, 0, text );
68 wndPtr->pDriver->pSetText(wndPtr, wndPtr->text);
71 /***********************************************************************
72 * DEFWND_ControlColor
74 * Default colors for control painting.
76 HBRUSH DEFWND_ControlColor( HDC hDC, UINT16 ctlType )
78 if( ctlType == CTLCOLOR_SCROLLBAR)
80 HBRUSH hb = GetSysColorBrush(COLOR_SCROLLBAR);
81 if (TWEAK_WineLook == WIN31_LOOK) {
82 SetTextColor( hDC, RGB(0, 0, 0) );
83 SetBkColor( hDC, RGB(255, 255, 255) );
84 } else {
85 COLORREF bk = GetSysColor(COLOR_3DHILIGHT);
86 SetTextColor( hDC, GetSysColor(COLOR_3DFACE));
87 SetBkColor( hDC, bk);
89 /* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT
90 * we better use 0x55aa bitmap brush to make scrollbar's background
91 * look different from the window background.
93 if (bk == GetSysColor(COLOR_WINDOW)) {
94 return CACHE_GetPattern55AABrush();
97 UnrealizeObject( hb );
98 return hb;
101 SetTextColor( hDC, GetSysColor(COLOR_WINDOWTEXT));
103 if (TWEAK_WineLook > WIN31_LOOK) {
104 if ((ctlType == CTLCOLOR_EDIT) || (ctlType == CTLCOLOR_LISTBOX))
105 SetBkColor( hDC, GetSysColor(COLOR_WINDOW) );
106 else {
107 SetBkColor( hDC, GetSysColor(COLOR_3DFACE) );
108 return GetSysColorBrush(COLOR_3DFACE);
111 else
112 SetBkColor( hDC, GetSysColor(COLOR_WINDOW) );
113 return GetSysColorBrush(COLOR_WINDOW);
117 /***********************************************************************
118 * DEFWND_SetRedraw
120 static void DEFWND_SetRedraw( WND* wndPtr, WPARAM wParam )
122 BOOL bVisible = wndPtr->dwStyle & WS_VISIBLE;
124 TRACE("%04x %i\n", wndPtr->hwndSelf, (wParam!=0) );
126 if( wParam )
128 if( !bVisible )
130 wndPtr->dwStyle |= WS_VISIBLE;
131 DCE_InvalidateDCE( wndPtr, &wndPtr->rectWindow );
134 else if( bVisible )
136 if( wndPtr->dwStyle & WS_MINIMIZE ) wParam = RDW_VALIDATE;
137 else wParam = RDW_ALLCHILDREN | RDW_VALIDATE;
139 PAINT_RedrawWindow( wndPtr->hwndSelf, NULL, 0, wParam, 0 );
140 DCE_InvalidateDCE( wndPtr, &wndPtr->rectWindow );
141 wndPtr->dwStyle &= ~WS_VISIBLE;
145 /***********************************************************************
146 * DEFWND_Print
148 * This method handles the default behavior for the WM_PRINT message.
150 static void DEFWND_Print(
151 WND* wndPtr,
152 HDC hdc,
153 ULONG uFlags)
156 * Visibility flag.
158 if ( (uFlags & PRF_CHECKVISIBLE) &&
159 !IsWindowVisible(wndPtr->hwndSelf) )
160 return;
163 * Unimplemented flags.
165 if ( (uFlags & PRF_CHILDREN) ||
166 (uFlags & PRF_OWNED) ||
167 (uFlags & PRF_NONCLIENT) )
169 WARN("WM_PRINT message with unsupported flags\n");
173 * Background
175 if ( uFlags & PRF_ERASEBKGND)
176 SendMessageA(wndPtr->hwndSelf, WM_ERASEBKGND, (WPARAM)hdc, 0);
179 * Client area
181 if ( uFlags & PRF_CLIENT)
182 SendMessageA(wndPtr->hwndSelf, WM_PRINTCLIENT, (WPARAM)hdc, PRF_CLIENT);
185 /***********************************************************************
186 * DEFWND_DefWinProc
188 * Default window procedure for messages that are the same in Win16 and Win32.
190 static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
191 LPARAM lParam )
193 switch(msg)
195 case WM_NCPAINT:
196 return NC_HandleNCPaint( wndPtr->hwndSelf, (HRGN)wParam );
198 case WM_NCHITTEST:
199 return NC_HandleNCHitTest( wndPtr->hwndSelf, MAKEPOINT16(lParam) );
201 case WM_NCLBUTTONDOWN:
202 return NC_HandleNCLButtonDown( wndPtr, wParam, lParam );
204 case WM_LBUTTONDBLCLK:
205 case WM_NCLBUTTONDBLCLK:
206 return NC_HandleNCLButtonDblClk( wndPtr, wParam, lParam );
208 case WM_RBUTTONUP:
209 case WM_NCRBUTTONUP:
210 if ((wndPtr->flags & WIN_ISWIN32) || (TWEAK_WineLook > WIN31_LOOK))
212 ClientToScreen16(wndPtr->hwndSelf, (LPPOINT16)&lParam);
213 SendMessageA( wndPtr->hwndSelf, WM_CONTEXTMENU,
214 wndPtr->hwndSelf, lParam);
216 break;
218 case WM_CONTEXTMENU:
219 if( wndPtr->dwStyle & WS_CHILD )
220 SendMessageA( wndPtr->parent->hwndSelf, msg, wParam, lParam );
221 else if (wndPtr->hSysMenu)
223 LONG hitcode;
224 POINT16 pt = MAKEPOINT16(lParam);
226 ScreenToClient16(wndPtr->hwndSelf, &pt);
227 hitcode = NC_HandleNCHitTest(wndPtr->hwndSelf, pt);
229 /* Track system popup if click was in the caption area. */
230 if (hitcode==HTCAPTION || hitcode==HTSYSMENU)
231 TrackPopupMenu(GetSystemMenu(wndPtr->hwndSelf, FALSE),
232 TPM_LEFTBUTTON | TPM_RIGHTBUTTON,
233 pt.x, pt.y, 0, wndPtr->hwndSelf, NULL);
235 break;
237 case WM_NCACTIVATE:
238 return NC_HandleNCActivate( wndPtr, wParam );
240 case WM_NCDESTROY:
241 if (wndPtr->text) HeapFree( SystemHeap, 0, wndPtr->text );
242 wndPtr->text = NULL;
243 if (wndPtr->pVScroll) HeapFree( SystemHeap, 0, wndPtr->pVScroll );
244 if (wndPtr->pHScroll) HeapFree( SystemHeap, 0, wndPtr->pHScroll );
245 wndPtr->pVScroll = wndPtr->pHScroll = NULL;
246 return 0;
248 case WM_PRINT:
249 DEFWND_Print(wndPtr, (HDC)wParam, lParam);
250 return 0;
252 case WM_PAINTICON:
253 case WM_PAINT:
255 PAINTSTRUCT16 ps;
256 HDC16 hdc = BeginPaint16( wndPtr->hwndSelf, &ps );
257 if( hdc )
259 if( (wndPtr->dwStyle & WS_MINIMIZE) && wndPtr->class->hIcon )
261 int x = (wndPtr->rectWindow.right - wndPtr->rectWindow.left -
262 GetSystemMetrics(SM_CXICON))/2;
263 int y = (wndPtr->rectWindow.bottom - wndPtr->rectWindow.top -
264 GetSystemMetrics(SM_CYICON))/2;
265 TRACE("Painting class icon: vis rect=(%i,%i - %i,%i)\n",
266 ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom );
267 DrawIcon( hdc, x, y, wndPtr->class->hIcon );
269 EndPaint16( wndPtr->hwndSelf, &ps );
271 return 0;
274 case WM_SETREDRAW:
275 DEFWND_SetRedraw( wndPtr, wParam );
276 return 0;
278 case WM_CLOSE:
279 DestroyWindow( wndPtr->hwndSelf );
280 return 0;
282 case WM_MOUSEACTIVATE:
283 if (wndPtr->dwStyle & WS_CHILD)
285 LONG ret = SendMessage16( wndPtr->parent->hwndSelf,
286 WM_MOUSEACTIVATE, wParam, lParam );
287 if (ret) return ret;
290 /* Caption clicks are handled by the NC_HandleNCLButtonDown() */
291 return (LOWORD(lParam) >= HTCLIENT) ? MA_ACTIVATE : MA_NOACTIVATE;
293 case WM_ACTIVATE:
294 /* The default action in Windows is to set the keyboard focus to
295 * the window, if it's being activated and not minimized */
296 if (LOWORD(wParam) != WA_INACTIVE) {
297 /* I don't know who put this SetWindowPos here, it does not
298 * seem very logical to have it here... (FIXME?) */
299 SetWindowPos(wndPtr->hwndSelf, HWND_TOP, 0, 0, 0, 0,
300 SWP_NOMOVE | SWP_NOSIZE);
301 if (!(wndPtr->dwStyle & WS_MINIMIZE))
302 SetFocus(wndPtr->hwndSelf);
304 break;
306 case WM_ERASEBKGND:
307 case WM_ICONERASEBKGND:
309 RECT rect;
311 if (!wndPtr->class->hbrBackground) return 0;
313 /* Since WM_ERASEBKGND may receive either a window dc or a */
314 /* client dc, the area to be erased has to be retrieved from */
315 /* the device context. */
316 GetClipBox( (HDC)wParam, &rect );
318 /* Always call the Win32 variant of FillRect even on Win16,
319 * since despite the fact that Win16, as well as Win32,
320 * supports special background brushes for a window class,
321 * the Win16 variant of FillRect does not.
323 FillRect( (HDC) wParam, &rect, wndPtr->class->hbrBackground);
324 return 1;
327 case WM_GETDLGCODE:
328 return 0;
330 case WM_CTLCOLORMSGBOX:
331 case WM_CTLCOLOREDIT:
332 case WM_CTLCOLORLISTBOX:
333 case WM_CTLCOLORBTN:
334 case WM_CTLCOLORDLG:
335 case WM_CTLCOLORSTATIC:
336 case WM_CTLCOLORSCROLLBAR:
337 return (LRESULT)DEFWND_ControlColor( (HDC)wParam, msg - WM_CTLCOLORMSGBOX );
339 case WM_CTLCOLOR:
340 return (LRESULT)DEFWND_ControlColor( (HDC)wParam, HIWORD(lParam) );
342 case WM_GETTEXTLENGTH:
343 if (wndPtr->text) return (LRESULT)strlen(wndPtr->text);
344 return 0;
346 case WM_SETCURSOR:
347 if (wndPtr->dwStyle & WS_CHILD)
348 if (SendMessage16(wndPtr->parent->hwndSelf, WM_SETCURSOR,
349 wParam, lParam))
350 return TRUE;
351 return NC_HandleSetCursor( wndPtr->hwndSelf, wParam, lParam );
353 case WM_SYSCOMMAND:
354 return NC_HandleSysCommand( wndPtr->hwndSelf, wParam,
355 MAKEPOINT16(lParam) );
357 case WM_KEYDOWN:
358 if(wParam == VK_F10) iF10Key = VK_F10;
359 break;
361 case WM_SYSKEYDOWN:
362 if( HIWORD(lParam) & KEYDATA_ALT )
364 /* if( HIWORD(lParam) & ~KEYDATA_PREVSTATE ) */
365 if( wParam == VK_MENU && !iMenuSysKey )
366 iMenuSysKey = 1;
367 else
368 iMenuSysKey = 0;
370 iF10Key = 0;
372 if( wParam == VK_F4 ) /* try to close the window */
374 HWND hWnd = WIN_GetTopParent( wndPtr->hwndSelf );
375 wndPtr = WIN_FindWndPtr( hWnd );
376 if( wndPtr && !(wndPtr->class->style & CS_NOCLOSE) )
377 PostMessage16( hWnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
378 WIN_ReleaseWndPtr(wndPtr);
381 else if( wParam == VK_F10 )
382 iF10Key = 1;
383 else
384 if( wParam == VK_ESCAPE && (GetKeyState(VK_SHIFT) & 0x8000))
385 SendMessage16( wndPtr->hwndSelf, WM_SYSCOMMAND,
386 (WPARAM16)SC_KEYMENU, (LPARAM)VK_SPACE);
387 break;
389 case WM_KEYUP:
390 case WM_SYSKEYUP:
391 /* Press and release F10 or ALT */
392 if (((wParam == VK_MENU) && iMenuSysKey) ||
393 ((wParam == VK_F10) && iF10Key))
394 SendMessage16( WIN_GetTopParent(wndPtr->hwndSelf),
395 WM_SYSCOMMAND, SC_KEYMENU, 0L );
396 iMenuSysKey = iF10Key = 0;
397 break;
399 case WM_SYSCHAR:
400 iMenuSysKey = 0;
401 if (wParam == VK_RETURN && (wndPtr->dwStyle & WS_MINIMIZE))
403 PostMessage16( wndPtr->hwndSelf, WM_SYSCOMMAND,
404 (WPARAM16)SC_RESTORE, 0L );
405 break;
407 if ((HIWORD(lParam) & KEYDATA_ALT) && wParam)
409 if (wParam == VK_TAB || wParam == VK_ESCAPE) break;
410 if (wParam == VK_SPACE && (wndPtr->dwStyle & WS_CHILD))
411 SendMessage16( wndPtr->parent->hwndSelf, msg, wParam, lParam );
412 else
413 SendMessage16( wndPtr->hwndSelf, WM_SYSCOMMAND,
414 (WPARAM16)SC_KEYMENU, (LPARAM)(DWORD)wParam );
416 else /* check for Ctrl-Esc */
417 if (wParam != VK_ESCAPE) MessageBeep(0);
418 break;
420 case WM_SHOWWINDOW:
421 if (!lParam) return 0; /* sent from ShowWindow */
422 if (!(wndPtr->dwStyle & WS_POPUP) || !wndPtr->owner) return 0;
423 if ((wndPtr->dwStyle & WS_VISIBLE) && wParam) return 0;
424 else if (!(wndPtr->dwStyle & WS_VISIBLE) && !wParam) return 0;
425 ShowWindow( wndPtr->hwndSelf, wParam ? SW_SHOWNOACTIVATE : SW_HIDE );
426 break;
428 case WM_CANCELMODE:
429 if (wndPtr->parent == WIN_GetDesktop()) EndMenu();
430 if (GetCapture() == wndPtr->hwndSelf) ReleaseCapture();
431 WIN_ReleaseDesktop();
432 break;
434 case WM_VKEYTOITEM:
435 case WM_CHARTOITEM:
436 return -1;
438 case WM_DROPOBJECT:
439 return DRAG_FILE;
441 case WM_QUERYDROPOBJECT:
442 if (wndPtr->dwExStyle & WS_EX_ACCEPTFILES) return 1;
443 break;
445 case WM_QUERYDRAGICON:
447 HICON16 hIcon=0;
448 UINT16 len;
450 if( (hIcon=wndPtr->class->hCursor) ) return (LRESULT)hIcon;
451 for(len=1; len<64; len++)
452 if((hIcon=LoadIcon16(wndPtr->hInstance,MAKEINTRESOURCE16(len))))
453 return (LRESULT)hIcon;
454 return (LRESULT)LoadIcon16(0,IDI_APPLICATION16);
456 break;
458 case WM_ISACTIVEICON:
459 return ((wndPtr->flags & WIN_NCACTIVATED) != 0);
461 case WM_NOTIFYFORMAT:
462 if (IsWindowUnicode(wndPtr->hwndSelf)) return NFR_UNICODE;
463 else return NFR_ANSI;
465 case WM_QUERYOPEN:
466 case WM_QUERYENDSESSION:
467 return 1;
469 case WM_SETICON:
470 case WM_GETICON:
472 LRESULT result = 0;
473 int index = GCL_HICON;
475 if (wParam == ICON_SMALL)
476 index = GCL_HICONSM;
478 result = GetClassLongA(wndPtr->hwndSelf, index);
480 if (msg == WM_SETICON)
481 SetClassLongA(wndPtr->hwndSelf, index, lParam);
483 return result;
485 case WM_HELP:
486 SendMessageA( wndPtr->parent->hwndSelf, msg, wParam, lParam );
487 break;
490 return 0;
495 /***********************************************************************
496 * DefWindowProc16 (USER.107)
498 LRESULT WINAPI DefWindowProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
499 LPARAM lParam )
501 WND * wndPtr = WIN_FindWndPtr( hwnd );
502 LRESULT result = 0;
504 if (!wndPtr) return 0;
505 SPY_EnterMessage( SPY_DEFWNDPROC16, hwnd, msg, wParam, lParam );
507 switch(msg)
509 case WM_NCCREATE:
511 CREATESTRUCT16 *cs = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
512 if (cs->lpszName)
513 DEFWND_SetText( wndPtr, (LPSTR)PTR_SEG_TO_LIN(cs->lpszName) );
514 result = 1;
516 break;
518 case WM_NCCALCSIZE:
520 RECT rect32;
521 CONV_RECT16TO32( (RECT16 *)PTR_SEG_TO_LIN(lParam), &rect32 );
522 result = NC_HandleNCCalcSize( wndPtr, &rect32 );
523 CONV_RECT32TO16( &rect32, (RECT16 *)PTR_SEG_TO_LIN(lParam) );
525 break;
527 case WM_WINDOWPOSCHANGING:
528 result = WINPOS_HandleWindowPosChanging16( wndPtr,
529 (WINDOWPOS16 *)PTR_SEG_TO_LIN(lParam) );
530 break;
532 case WM_WINDOWPOSCHANGED:
534 WINDOWPOS16 * winPos = (WINDOWPOS16 *)PTR_SEG_TO_LIN(lParam);
535 DEFWND_HandleWindowPosChanged( wndPtr, winPos->flags );
537 break;
539 case WM_GETTEXT:
540 if (wParam && wndPtr->text)
542 lstrcpynA( (LPSTR)PTR_SEG_TO_LIN(lParam), wndPtr->text, wParam );
543 result = (LRESULT)strlen( (LPSTR)PTR_SEG_TO_LIN(lParam) );
545 break;
547 case WM_SETTEXT:
548 DEFWND_SetText( wndPtr, (LPSTR)PTR_SEG_TO_LIN(lParam) );
549 if( wndPtr->dwStyle & WS_CAPTION ) NC_HandleNCPaint( hwnd , (HRGN)1 );
550 break;
552 default:
553 result = DEFWND_DefWinProc( wndPtr, msg, wParam, lParam );
554 break;
557 WIN_ReleaseWndPtr(wndPtr);
558 SPY_ExitMessage( SPY_RESULT_DEFWND16, hwnd, msg, result );
559 return result;
563 /***********************************************************************
564 * DefWindowProc32A [USER32.126]
567 LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam,
568 LPARAM lParam )
570 WND * wndPtr = WIN_FindWndPtr( hwnd );
571 LRESULT result = 0;
573 if (!wndPtr) return 0;
574 SPY_EnterMessage( SPY_DEFWNDPROC, hwnd, msg, wParam, lParam );
576 switch(msg)
578 case WM_NCCREATE:
580 CREATESTRUCTA *cs = (CREATESTRUCTA *)lParam;
581 if (cs->lpszName) DEFWND_SetText( wndPtr, cs->lpszName );
582 result = 1;
584 break;
586 case WM_NCCALCSIZE:
587 result = NC_HandleNCCalcSize( wndPtr, (RECT *)lParam );
588 break;
590 case WM_WINDOWPOSCHANGING:
591 result = WINPOS_HandleWindowPosChanging( wndPtr,
592 (WINDOWPOS *)lParam );
593 break;
595 case WM_WINDOWPOSCHANGED:
597 WINDOWPOS * winPos = (WINDOWPOS *)lParam;
598 DEFWND_HandleWindowPosChanged( wndPtr, winPos->flags );
600 break;
602 case WM_GETTEXT:
603 if (wParam && wndPtr->text)
605 lstrcpynA( (LPSTR)lParam, wndPtr->text, wParam );
606 result = (LRESULT)strlen( (LPSTR)lParam );
608 break;
610 case WM_SETTEXT:
611 DEFWND_SetText( wndPtr, (LPSTR)lParam );
612 NC_HandleNCPaint( hwnd , (HRGN)1 ); /* Repaint caption */
613 break;
615 default:
616 result = DEFWND_DefWinProc( wndPtr, msg, wParam, lParam );
617 break;
620 WIN_ReleaseWndPtr(wndPtr);
621 SPY_ExitMessage( SPY_RESULT_DEFWND, hwnd, msg, result );
622 return result;
626 /***********************************************************************
627 * DefWindowProc32W [USER32.127] Calls default window message handler
629 * Calls default window procedure for messages not processed
630 * by application.
632 * RETURNS
633 * Return value is dependent upon the message.
635 LRESULT WINAPI DefWindowProcW(
636 HWND hwnd, /* [in] window procedure recieving message */
637 UINT msg, /* [in] message identifier */
638 WPARAM wParam, /* [in] first message parameter */
639 LPARAM lParam ) /* [in] second message parameter */
641 LRESULT result;
643 switch(msg)
645 case WM_NCCREATE:
647 CREATESTRUCTW *cs = (CREATESTRUCTW *)lParam;
648 if (cs->lpszName)
650 WND *wndPtr = WIN_FindWndPtr( hwnd );
651 LPSTR str = HEAP_strdupWtoA(GetProcessHeap(), 0, cs->lpszName);
652 DEFWND_SetText( wndPtr, str );
653 HeapFree( GetProcessHeap(), 0, str );
654 WIN_ReleaseWndPtr(wndPtr);
656 result = 1;
658 break;
660 case WM_GETTEXT:
662 LPSTR str = HeapAlloc( GetProcessHeap(), 0, wParam );
663 result = DefWindowProcA( hwnd, msg, wParam, (LPARAM)str );
664 lstrcpynAtoW( (LPWSTR)lParam, str, wParam );
665 HeapFree( GetProcessHeap(), 0, str );
667 break;
669 case WM_SETTEXT:
671 LPSTR str = HEAP_strdupWtoA( GetProcessHeap(), 0, (LPWSTR)lParam );
672 result = DefWindowProcA( hwnd, msg, wParam, (LPARAM)str );
673 HeapFree( GetProcessHeap(), 0, str );
675 break;
677 default:
678 result = DefWindowProcA( hwnd, msg, wParam, lParam );
679 break;
681 return result;