Moved most files from the windows directory to dlls/user.

This commit is contained in:
Alexandre Julliard 2005-04-25 11:33:34 +00:00
parent 3abb5bd6bb
commit 172e731c0b
16 changed files with 1660 additions and 1658 deletions

View File

@ -15,56 +15,56 @@ SPEC_SRCS16 = \
user.exe.spec
C_SRCS = \
$(TOPOBJDIR)/windows/class.c \
$(TOPOBJDIR)/windows/clipboard.c \
$(TOPOBJDIR)/windows/cursoricon.c \
$(TOPOBJDIR)/windows/defdlg.c \
$(TOPOBJDIR)/windows/defwnd.c \
$(TOPOBJDIR)/windows/dialog.c \
$(TOPOBJDIR)/windows/driver.c \
$(TOPOBJDIR)/windows/input.c \
$(TOPOBJDIR)/windows/mdi.c \
$(TOPOBJDIR)/windows/msgbox.c \
$(TOPOBJDIR)/windows/multimon.c \
$(TOPOBJDIR)/windows/nonclient.c \
$(TOPOBJDIR)/windows/queue.c \
$(TOPOBJDIR)/windows/scroll.c \
$(TOPOBJDIR)/windows/spy.c \
$(TOPOBJDIR)/windows/syscolor.c \
$(TOPOBJDIR)/windows/user.c \
$(TOPOBJDIR)/windows/win.c \
$(TOPOBJDIR)/windows/winhelp.c \
$(TOPOBJDIR)/windows/winpos.c \
$(TOPOBJDIR)/windows/winproc.c \
button.c \
caret.c \
class.c \
clipboard.c \
combo.c \
cursoricon.c \
dde/client.c \
dde/ddeml16.c \
dde/misc.c \
dde/server.c \
defdlg.c \
defwnd.c \
desktop.c \
dialog.c \
dialog16.c \
edit.c \
exticon.c \
focus.c \
hook.c \
icontitle.c \
input.c \
listbox.c \
lstr.c \
mdi.c \
menu.c \
message.c \
misc.c \
msg16.c \
msgbox.c \
nonclient.c \
painting.c \
property.c \
resource.c \
scroll.c \
spy.c \
static.c \
sysparams.c \
text.c \
uitools.c \
user_main.c \
win.c \
winhelp.c \
winpos.c \
winproc.c \
wsprintf.c
C_SRCS16 = \

View File

@ -57,7 +57,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(clipboard);
#define CF_REGFORMATBASE 0xC000
#define CF_REGFORMATBASE 0xC000
typedef struct
{
@ -322,20 +322,20 @@ BOOL WINAPI CloseClipboard(void)
if (CLIPBOARD_CloseClipboard())
{
if (bCBHasChanged)
{
if (bCBHasChanged)
{
HWND hWndViewer = GetClipboardViewer();
if (USER_Driver.pEndClipboardUpdate)
USER_Driver.pEndClipboardUpdate();
if (hWndViewer)
SendMessageW(hWndViewer, WM_DRAWCLIPBOARD, 0, 0);
if (hWndViewer)
SendMessageW(hWndViewer, WM_DRAWCLIPBOARD, 0, 0);
bCBHasChanged = FALSE;
}
bRet = TRUE;
bRet = TRUE;
}
return bRet;
@ -445,10 +445,10 @@ HWND WINAPI SetClipboardViewer( HWND hWnd )
req->viewer = WIN_GetFullHandle(hWnd);
if (wine_server_call_err( req ))
{
{
ERR("Failed to set clipboard.\n");
}
else
}
else
{
hwndPrev = reply->old_viewer;
}
@ -462,7 +462,7 @@ HWND WINAPI SetClipboardViewer( HWND hWnd )
/**************************************************************************
* GetClipboardViewer (USER32.@)
* GetClipboardViewer (USER32.@)
*/
HWND WINAPI GetClipboardViewer(void)
{
@ -482,7 +482,7 @@ HWND WINAPI GetClipboardViewer(void)
/**************************************************************************
* ChangeClipboardChain (USER32.@)
* ChangeClipboardChain (USER32.@)
*/
BOOL WINAPI ChangeClipboardChain(HWND hWnd, HWND hWndNext)
{
@ -493,11 +493,11 @@ BOOL WINAPI ChangeClipboardChain(HWND hWnd, HWND hWndNext)
{
if (WIN_GetFullHandle(hWnd) == hWndViewer)
SetClipboardViewer(WIN_GetFullHandle(hWndNext));
else
else
bRet = !SendMessageW(hWndViewer, WM_CHANGECBCHAIN, (WPARAM)hWnd, (LPARAM)hWndNext);
}
else
ERR("hWndViewer is lost\n");
ERR("hWndViewer is lost\n");
return bRet;
}

File diff suppressed because it is too large Load Diff

View File

@ -236,7 +236,7 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
}
return 1;
}
case WM_NCDESTROY:
case WM_NCDESTROY:
if ((dlgInfo = (DIALOGINFO *)SetWindowLongPtrW( hwnd, DWLP_WINE_DIALOGINFO, 0 )))
{
/* Free dialog heap (if created) */
@ -249,21 +249,21 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
if (dlgInfo->hMenu) DestroyMenu( dlgInfo->hMenu );
HeapFree( GetProcessHeap(), 0, dlgInfo );
}
/* Window clean-up */
return DefWindowProcA( hwnd, msg, wParam, lParam );
/* Window clean-up */
return DefWindowProcA( hwnd, msg, wParam, lParam );
case WM_SHOWWINDOW:
if (!wParam) DEFDLG_SaveFocus( hwnd );
return DefWindowProcA( hwnd, msg, wParam, lParam );
case WM_SHOWWINDOW:
if (!wParam) DEFDLG_SaveFocus( hwnd );
return DefWindowProcA( hwnd, msg, wParam, lParam );
case WM_ACTIVATE:
if (wParam) DEFDLG_RestoreFocus( hwnd );
else DEFDLG_SaveFocus( hwnd );
return 0;
case WM_ACTIVATE:
if (wParam) DEFDLG_RestoreFocus( hwnd );
else DEFDLG_SaveFocus( hwnd );
return 0;
case WM_SETFOCUS:
DEFDLG_RestoreFocus( hwnd );
return 0;
case WM_SETFOCUS:
DEFDLG_RestoreFocus( hwnd );
return 0;
case DM_SETDEFID:
if (dlgInfo && !(dlgInfo->flags & DF_END))
@ -279,9 +279,9 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
if ((hwndDefId = DEFDLG_FindDefButton( hwnd )))
return MAKELONG( GetDlgCtrlID( hwndDefId ), DC_HASDEFID);
}
return 0;
return 0;
case WM_NEXTDLGCTL:
case WM_NEXTDLGCTL:
if (dlgInfo)
{
HWND hwndDest = (HWND)wParam;
@ -304,9 +304,9 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
SendMessageA( GetParent(hwndFocus), CB_SHOWDROPDOWN, FALSE, 0 );
}
}
return DefWindowProcA( hwnd, msg, wParam, lParam );
return DefWindowProcA( hwnd, msg, wParam, lParam );
case WM_GETFONT:
case WM_GETFONT:
return dlgInfo ? (LRESULT)dlgInfo->hUserFont : 0;
case WM_CLOSE:
@ -315,7 +315,7 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
return 0;
case WM_NOTIFYFORMAT:
return DefWindowProcA( hwnd, msg, wParam, lParam );
return DefWindowProcA( hwnd, msg, wParam, lParam );
}
return 0;
}
@ -328,7 +328,7 @@ static LRESULT DEFDLG_Epilog(HWND hwnd, UINT msg, BOOL fResult)
/* see SDK 3.1 */
if ((msg >= WM_CTLCOLORMSGBOX && msg <= WM_CTLCOLORSTATIC) ||
msg == WM_CTLCOLOR || msg == WM_COMPAREITEM ||
msg == WM_CTLCOLOR || msg == WM_COMPAREITEM ||
msg == WM_VKEYTOITEM || msg == WM_CHARTOITEM ||
msg == WM_QUERYDRAGICON || msg == WM_INITDIALOG)
return fResult;
@ -375,7 +375,7 @@ DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create )
}
/***********************************************************************
* DefDlgProc (USER.308)
* DefDlgProc (USER.308)
*/
LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
LPARAM lParam )
@ -434,7 +434,7 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
/***********************************************************************
* DefDlgProcA (USER32.@)
* DefDlgProcA (USER32.@)
*/
LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
@ -491,7 +491,7 @@ LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
/***********************************************************************
* DefDlgProcW (USER32.@)
* DefDlgProcW (USER32.@)
*/
LRESULT WINAPI DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{

View File

@ -43,8 +43,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(win);
/* bits in the dwKeyData */
#define KEYDATA_ALT 0x2000
#define KEYDATA_PREVSTATE 0x4000
#define KEYDATA_ALT 0x2000
#define KEYDATA_PREVSTATE 0x4000
static short iF10Key = 0;
static short iMenuSysKey = 0;
@ -156,7 +156,7 @@ HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType )
{
if( ctlType == CTLCOLOR_SCROLLBAR)
{
HBRUSH hb = GetSysColorBrush(COLOR_SCROLLBAR);
HBRUSH hb = GetSysColorBrush(COLOR_SCROLLBAR);
COLORREF bk = GetSysColor(COLOR_3DHILIGHT);
SetTextColor( hDC, GetSysColor(COLOR_3DFACE));
SetBkColor( hDC, bk);
@ -168,17 +168,17 @@ HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType )
if (bk == GetSysColor(COLOR_WINDOW))
return SYSCOLOR_55AABrush;
UnrealizeObject( hb );
UnrealizeObject( hb );
return hb;
}
SetTextColor( hDC, GetSysColor(COLOR_WINDOWTEXT));
if ((ctlType == CTLCOLOR_EDIT) || (ctlType == CTLCOLOR_LISTBOX))
SetBkColor( hDC, GetSysColor(COLOR_WINDOW) );
SetBkColor( hDC, GetSysColor(COLOR_WINDOW) );
else {
SetBkColor( hDC, GetSysColor(COLOR_3DFACE) );
return GetSysColorBrush(COLOR_3DFACE);
SetBkColor( hDC, GetSysColor(COLOR_3DFACE) );
return GetSysColorBrush(COLOR_3DFACE);
}
return GetSysColorBrush(COLOR_WINDOW);
}
@ -242,7 +242,7 @@ static HWND DEFWND_ImmGetDefaultIMEWnd( HWND hwnd )
pFunc = (void*)GetProcAddress(hInstIMM,"ImmGetDefaultIMEWnd");
if ( pFunc != NULL )
hwndRet = (*pFunc)( hwnd );
hwndRet = (*pFunc)( hwnd );
return hwndRet;
}
@ -261,7 +261,7 @@ static BOOL DEFWND_ImmIsUIMessageA( HWND hwndIME, UINT msg, WPARAM wParam, LPARA
pFunc = (void*)GetProcAddress(hInstIMM,"ImmIsUIMessageA");
if ( pFunc != NULL )
fRet = (*pFunc)( hwndIME, msg, wParam, lParam );
fRet = (*pFunc)( hwndIME, msg, wParam, lParam );
return fRet;
}
@ -280,7 +280,7 @@ static BOOL DEFWND_ImmIsUIMessageW( HWND hwndIME, UINT msg, WPARAM wParam, LPARA
pFunc = (void*)GetProcAddress(hInstIMM,"ImmIsUIMessageW");
if ( pFunc != NULL )
fRet = (*pFunc)( hwndIME, msg, wParam, lParam );
fRet = (*pFunc)( hwndIME, msg, wParam, lParam );
return fRet;
}
@ -346,8 +346,8 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
/* release capture if we took it on WM_NCRBUTTONDOWN */
ReleaseCapture();
pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam);
pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam);
ClientToScreen(hwnd, &pt);
SendMessageW( hwnd, WM_CONTEXTMENU, (WPARAM)hwnd, MAKELPARAM(pt.x, pt.y) );
}
@ -407,14 +407,14 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_PAINTICON:
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint( hwnd, &ps );
if( hdc )
{
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint( hwnd, &ps );
if( hdc )
{
HICON hIcon;
if (IsIconic(hwnd) && ((hIcon = (HICON)GetClassLongPtrW( hwnd, GCLP_HICON))) )
{
if (IsIconic(hwnd) && ((hIcon = (HICON)GetClassLongPtrW( hwnd, GCLP_HICON))) )
{
RECT rc;
int x, y;
@ -424,11 +424,11 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
TRACE("Painting class icon: vis rect=(%ld,%ld - %ld,%ld)\n",
ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom );
DrawIcon( hdc, x, y, hIcon );
}
EndPaint( hwnd, &ps );
}
return 0;
}
}
EndPaint( hwnd, &ps );
}
return 0;
}
case WM_SYNCPAINT:
RedrawWindow ( hwnd, NULL, 0, RDW_ERASENOW | RDW_ERASE | RDW_ALLCHILDREN );
@ -444,36 +444,36 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
return 0;
case WM_CLOSE:
DestroyWindow( hwnd );
return 0;
DestroyWindow( hwnd );
return 0;
case WM_MOUSEACTIVATE:
if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD)
{
LONG ret = SendMessageW( GetParent(hwnd), WM_MOUSEACTIVATE, wParam, lParam );
if (ret) return ret;
}
{
LONG ret = SendMessageW( GetParent(hwnd), WM_MOUSEACTIVATE, wParam, lParam );
if (ret) return ret;
}
/* Caption clicks are handled by the NC_HandleNCLButtonDown() */
/* Caption clicks are handled by the NC_HandleNCLButtonDown() */
return (LOWORD(lParam) >= HTCLIENT) ? MA_ACTIVATE : MA_NOACTIVATE;
case WM_ACTIVATE:
/* The default action in Windows is to set the keyboard focus to
* the window, if it's being activated and not minimized */
if (LOWORD(wParam) != WA_INACTIVE) {
/* The default action in Windows is to set the keyboard focus to
* the window, if it's being activated and not minimized */
if (LOWORD(wParam) != WA_INACTIVE) {
if (!IsIconic(hwnd)) SetFocus(hwnd);
}
break;
}
break;
case WM_MOUSEWHEEL:
if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD)
return SendMessageW( GetParent(hwnd), WM_MOUSEWHEEL, wParam, lParam );
break;
break;
case WM_ERASEBKGND:
case WM_ICONERASEBKGND:
{
RECT rect;
{
RECT rect;
HDC hdc = (HDC)wParam;
HBRUSH hbr = (HBRUSH)GetClassLongPtrW( hwnd, GCLP_HBRBACKGROUND );
if (!hbr) return 0;
@ -486,11 +486,11 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
}
else GetClipBox( hdc, &rect );
FillRect( hdc, &rect, hbr );
return 1;
}
return 1;
}
case WM_GETDLGCODE:
return 0;
return 0;
case WM_CTLCOLORMSGBOX:
case WM_CTLCOLOREDIT:
@ -499,14 +499,14 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
case WM_CTLCOLORSCROLLBAR:
return (LRESULT)DEFWND_ControlColor( (HDC)wParam, msg - WM_CTLCOLORMSGBOX );
return (LRESULT)DEFWND_ControlColor( (HDC)wParam, msg - WM_CTLCOLORMSGBOX );
case WM_CTLCOLOR:
return (LRESULT)DEFWND_ControlColor( (HDC)wParam, HIWORD(lParam) );
return (LRESULT)DEFWND_ControlColor( (HDC)wParam, HIWORD(lParam) );
case WM_SETCURSOR:
if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD)
{
{
/* with the exception of the border around a resizable wnd,
* give the parent first chance to set the cursor */
if ((LOWORD(lParam) < HTSIZEFIRST) || (LOWORD(lParam) > HTSIZELAST))
@ -514,68 +514,68 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if (SendMessageW(GetParent(hwnd), WM_SETCURSOR, wParam, lParam)) return TRUE;
}
}
NC_HandleSetCursor( hwnd, wParam, lParam );
NC_HandleSetCursor( hwnd, wParam, lParam );
break;
case WM_SYSCOMMAND:
return NC_HandleSysCommand( hwnd, wParam, lParam );
case WM_KEYDOWN:
if(wParam == VK_F10) iF10Key = VK_F10;
break;
if(wParam == VK_F10) iF10Key = VK_F10;
break;
case WM_SYSKEYDOWN:
if( HIWORD(lParam) & KEYDATA_ALT )
{
/* if( HIWORD(lParam) & ~KEYDATA_PREVSTATE ) */
if( wParam == VK_MENU && !iMenuSysKey )
iMenuSysKey = 1;
else
iMenuSysKey = 0;
if( HIWORD(lParam) & KEYDATA_ALT )
{
/* if( HIWORD(lParam) & ~KEYDATA_PREVSTATE ) */
if( wParam == VK_MENU && !iMenuSysKey )
iMenuSysKey = 1;
else
iMenuSysKey = 0;
iF10Key = 0;
iF10Key = 0;
if( wParam == VK_F4 ) /* try to close the window */
{
if( wParam == VK_F4 ) /* try to close the window */
{
HWND top = GetAncestor( hwnd, GA_ROOT );
if (!(GetClassLongW( top, GCL_STYLE ) & CS_NOCLOSE))
PostMessageW( top, WM_SYSCOMMAND, SC_CLOSE, 0 );
}
}
else if( wParam == VK_F10 )
}
}
else if( wParam == VK_F10 )
iF10Key = 1;
else if( wParam == VK_ESCAPE && (GetKeyState(VK_SHIFT) & 0x8000))
SendMessageW( hwnd, WM_SYSCOMMAND, SC_KEYMENU, ' ' );
break;
break;
case WM_KEYUP:
case WM_SYSKEYUP:
/* Press and release F10 or ALT */
if (((wParam == VK_MENU) && iMenuSysKey) ||
/* Press and release F10 or ALT */
if (((wParam == VK_MENU) && iMenuSysKey) ||
((wParam == VK_F10) && iF10Key))
SendMessageW( GetAncestor( hwnd, GA_ROOT ), WM_SYSCOMMAND, SC_KEYMENU, 0L );
iMenuSysKey = iF10Key = 0;
iMenuSysKey = iF10Key = 0;
break;
case WM_SYSCHAR:
{
iMenuSysKey = 0;
iMenuSysKey = 0;
if (wParam == '\r' && IsIconic(hwnd))
{
PostMessageW( hwnd, WM_SYSCOMMAND, SC_RESTORE, 0L );
break;
break;
}
if ((HIWORD(lParam) & KEYDATA_ALT) && wParam)
if ((HIWORD(lParam) & KEYDATA_ALT) && wParam)
{
if (wParam == '\t' || wParam == '\x1b') break;
if (wParam == ' ' && (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD))
SendMessageW( GetParent(hwnd), msg, wParam, lParam );
else
else
SendMessageW( hwnd, WM_SYSCOMMAND, SC_KEYMENU, wParam );
}
else /* check for Ctrl-Esc */
else /* check for Ctrl-Esc */
if (wParam != '\x1b') MessageBeep(0);
break;
break;
}
case WM_SHOWWINDOW:
@ -593,15 +593,15 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_CANCELMODE:
iMenuSysKey = 0;
if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD)) EndMenu();
if (GetCapture() == hwnd) ReleaseCapture();
break;
if (GetCapture() == hwnd) ReleaseCapture();
break;
case WM_VKEYTOITEM:
case WM_CHARTOITEM:
return -1;
return -1;
case WM_DROPOBJECT:
return DRAG_FILE;
return DRAG_FILE;
case WM_QUERYDROPOBJECT:
return (GetWindowLongA( hwnd, GWL_EXSTYLE ) & WS_EX_ACCEPTFILES) != 0;
@ -634,7 +634,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_QUERYOPEN:
case WM_QUERYENDSESSION:
return 1;
return 1;
case WM_SETICON:
{
@ -694,7 +694,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_HELP:
SendMessageW( GetParent(hwnd), msg, wParam, lParam );
break;
break;
}
return 0;
@ -703,7 +703,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
/***********************************************************************
* DefWindowProcA (USER32.@)
* DefWindowProcA (USER32.@)
*
*/
LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
@ -724,14 +724,14 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
switch(msg)
{
case WM_NCCREATE:
{
CREATESTRUCTA *cs = (CREATESTRUCTA *)lParam;
/* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
* may have child window IDs instead of window name */
if (HIWORD(cs->lpszName))
{
CREATESTRUCTA *cs = (CREATESTRUCTA *)lParam;
/* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
* may have child window IDs instead of window name */
if (HIWORD(cs->lpszName))
DEFWND_SetTextA( hwnd, cs->lpszName );
result = 1;
}
result = 1;
}
break;
case WM_GETTEXTLENGTH:
@ -765,49 +765,49 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
case WM_SETTEXT:
DEFWND_SetTextA( hwnd, (LPCSTR)lParam );
if( (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CAPTION) == WS_CAPTION )
NC_HandleNCPaint( hwnd , (HRGN)1 ); /* Repaint caption */
result = 1; /* success. FIXME: check text length */
NC_HandleNCPaint( hwnd , (HRGN)1 ); /* Repaint caption */
result = 1; /* success. FIXME: check text length */
break;
/* for far east users (IMM32) - <hidenori@a2.ctktv.ne.jp> */
case WM_IME_CHAR:
{
CHAR chChar1 = (CHAR)( (wParam>>8) & 0xff );
CHAR chChar2 = (CHAR)( wParam & 0xff );
{
CHAR chChar1 = (CHAR)( (wParam>>8) & 0xff );
CHAR chChar2 = (CHAR)( wParam & 0xff );
if (chChar1)
SendMessageA( hwnd, WM_CHAR, (WPARAM)chChar1, lParam );
SendMessageA( hwnd, WM_CHAR, (WPARAM)chChar2, lParam );
}
break;
if (chChar1)
SendMessageA( hwnd, WM_CHAR, (WPARAM)chChar1, lParam );
SendMessageA( hwnd, WM_CHAR, (WPARAM)chChar2, lParam );
}
break;
case WM_IME_KEYDOWN:
result = SendMessageA( hwnd, WM_KEYDOWN, wParam, lParam );
break;
result = SendMessageA( hwnd, WM_KEYDOWN, wParam, lParam );
break;
case WM_IME_KEYUP:
result = SendMessageA( hwnd, WM_KEYUP, wParam, lParam );
break;
result = SendMessageA( hwnd, WM_KEYUP, wParam, lParam );
break;
case WM_IME_STARTCOMPOSITION:
case WM_IME_COMPOSITION:
case WM_IME_ENDCOMPOSITION:
case WM_IME_SELECT:
{
HWND hwndIME;
{
HWND hwndIME;
hwndIME = DEFWND_ImmGetDefaultIMEWnd( hwnd );
if (hwndIME)
result = SendMessageA( hwndIME, msg, wParam, lParam );
}
break;
hwndIME = DEFWND_ImmGetDefaultIMEWnd( hwnd );
if (hwndIME)
result = SendMessageA( hwndIME, msg, wParam, lParam );
}
break;
case WM_IME_SETCONTEXT:
{
HWND hwndIME;
{
HWND hwndIME;
hwndIME = DEFWND_ImmGetDefaultIMEWnd( hwnd );
if (hwndIME)
result = DEFWND_ImmIsUIMessageA( hwndIME, msg, wParam, lParam );
}
break;
hwndIME = DEFWND_ImmGetDefaultIMEWnd( hwnd );
if (hwndIME)
result = DEFWND_ImmIsUIMessageA( hwndIME, msg, wParam, lParam );
}
break;
case WM_INPUTLANGCHANGEREQUEST:
/* notify about the switch only if it's really our current layout */
@ -836,7 +836,7 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
/***********************************************************************
* DefWindowProcW (USER32.@) Calls default window message handler
* DefWindowProcW (USER32.@) Calls default window message handler
*
* Calls default window procedure for messages not processed
* by application.
@ -865,14 +865,14 @@ LRESULT WINAPI DefWindowProcW(
switch(msg)
{
case WM_NCCREATE:
{
CREATESTRUCTW *cs = (CREATESTRUCTW *)lParam;
/* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
* may have child window IDs instead of window name */
if (HIWORD(cs->lpszName))
DEFWND_SetTextW( hwnd, cs->lpszName );
result = 1;
}
{
CREATESTRUCTW *cs = (CREATESTRUCTW *)lParam;
/* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
* may have child window IDs instead of window name */
if (HIWORD(cs->lpszName))
DEFWND_SetTextW( hwnd, cs->lpszName );
result = 1;
}
break;
case WM_GETTEXTLENGTH:
@ -903,36 +903,36 @@ LRESULT WINAPI DefWindowProcW(
case WM_SETTEXT:
DEFWND_SetTextW( hwnd, (LPCWSTR)lParam );
if( (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CAPTION) == WS_CAPTION )
NC_HandleNCPaint( hwnd , (HRGN)1 ); /* Repaint caption */
result = 1; /* success. FIXME: check text length */
NC_HandleNCPaint( hwnd , (HRGN)1 ); /* Repaint caption */
result = 1; /* success. FIXME: check text length */
break;
/* for far east users (IMM32) - <hidenori@a2.ctktv.ne.jp> */
case WM_IME_CHAR:
SendMessageW( hwnd, WM_CHAR, wParam, lParam );
break;
SendMessageW( hwnd, WM_CHAR, wParam, lParam );
break;
case WM_IME_SETCONTEXT:
{
HWND hwndIME;
{
HWND hwndIME;
hwndIME = DEFWND_ImmGetDefaultIMEWnd( hwnd );
if (hwndIME)
result = DEFWND_ImmIsUIMessageW( hwndIME, msg, wParam, lParam );
}
break;
hwndIME = DEFWND_ImmGetDefaultIMEWnd( hwnd );
if (hwndIME)
result = DEFWND_ImmIsUIMessageW( hwndIME, msg, wParam, lParam );
}
break;
case WM_IME_STARTCOMPOSITION:
case WM_IME_COMPOSITION:
case WM_IME_ENDCOMPOSITION:
case WM_IME_SELECT:
{
HWND hwndIME;
{
HWND hwndIME;
hwndIME = DEFWND_ImmGetDefaultIMEWnd( hwnd );
if (hwndIME)
result = SendMessageW( hwndIME, msg, wParam, lParam );
}
break;
hwndIME = DEFWND_ImmGetDefaultIMEWnd( hwnd );
if (hwndIME)
result = SendMessageW( hwndIME, msg, wParam, lParam );
}
break;
case WM_INPUTLANGCHANGEREQUEST:
/* notify about the switch only if it's really our current layout */

View File

@ -245,11 +245,11 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
if (GET_WORD(p) == 0xffff) /* Is it an integer id? */
{
info->windowName = (LPCWSTR)(UINT)GET_WORD(p + 1);
p += 2;
p += 2;
}
else
{
info->windowName = (LPCWSTR)p;
info->windowName = (LPCWSTR)p;
p += strlenW( info->windowName ) + 1;
}
@ -419,7 +419,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
case 0xffff:
result->menuName = (LPCWSTR)(UINT)GET_WORD( p + 1 );
p += 2;
TRACE(" MENU %04x\n", LOWORD(result->menuName) );
TRACE(" MENU %04x\n", LOWORD(result->menuName) );
break;
default:
result->menuName = (LPCWSTR)p;
@ -439,7 +439,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
case 0xffff:
result->className = (LPCWSTR)(UINT)GET_WORD( p + 1 );
p += 2;
TRACE(" CLASS %04x\n", LOWORD(result->className) );
TRACE(" CLASS %04x\n", LOWORD(result->className) );
break;
default:
result->className = (LPCWSTR)p;
@ -458,7 +458,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
if (result->style & DS_SETFONT)
{
result->pointSize = GET_WORD(p);
result->pointSize = GET_WORD(p);
p++;
if (result->dialogEx)
{
@ -470,9 +470,9 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
result->weight = FW_DONTCARE;
result->italic = FALSE;
}
result->faceName = (LPCWSTR)p;
result->faceName = (LPCWSTR)p;
p += strlenW( result->faceName ) + 1;
TRACE(" FONT %d, %s, %d, %s\n",
TRACE(" FONT %d, %s, %d, %s\n",
result->pointSize, debugstr_w( result->faceName ),
result->weight, result->italic ? "TRUE" : "FALSE" );
}
@ -523,8 +523,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
* for both +ve and -ve template.pointSize */
HDC dc;
int pixels;
dc = GetDC(0);
pixels = MulDiv(template.pointSize, GetDeviceCaps(dc , LOGPIXELSY), 72);
dc = GetDC(0);
pixels = MulDiv(template.pointSize, GetDeviceCaps(dc , LOGPIXELSY), 72);
hUserFont = CreateFontW( -pixels, 0, 0, 0, template.weight,
template.italic, FALSE, FALSE, DEFAULT_CHARSET, 0, 0,
PROOF_QUALITY, FF_DONTCARE,
@ -634,7 +634,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
if (hUserFont) DeleteObject( hUserFont );
if (hMenu) DestroyMenu( hMenu );
if (modal && (flags & DF_OWNERENABLED)) DIALOG_EnableOwner(owner);
return 0;
return 0;
}
/* moved this from the top of the method to here as DIALOGINFO structure
@ -673,11 +673,11 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
SetFocus( dlgInfo->hwndFocus );
}
if (template.style & WS_VISIBLE && !(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE))
{
ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */
}
return hwnd;
if (template.style & WS_VISIBLE && !(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE))
{
ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */
}
return hwnd;
}
if (modal && ownerEnabled) DIALOG_EnableOwner(owner);
if( IsWindow(hwnd) ) DestroyWindow( hwnd );
@ -992,21 +992,21 @@ static HWND DIALOG_FindMsgDestination( HWND hwndDlg )
{
while (GetWindowLongA(hwndDlg, GWL_STYLE) & DS_CONTROL)
{
WND *pParent;
HWND hParent = GetParent(hwndDlg);
if (!hParent) break;
WND *pParent;
HWND hParent = GetParent(hwndDlg);
if (!hParent) break;
pParent = WIN_GetPtr(hParent);
if (!pParent || pParent == WND_OTHER_PROCESS || pParent == WND_DESKTOP) break;
pParent = WIN_GetPtr(hParent);
if (!pParent || pParent == WND_OTHER_PROCESS || pParent == WND_DESKTOP) break;
if (!(pParent->flags & WIN_ISDIALOG))
{
WIN_ReleasePtr(pParent);
break;
}
WIN_ReleasePtr(pParent);
if (!(pParent->flags & WIN_ISDIALOG))
{
WIN_ReleasePtr(pParent);
break;
}
WIN_ReleasePtr(pParent);
hwndDlg = hParent;
hwndDlg = hParent;
}
return hwndDlg;
@ -1623,12 +1623,12 @@ static HWND DIALOG_GetNextTabItem( HWND hwndMain, HWND hwndDlg, HWND hwndCtrl, B
{
HWND hParent = GetParent(hwndCtrl);
while(hParent)
{
{
if(hParent == hwndMain) break;
retWnd = DIALOG_GetNextTabItem(hwndMain,GetParent(hParent),hParent,fPrevious );
if(retWnd) break;
hParent = GetParent(hParent);
}
}
if(!retWnd)
retWnd = DIALOG_GetNextTabItem(hwndMain,hwndMain,NULL,fPrevious );
}

View File

@ -496,17 +496,19 @@ UINT WINAPI GetKeyboardLayoutList(INT nBuff, HKL *layouts)
/***********************************************************************
* RegisterHotKey (USER32.@)
*/
BOOL WINAPI RegisterHotKey(HWND hwnd,INT id,UINT modifiers,UINT vk) {
FIXME_(keyboard)("(%p,%d,0x%08x,%d): stub\n",hwnd,id,modifiers,vk);
return TRUE;
BOOL WINAPI RegisterHotKey(HWND hwnd,INT id,UINT modifiers,UINT vk)
{
FIXME_(keyboard)("(%p,%d,0x%08x,%d): stub\n",hwnd,id,modifiers,vk);
return TRUE;
}
/***********************************************************************
* UnregisterHotKey (USER32.@)
*/
BOOL WINAPI UnregisterHotKey(HWND hwnd,INT id) {
FIXME_(keyboard)("(%p,%d): stub\n",hwnd,id);
return TRUE;
BOOL WINAPI UnregisterHotKey(HWND hwnd,INT id)
{
FIXME_(keyboard)("(%p,%d): stub\n",hwnd,id);
return TRUE;
}
/***********************************************************************
@ -639,9 +641,9 @@ static void CALLBACK TrackMouseEventProc(HWND hwndUnused, UINT uMsg, UINT_PTR id
/* has the mouse hovered long enough? */
if(TrackingList[i].iHoverTime <= TrackingList[i].tme.dwHoverTime)
{
posClient.x = pos.x;
posClient.y = pos.y;
ScreenToClient(hwnd, &posClient);
posClient.x = pos.x;
posClient.y = pos.y;
ScreenToClient(hwnd, &posClient);
if (nonclient) {
PostMessageW(TrackingList[i].tme.hwndTrack, WM_NCMOUSEHOVER,
get_key_state(), MAKELPARAM( posClient.x, posClient.y ));

View File

@ -41,18 +41,18 @@ WINE_DECLARE_DEBUG_CHANNEL(shell);
BOOL NC_DrawGrayButton(HDC hdc, int x, int y);
static const BYTE lpGrayMask[] = { 0xAA, 0xA0,
0x55, 0x50,
0xAA, 0xA0,
0x55, 0x50,
0xAA, 0xA0,
0x55, 0x50,
0xAA, 0xA0,
0x55, 0x50,
0xAA, 0xA0,
0x55, 0x50};
0x55, 0x50,
0xAA, 0xA0,
0x55, 0x50,
0xAA, 0xA0,
0x55, 0x50,
0xAA, 0xA0,
0x55, 0x50,
0xAA, 0xA0,
0x55, 0x50};
#define SC_ABOUTWINE (SC_SCREENSAVE+1)
#define SC_PUTMARK (SC_SCREENSAVE+2)
#define SC_ABOUTWINE (SC_SCREENSAVE+1)
#define SC_PUTMARK (SC_SCREENSAVE+2)
/* Some useful macros */
#define HAS_DLGFRAME(style,exStyle) \
@ -256,79 +256,79 @@ BOOL WINAPI DrawCaptionTempW (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont,
/* drawing background */
if (uFlags & DC_INBUTTON) {
FillRect (hdc, &rc, GetSysColorBrush (COLOR_3DFACE));
FillRect (hdc, &rc, GetSysColorBrush (COLOR_3DFACE));
if (uFlags & DC_ACTIVE) {
HBRUSH hbr = SelectObject (hdc, SYSCOLOR_55AABrush);
PatBlt (hdc, rc.left, rc.top,
rc.right-rc.left, rc.bottom-rc.top, 0xFA0089);
SelectObject (hdc, hbr);
}
if (uFlags & DC_ACTIVE) {
HBRUSH hbr = SelectObject (hdc, SYSCOLOR_55AABrush);
PatBlt (hdc, rc.left, rc.top,
rc.right-rc.left, rc.bottom-rc.top, 0xFA0089);
SelectObject (hdc, hbr);
}
}
else {
FillRect (hdc, &rc, GetSysColorBrush ((uFlags & DC_ACTIVE) ?
COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION));
FillRect (hdc, &rc, GetSysColorBrush ((uFlags & DC_ACTIVE) ?
COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION));
}
/* drawing icon */
if ((uFlags & DC_ICON) && !(uFlags & DC_SMALLCAP)) {
POINT pt;
POINT pt;
pt.x = rc.left + 2;
pt.y = (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2;
pt.x = rc.left + 2;
pt.y = (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2;
if (!hIcon) hIcon = NC_IconForWindow(hwnd);
DrawIconEx (hdc, pt.x, pt.y, hIcon, GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON), 0, 0, DI_NORMAL);
rc.left += (rc.bottom - rc.top);
rc.left += (rc.bottom - rc.top);
}
/* drawing text */
if (uFlags & DC_TEXT) {
HFONT hOldFont;
HFONT hOldFont;
if (uFlags & DC_INBUTTON)
SetTextColor (hdc, GetSysColor (COLOR_BTNTEXT));
else if (uFlags & DC_ACTIVE)
SetTextColor (hdc, GetSysColor (COLOR_CAPTIONTEXT));
else
SetTextColor (hdc, GetSysColor (COLOR_INACTIVECAPTIONTEXT));
if (uFlags & DC_INBUTTON)
SetTextColor (hdc, GetSysColor (COLOR_BTNTEXT));
else if (uFlags & DC_ACTIVE)
SetTextColor (hdc, GetSysColor (COLOR_CAPTIONTEXT));
else
SetTextColor (hdc, GetSysColor (COLOR_INACTIVECAPTIONTEXT));
SetBkMode (hdc, TRANSPARENT);
SetBkMode (hdc, TRANSPARENT);
if (hFont)
hOldFont = SelectObject (hdc, hFont);
else {
NONCLIENTMETRICSW nclm;
HFONT hNewFont;
nclm.cbSize = sizeof(NONCLIENTMETRICSW);
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
hNewFont = CreateFontIndirectW ((uFlags & DC_SMALLCAP) ?
&nclm.lfSmCaptionFont : &nclm.lfCaptionFont);
hOldFont = SelectObject (hdc, hNewFont);
}
if (hFont)
hOldFont = SelectObject (hdc, hFont);
else {
NONCLIENTMETRICSW nclm;
HFONT hNewFont;
nclm.cbSize = sizeof(NONCLIENTMETRICSW);
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
hNewFont = CreateFontIndirectW ((uFlags & DC_SMALLCAP) ?
&nclm.lfSmCaptionFont : &nclm.lfCaptionFont);
hOldFont = SelectObject (hdc, hNewFont);
}
if (str)
DrawTextW (hdc, str, -1, &rc,
DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT);
else {
WCHAR szText[128];
INT nLen;
nLen = GetWindowTextW (hwnd, szText, 128);
DrawTextW (hdc, szText, nLen, &rc,
DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT);
}
if (str)
DrawTextW (hdc, str, -1, &rc,
DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT);
else {
WCHAR szText[128];
INT nLen;
nLen = GetWindowTextW (hwnd, szText, 128);
DrawTextW (hdc, szText, nLen, &rc,
DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT);
}
if (hFont)
SelectObject (hdc, hOldFont);
else
DeleteObject (SelectObject (hdc, hOldFont));
if (hFont)
SelectObject (hdc, hOldFont);
else
DeleteObject (SelectObject (hdc, hOldFont));
}
/* drawing focus ??? */
if (uFlags & 0x2000)
FIXME("undocumented flag (0x2000)!\n");
FIXME("undocumented flag (0x2000)!\n");
return 0;
}
@ -383,23 +383,23 @@ LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect )
if (!IsIconic(hwnd))
{
NC_AdjustRectOuter( &tmpRect, style, FALSE, exStyle );
NC_AdjustRectOuter( &tmpRect, style, FALSE, exStyle );
winRect->left -= tmpRect.left;
winRect->top -= tmpRect.top;
winRect->right -= tmpRect.right;
winRect->bottom -= tmpRect.bottom;
winRect->left -= tmpRect.left;
winRect->top -= tmpRect.top;
winRect->right -= tmpRect.right;
winRect->bottom -= tmpRect.bottom;
if (((style & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd))
{
TRACE("Calling GetMenuBarHeight with hwnd %p, width %ld, at (%ld, %ld).\n",
hwnd, winRect->right - winRect->left, -tmpRect.left, -tmpRect.top );
winRect->top +=
MENU_GetMenuBarHeight( hwnd,
winRect->right - winRect->left,
-tmpRect.left, -tmpRect.top ) + 1;
}
winRect->top +=
MENU_GetMenuBarHeight( hwnd,
winRect->right - winRect->left,
-tmpRect.left, -tmpRect.top ) + 1;
}
if( exStyle & WS_EX_CLIENTEDGE)
if( winRect->right - winRect->left > 2 * GetSystemMetrics(SM_CXEDGE) &&
@ -798,11 +798,11 @@ static void NC_DrawFrame( HDC hdc, RECT *rect, BOOL active, DWORD style, DWO
/* Firstly the "thick" frame */
if (style & WS_THICKFRAME)
{
width = GetSystemMetrics(SM_CXFRAME) - GetSystemMetrics(SM_CXDLGFRAME);
height = GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYDLGFRAME);
width = GetSystemMetrics(SM_CXFRAME) - GetSystemMetrics(SM_CXDLGFRAME);
height = GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYDLGFRAME);
SelectObject( hdc, GetSysColorBrush(active ? COLOR_ACTIVEBORDER :
COLOR_INACTIVEBORDER) );
COLOR_INACTIVEBORDER) );
/* Draw frame */
PatBlt( hdc, rect->left, rect->top,
rect->right - rect->left, height, PATCOPY );
@ -876,57 +876,57 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, DWORD style,
r.bottom--;
FillRect( hdc, &r, GetSysColorBrush(active ? COLOR_ACTIVECAPTION :
COLOR_INACTIVECAPTION) );
COLOR_INACTIVECAPTION) );
if ((style & WS_SYSMENU) && !(exStyle & WS_EX_TOOLWINDOW)) {
if (NC_DrawSysButton (hwnd, hdc, FALSE))
r.left += GetSystemMetrics(SM_CXSMICON) + 2;
if (NC_DrawSysButton (hwnd, hdc, FALSE))
r.left += GetSystemMetrics(SM_CXSMICON) + 2;
}
if (style & WS_SYSMENU)
{
UINT state;
UINT state;
/* Go get the sysmenu */
hSysMenu = GetSystemMenu(hwnd, FALSE);
state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
/* Go get the sysmenu */
hSysMenu = GetSystemMenu(hwnd, FALSE);
state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
/* Draw a grayed close button if disabled or if SC_CLOSE is not there */
NC_DrawCloseButton (hwnd, hdc, FALSE,
(state & (MF_DISABLED | MF_GRAYED)) || (state == 0xFFFFFFFF));
r.right -= GetSystemMetrics(SM_CYCAPTION) - 1;
/* Draw a grayed close button if disabled or if SC_CLOSE is not there */
NC_DrawCloseButton (hwnd, hdc, FALSE,
(state & (MF_DISABLED | MF_GRAYED)) || (state == 0xFFFFFFFF));
r.right -= GetSystemMetrics(SM_CYCAPTION) - 1;
if ((style & WS_MAXIMIZEBOX) || (style & WS_MINIMIZEBOX))
{
/* In win95 the two buttons are always there */
/* But if the menu item is not in the menu they're disabled*/
if ((style & WS_MAXIMIZEBOX) || (style & WS_MINIMIZEBOX))
{
/* In win95 the two buttons are always there */
/* But if the menu item is not in the menu they're disabled*/
NC_DrawMaxButton( hwnd, hdc, FALSE, (!(style & WS_MAXIMIZEBOX)));
r.right -= GetSystemMetrics(SM_CXSIZE) + 1;
NC_DrawMaxButton( hwnd, hdc, FALSE, (!(style & WS_MAXIMIZEBOX)));
r.right -= GetSystemMetrics(SM_CXSIZE) + 1;
NC_DrawMinButton( hwnd, hdc, FALSE, (!(style & WS_MINIMIZEBOX)));
r.right -= GetSystemMetrics(SM_CXSIZE) + 1;
}
NC_DrawMinButton( hwnd, hdc, FALSE, (!(style & WS_MINIMIZEBOX)));
r.right -= GetSystemMetrics(SM_CXSIZE) + 1;
}
}
if (InternalGetWindowText( hwnd, buffer, sizeof(buffer)/sizeof(WCHAR) ))
{
NONCLIENTMETRICSW nclm;
HFONT hFont, hOldFont;
nclm.cbSize = sizeof(nclm);
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
if (exStyle & WS_EX_TOOLWINDOW)
hFont = CreateFontIndirectW (&nclm.lfSmCaptionFont);
else
hFont = CreateFontIndirectW (&nclm.lfCaptionFont);
hOldFont = SelectObject (hdc, hFont);
if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) );
else SetTextColor( hdc, GetSysColor( COLOR_INACTIVECAPTIONTEXT ) );
SetBkMode( hdc, TRANSPARENT );
r.left += 2;
DrawTextW( hdc, buffer, -1, &r,
DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT );
DeleteObject (SelectObject (hdc, hOldFont));
NONCLIENTMETRICSW nclm;
HFONT hFont, hOldFont;
nclm.cbSize = sizeof(nclm);
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
if (exStyle & WS_EX_TOOLWINDOW)
hFont = CreateFontIndirectW (&nclm.lfSmCaptionFont);
else
hFont = CreateFontIndirectW (&nclm.lfCaptionFont);
hOldFont = SelectObject (hdc, hFont);
if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) );
else SetTextColor( hdc, GetSysColor( COLOR_INACTIVECAPTIONTEXT ) );
SetBkMode( hdc, TRANSPARENT );
r.left += 2;
DrawTextW( hdc, buffer, -1, &r,
DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT );
DeleteObject (SelectObject (hdc, hOldFont));
}
}
@ -1120,39 +1120,39 @@ LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam )
switch((short)LOWORD(lParam))
{
case HTERROR:
{
WORD msg = HIWORD( lParam );
if ((msg == WM_LBUTTONDOWN) || (msg == WM_MBUTTONDOWN) ||
(msg == WM_RBUTTONDOWN) || (msg == WM_XBUTTONDOWN))
MessageBeep(0);
}
break;
{
WORD msg = HIWORD( lParam );
if ((msg == WM_LBUTTONDOWN) || (msg == WM_MBUTTONDOWN) ||
(msg == WM_RBUTTONDOWN) || (msg == WM_XBUTTONDOWN))
MessageBeep(0);
}
break;
case HTCLIENT:
{
HCURSOR hCursor = (HCURSOR)GetClassLongPtrW(hwnd, GCLP_HCURSOR);
if(hCursor) {
SetCursor(hCursor);
return TRUE;
}
{
HCURSOR hCursor = (HCURSOR)GetClassLongPtrW(hwnd, GCLP_HCURSOR);
if(hCursor) {
SetCursor(hCursor);
return TRUE;
}
return FALSE;
}
}
case HTLEFT:
case HTRIGHT:
return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZEWE ) );
return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZEWE ) );
case HTTOP:
case HTBOTTOM:
return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZENS ) );
return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZENS ) );
case HTTOPLEFT:
case HTBOTTOMRIGHT:
return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZENWSE ) );
return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZENWSE ) );
case HTTOPRIGHT:
case HTBOTTOMLEFT:
return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZENESW ) );
return (LONG)SetCursor( LoadCursorA( 0, (LPSTR)IDC_SIZENESW ) );
}
/* Default cursor: arrow */
@ -1203,25 +1203,25 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
if (wParam == HTMINBUTTON)
{
/* If the style is not present, do nothing */
if (!(wndStyle & WS_MINIMIZEBOX))
return;
/* If the style is not present, do nothing */
if (!(wndStyle & WS_MINIMIZEBOX))
return;
/* Check if the sysmenu item for minimize is there */
state = GetMenuState(hSysMenu, SC_MINIMIZE, MF_BYCOMMAND);
/* Check if the sysmenu item for minimize is there */
state = GetMenuState(hSysMenu, SC_MINIMIZE, MF_BYCOMMAND);
paintButton = &NC_DrawMinButton;
paintButton = &NC_DrawMinButton;
}
else
{
/* If the style is not present, do nothing */
if (!(wndStyle & WS_MAXIMIZEBOX))
return;
/* If the style is not present, do nothing */
if (!(wndStyle & WS_MAXIMIZEBOX))
return;
/* Check if the sysmenu item for maximize is there */
state = GetMenuState(hSysMenu, SC_MAXIMIZE, MF_BYCOMMAND);
/* Check if the sysmenu item for maximize is there */
state = GetMenuState(hSysMenu, SC_MAXIMIZE, MF_BYCOMMAND);
paintButton = &NC_DrawMaxButton;
paintButton = &NC_DrawMaxButton;
}
SetCapture( hwnd );
@ -1230,24 +1230,24 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
while(1)
{
BOOL oldstate = pressed;
BOOL oldstate = pressed;
if (!GetMessageW( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST )) break;
if (CallMsgFilterW( &msg, MSGF_MAX )) continue;
if(msg.message == WM_LBUTTONUP)
break;
if(msg.message == WM_LBUTTONUP)
break;
if(msg.message != WM_MOUSEMOVE)
continue;
if(msg.message != WM_MOUSEMOVE)
continue;
pressed = (NC_HandleNCHitTest( hwnd, msg.pt ) == wParam);
if (pressed != oldstate)
(*paintButton)( hwnd, hdc, pressed, FALSE);
pressed = (NC_HandleNCHitTest( hwnd, msg.pt ) == wParam);
if (pressed != oldstate)
(*paintButton)( hwnd, hdc, pressed, FALSE);
}
if(pressed)
(*paintButton)(hwnd, hdc, FALSE, FALSE);
(*paintButton)(hwnd, hdc, FALSE, FALSE);
ReleaseCapture();
ReleaseDC( hwnd, hdc );
@ -1255,7 +1255,7 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
/* If the item minimize or maximize of the sysmenu are not there */
/* or if the style is not present, do nothing */
if ((!pressed) || (state == 0xFFFFFFFF))
return;
return;
if (wParam == HTMINBUTTON)
SendMessageA( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, MAKELONG(msg.pt.x,msg.pt.y) );
@ -1278,13 +1278,13 @@ static void NC_TrackCloseButton (HWND hwnd, WORD wParam)
UINT state;
if(hSysMenu == 0)
return;
return;
state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
/* If the item close of the sysmenu is disabled or not there do nothing */
if((state & MF_DISABLED) || (state & MF_GRAYED) || (state == 0xFFFFFFFF))
return;
return;
hdc = GetWindowDC( hwnd );
@ -1294,24 +1294,24 @@ static void NC_TrackCloseButton (HWND hwnd, WORD wParam)
while(1)
{
BOOL oldstate = pressed;
BOOL oldstate = pressed;
if (!GetMessageW( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST )) break;
if (CallMsgFilterW( &msg, MSGF_MAX )) continue;
if(msg.message == WM_LBUTTONUP)
break;
if(msg.message == WM_LBUTTONUP)
break;
if(msg.message != WM_MOUSEMOVE)
continue;
if(msg.message != WM_MOUSEMOVE)
continue;
pressed = (NC_HandleNCHitTest( hwnd, msg.pt ) == wParam);
if (pressed != oldstate)
NC_DrawCloseButton (hwnd, hdc, pressed, FALSE);
pressed = (NC_HandleNCHitTest( hwnd, msg.pt ) == wParam);
if (pressed != oldstate)
NC_DrawCloseButton (hwnd, hdc, pressed, FALSE);
}
if(pressed)
NC_DrawCloseButton (hwnd, hdc, FALSE, FALSE);
NC_DrawCloseButton (hwnd, hdc, FALSE, FALSE);
ReleaseCapture();
ReleaseDC( hwnd, hdc );
@ -1365,38 +1365,38 @@ LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
}
case HTSYSMENU:
if( style & WS_SYSMENU )
{
if( !(style & WS_MINIMIZE) )
{
HDC hDC = GetWindowDC(hwnd);
NC_DrawSysButton( hwnd, hDC, TRUE );
ReleaseDC( hwnd, hDC );
}
SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, lParam );
}
break;
if( style & WS_SYSMENU )
{
if( !(style & WS_MINIMIZE) )
{
HDC hDC = GetWindowDC(hwnd);
NC_DrawSysButton( hwnd, hDC, TRUE );
ReleaseDC( hwnd, hDC );
}
SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, lParam );
}
break;
case HTMENU:
SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU, lParam );
break;
SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU, lParam );
break;
case HTHSCROLL:
SendMessageW( hwnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lParam );
break;
SendMessageW( hwnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lParam );
break;
case HTVSCROLL:
SendMessageW( hwnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lParam );
break;
SendMessageW( hwnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lParam );
break;
case HTMINBUTTON:
case HTMAXBUTTON:
NC_TrackMinMaxBox( hwnd, wParam );
break;
NC_TrackMinMaxBox( hwnd, wParam );
break;
case HTCLOSE:
NC_TrackCloseButton (hwnd, wParam);
break;
NC_TrackCloseButton (hwnd, wParam);
break;
case HTLEFT:
case HTRIGHT:
@ -1415,10 +1415,10 @@ LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
* SC_MOUSEMENU into wParam.
*/
SendMessageW( hwnd, WM_SYSCOMMAND, SC_SIZE + wParam - (HTLEFT-WMSZ_LEFT), lParam);
break;
break;
case HTBORDER:
break;
break;
}
return 0;
}
@ -1448,7 +1448,7 @@ LONG NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam )
if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_MAXIMIZEBOX)
SendMessageW( hwnd, WM_SYSCOMMAND,
IsZoomed(hwnd) ? SC_RESTORE : SC_MAXIMIZE, lParam );
break;
break;
case HTSYSMENU:
{
@ -1465,11 +1465,11 @@ LONG NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam )
case HTHSCROLL:
SendMessageW( hwnd, WM_SYSCOMMAND, SC_HSCROLL + HTHSCROLL, lParam );
break;
break;
case HTVSCROLL:
SendMessageW( hwnd, WM_SYSCOMMAND, SC_VSCROLL + HTVSCROLL, lParam );
break;
break;
}
return 0;
}
@ -1493,28 +1493,28 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
case SC_MOVE:
if (USER_Driver.pSysCommandSizeMove)
USER_Driver.pSysCommandSizeMove( hwnd, wParam );
break;
break;
case SC_MINIMIZE:
if (hwnd == GetForegroundWindow())
ShowOwnedPopups(hwnd,FALSE);
ShowWindow( hwnd, SW_MINIMIZE );
break;
ShowWindow( hwnd, SW_MINIMIZE );
break;
case SC_MAXIMIZE:
if (IsIconic(hwnd) && hwnd == GetForegroundWindow())
ShowOwnedPopups(hwnd,TRUE);
ShowWindow( hwnd, SW_MAXIMIZE );
break;
ShowWindow( hwnd, SW_MAXIMIZE );
break;
case SC_RESTORE:
if (IsIconic(hwnd) && hwnd == GetForegroundWindow())
ShowOwnedPopups(hwnd,TRUE);
ShowWindow( hwnd, SW_RESTORE );
break;
ShowWindow( hwnd, SW_RESTORE );
break;
case SC_CLOSE:
return SendMessageA( hwnd, WM_CLOSE, 0, 0 );
return SendMessageA( hwnd, WM_CLOSE, 0, 0 );
case SC_VSCROLL:
case SC_HSCROLL:
@ -1524,7 +1524,7 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
pt.y = (short)HIWORD(lParam);
NC_TrackScrollBar( hwnd, wParam, pt );
}
break;
break;
case SC_MOUSEMENU:
{
@ -1533,18 +1533,18 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
pt.y = (short)HIWORD(lParam);
MENU_TrackMouseMenuBar( hwnd, wParam & 0x000F, pt );
}
break;
break;
case SC_KEYMENU:
MENU_TrackKbdMenuBar( hwnd, wParam, (WCHAR)lParam );
break;
break;
case SC_TASKLIST:
WinExec( "taskman.exe", SW_SHOWNORMAL );
break;
WinExec( "taskman.exe", SW_SHOWNORMAL );
break;
case SC_SCREENSAVE:
if (wParam == SC_ABOUTWINE)
if (wParam == SC_ABOUTWINE)
{
HMODULE hmodule = LoadLibraryA( "shell32.dll" );
if (hmodule)
@ -1554,16 +1554,16 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
FreeLibrary( hmodule );
}
}
else
if (wParam == SC_PUTMARK)
else
if (wParam == SC_PUTMARK)
DPRINTF("Debug mark requested by user\n");
break;
break;
case SC_HOTKEY:
case SC_ARRANGE:
case SC_NEXTWINDOW:
case SC_PREVWINDOW:
FIXME("unimplemented WM_SYSCOMMAND %04x!\n", wParam);
FIXME("unimplemented WM_SYSCOMMAND %04x!\n", wParam);
break;
}
return 0;
@ -1585,7 +1585,7 @@ BOOL NC_DrawGrayButton(HDC hdc, int x, int y)
hMaskBmp = CreateBitmap (12, 10, 1, 1, lpGrayMask);
if(hMaskBmp == 0)
return FALSE;
return FALSE;
hdcMask = CreateCompatibleDC (0);
SelectObject (hdcMask, hMaskBmp);
@ -1593,7 +1593,7 @@ BOOL NC_DrawGrayButton(HDC hdc, int x, int y)
/* Draw the grayed bitmap using the mask */
hOldBrush = SelectObject (hdc, (HGDIOBJ)RGB(128, 128, 128));
BitBlt (hdc, x, y, 12, 10,
hdcMask, 0, 0, 0xB8074A);
hdcMask, 0, 0, 0xB8074A);
/* Clean up */
SelectObject (hdc, hOldBrush);

File diff suppressed because it is too large Load Diff

View File

@ -752,16 +752,16 @@ static void WIN_FixCoordinates( CREATESTRUCTA *cs, INT *sw)
}
else
{
/* neither x nor cx are default. Check the y values .
* In the trace we see Outlook and Outlook Express using
* cy set to CW_USEDEFAULT when opening the address book.
*/
if (cs->cy == CW_USEDEFAULT || cs->cy == CW_USEDEFAULT16) {
RECT r;
FIXME("Strange use of CW_USEDEFAULT in nHeight\n");
SystemParametersInfoW( SPI_GETWORKAREA, 0, &r, 0);
cs->cy = (((r.bottom - r.top) * 3) / 4) - cs->y;
}
/* neither x nor cx are default. Check the y values .
* In the trace we see Outlook and Outlook Express using
* cy set to CW_USEDEFAULT when opening the address book.
*/
if (cs->cy == CW_USEDEFAULT || cs->cy == CW_USEDEFAULT16) {
RECT r;
FIXME("Strange use of CW_USEDEFAULT in nHeight\n");
SystemParametersInfoW( SPI_GETWORKAREA, 0, &r, 0);
cs->cy = (((r.bottom - r.top) * 3) / 4) - cs->y;
}
}
}
@ -1133,7 +1133,7 @@ HWND16 WINAPI CreateWindow16( LPCSTR className, LPCSTR windowName,
HINSTANCE16 instance, LPVOID data )
{
return CreateWindowEx16( 0, className, windowName, style,
x, y, width, height, parent, menu, instance, data );
x, y, width, height, parent, menu, instance, data );
}
@ -2990,26 +2990,26 @@ BOOL WINAPI DragDetect( HWND hWnd, POINT pt )
while(1)
{
while (PeekMessageW( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE ))
while (PeekMessageW( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE ))
{
if( msg.message == WM_LBUTTONUP )
{
ReleaseCapture();
return 0;
{
ReleaseCapture();
return 0;
}
if( msg.message == WM_MOUSEMOVE )
{
{
POINT tmp;
tmp.x = LOWORD(msg.lParam);
tmp.y = HIWORD(msg.lParam);
if( !PtInRect( &rect, tmp ))
if( !PtInRect( &rect, tmp ))
{
ReleaseCapture();
return 1;
ReleaseCapture();
return 1;
}
}
}
}
WaitMessage();
WaitMessage();
}
return 0;
}

View File

@ -680,13 +680,13 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
case WM_CREATE:
{
UNICODE_STRING usBuffer;
struct s
{ CREATESTRUCTW cs; /* new structure */
LPCWSTR lpszName; /* allocated Name */
LPCWSTR lpszClass; /* allocated Class */
};
struct s
{ CREATESTRUCTW cs; /* new structure */
LPCWSTR lpszName; /* allocated Name */
LPCWSTR lpszClass; /* allocated Class */
};
struct s *xs = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct s));
struct s *xs = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct s));
if (!xs) return -1;
xs->cs = *(CREATESTRUCTW *)*plparam;
if (HIWORD(xs->cs.lpszName))
@ -748,7 +748,7 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
case LB_FINDSTRINGEXACT:
case LB_SELECTSTRING:
if(!*plparam) return 0;
if ( WINPROC_TestLBForStr( hwnd ))
if ( WINPROC_TestLBForStr( hwnd ))
{
UNICODE_STRING usBuffer;
RtlCreateUnicodeStringFromAsciiz(&usBuffer,(LPCSTR)*plparam);
@ -756,13 +756,13 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
}
return (*plparam ? 1 : -1);
case LB_GETTEXT: /* FIXME: fixed sized buffer */
case LB_GETTEXT: /* FIXME: fixed sized buffer */
{ if ( WINPROC_TestLBForStr( hwnd ))
{ LPARAM *ptr = HeapAlloc( GetProcessHeap(), 0, 512 * sizeof(WCHAR) + sizeof(LPARAM) );
{ LPARAM *ptr = HeapAlloc( GetProcessHeap(), 0, 512 * sizeof(WCHAR) + sizeof(LPARAM) );
if (!ptr) return -1;
*ptr++ = *plparam; /* Store previous lParam */
*plparam = (LPARAM)ptr;
}
}
}
return 1;
@ -773,7 +773,7 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
case CB_FINDSTRING:
case CB_SELECTSTRING:
if(!*plparam) return 0;
if ( WINPROC_TestCBForStr( hwnd ))
if ( WINPROC_TestCBForStr( hwnd ))
{
UNICODE_STRING usBuffer;
RtlCreateUnicodeStringFromAsciiz(&usBuffer,(LPCSTR)*plparam);
@ -787,19 +787,19 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
if (!ptr) return -1;
*ptr++ = *plparam; /* Store previous lParam */
*plparam = (LPARAM)ptr;
}
}
}
return 1;
/* Multiline edit */
case EM_GETLINE:
{ WORD len = (WORD)*plparam;
LPARAM *ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(LPARAM) + sizeof (WORD) + len*sizeof(WCHAR) );
LPARAM *ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(LPARAM) + sizeof (WORD) + len*sizeof(WCHAR) );
if (!ptr) return -1;
*ptr++ = *plparam; /* Store previous lParam */
*((WORD *) ptr) = len; /* Store the length */
*((WORD *) ptr) = len; /* Store the length */
*plparam = (LPARAM)ptr;
}
}
return 1;
case WM_CHARTOITEM:
@ -874,11 +874,11 @@ LRESULT WINPROC_UnmapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_NCCREATE:
case WM_CREATE:
{
struct s
{ CREATESTRUCTW cs; /* new structure */
LPWSTR lpszName; /* allocated Name */
LPWSTR lpszClass; /* allocated Class */
};
struct s
{ CREATESTRUCTW cs; /* new structure */
LPWSTR lpszName; /* allocated Name */
LPWSTR lpszClass; /* allocated Class */
};
struct s *xs = (struct s *)lParam;
HeapFree( GetProcessHeap(), 0, xs->lpszName );
HeapFree( GetProcessHeap(), 0, xs->lpszClass );
@ -923,7 +923,7 @@ LRESULT WINPROC_UnmapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case LB_FINDSTRING:
case LB_FINDSTRINGEXACT:
case LB_SELECTSTRING:
if ( WINPROC_TestLBForStr( hwnd ))
if ( WINPROC_TestLBForStr( hwnd ))
HeapFree( GetProcessHeap(), 0, (void *)lParam );
break;
@ -943,7 +943,7 @@ LRESULT WINPROC_UnmapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
case CB_FINDSTRING:
case CB_FINDSTRINGEXACT:
case CB_SELECTSTRING:
if ( WINPROC_TestCBForStr( hwnd ))
if ( WINPROC_TestCBForStr( hwnd ))
HeapFree( GetProcessHeap(), 0, (void *)lParam );
break;
@ -1050,13 +1050,13 @@ static INT WINPROC_MapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM
}
return (*plparam ? 1 : -1);
case LB_GETTEXT: /* FIXME: fixed sized buffer */
case LB_GETTEXT: /* FIXME: fixed sized buffer */
{ if ( WINPROC_TestLBForStr( hwnd ))
{ LPARAM *ptr = HeapAlloc( GetProcessHeap(), 0, 512 + sizeof(LPARAM) );
{ LPARAM *ptr = HeapAlloc( GetProcessHeap(), 0, 512 + sizeof(LPARAM) );
if (!ptr) return -1;
*ptr++ = *plparam; /* Store previous lParam */
*plparam = (LPARAM)ptr;
}
}
}
return 1;
@ -1076,25 +1076,25 @@ static INT WINPROC_MapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM
}
return (*plparam ? 1 : -1);
case CB_GETLBTEXT: /* FIXME: fixed sized buffer */
case CB_GETLBTEXT: /* FIXME: fixed sized buffer */
{ if ( WINPROC_TestCBForStr( hwnd ))
{ LPARAM *ptr = HeapAlloc( GetProcessHeap(), 0, 512 + sizeof(LPARAM) );
{ LPARAM *ptr = HeapAlloc( GetProcessHeap(), 0, 512 + sizeof(LPARAM) );
if (!ptr) return -1;
*ptr++ = *plparam; /* Store previous lParam */
*plparam = (LPARAM)ptr;
}
}
}
return 1;
/* Multiline edit */
case EM_GETLINE:
{ WORD len = (WORD)*plparam;
LPARAM *ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(LPARAM) + sizeof (WORD) + len*sizeof(CHAR) );
LPARAM *ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(LPARAM) + sizeof (WORD) + len*sizeof(CHAR) );
if (!ptr) return -1;
*ptr++ = *plparam; /* Store previous lParam */
*((WORD *) ptr) = len; /* Store the length */
*((WORD *) ptr) = len; /* Store the length */
*plparam = (LPARAM)ptr;
}
}
return 1;
case WM_CHARTOITEM:
@ -1186,7 +1186,7 @@ static LRESULT WINPROC_UnmapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM wParam, LPA
case LB_FINDSTRING:
case LB_FINDSTRINGEXACT:
case LB_SELECTSTRING:
if ( WINPROC_TestLBForStr( hwnd ))
if ( WINPROC_TestLBForStr( hwnd ))
HeapFree( GetProcessHeap(), 0, (void *)lParam );
break;
@ -1205,7 +1205,7 @@ static LRESULT WINPROC_UnmapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM wParam, LPA
case CB_FINDSTRING:
case CB_FINDSTRINGEXACT:
case CB_SELECTSTRING:
if ( WINPROC_TestCBForStr( hwnd ))
if ( WINPROC_TestCBForStr( hwnd ))
HeapFree( GetProcessHeap(), 0, (void *)lParam );
break;
@ -1237,12 +1237,12 @@ static LRESULT WINPROC_UnmapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM wParam, LPA
static UINT convert_handle_16_to_32(HANDLE16 src, unsigned int flags)
{
HANDLE dst;
UINT sz = GlobalSize16(src);
LPSTR ptr16, ptr32;
HANDLE dst;
UINT sz = GlobalSize16(src);
LPSTR ptr16, ptr32;
if (!(dst = GlobalAlloc(flags, sz)))
return 0;
return 0;
ptr16 = GlobalLock16(src);
ptr32 = GlobalLock(dst);
if (ptr16 != NULL && ptr32 != NULL) memcpy(ptr32, ptr16, sz);
@ -1278,7 +1278,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
*plparam = (LPARAM)WIN_Handle32( HIWORD(*plparam) );
return 0;
case WM_CTLCOLOR:
if ( HIWORD(*plparam) > CTLCOLOR_STATIC ) return -1;
if ( HIWORD(*plparam) > CTLCOLOR_STATIC ) return -1;
*pmsg32 = WM_CTLCOLORMSGBOX + HIWORD(*plparam);
*pwparam32 = (WPARAM)HDC_32(wParam16);
*plparam = (LPARAM)WIN_Handle32( LOWORD(*plparam) );
@ -1401,13 +1401,13 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
*plparam = (LPARAM)HMENU_32(HIWORD(*plparam));
return 0;
case WM_MDIACTIVATE:
if( *plparam )
{
if( *plparam )
{
*pwparam32 = (WPARAM)WIN_Handle32( HIWORD(*plparam) );
*plparam = (LPARAM)WIN_Handle32( LOWORD(*plparam) );
}
else /* message sent to MDI client */
*pwparam32 = wParam16;
}
else /* message sent to MDI client */
*pwparam32 = wParam16;
return 0;
case WM_NCCALCSIZE:
{
@ -1509,7 +1509,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
}
else return 0;
case WM_NOTIFY:
*plparam = (LPARAM)MapSL(*plparam);
*plparam = (LPARAM)MapSL(*plparam);
return 0;
case WM_ACTIVATEAPP:
/* We need this when SetActiveWindow sends a Sendmessage16() to
@ -1535,60 +1535,60 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
case WM_DDE_TERMINATE:
case WM_DDE_UNADVISE:
case WM_DDE_REQUEST:
*pwparam32 = (WPARAM)WIN_Handle32(wParam16);
return 0;
*pwparam32 = (WPARAM)WIN_Handle32(wParam16);
return 0;
case WM_DDE_ADVISE:
case WM_DDE_DATA:
case WM_DDE_POKE:
{
HANDLE16 lo16;
ATOM hi;
UINT lo32 = 0;
HANDLE16 lo16;
ATOM hi;
UINT lo32 = 0;
*pwparam32 = (WPARAM)WIN_Handle32(wParam16);
lo16 = LOWORD(*plparam);
hi = HIWORD(*plparam);
if (lo16 && !(lo32 = convert_handle_16_to_32(lo16, GMEM_DDESHARE)))
return -1;
*plparam = PackDDElParam(msg16, lo32, hi);
}
return 0; /* FIXME don't know how to free allocated memory (handle) !! */
*pwparam32 = (WPARAM)WIN_Handle32(wParam16);
lo16 = LOWORD(*plparam);
hi = HIWORD(*plparam);
if (lo16 && !(lo32 = convert_handle_16_to_32(lo16, GMEM_DDESHARE)))
return -1;
*plparam = PackDDElParam(msg16, lo32, hi);
}
return 0; /* FIXME don't know how to free allocated memory (handle) !! */
case WM_DDE_ACK:
{
UINT lo, hi;
int flag = 0;
char buf[2];
UINT lo, hi;
int flag = 0;
char buf[2];
*pwparam32 = (WPARAM)WIN_Handle32(wParam16);
*pwparam32 = (WPARAM)WIN_Handle32(wParam16);
lo = LOWORD(*plparam);
hi = HIWORD(*plparam);
lo = LOWORD(*plparam);
hi = HIWORD(*plparam);
if (GlobalGetAtomNameA(hi, buf, 2) > 0) flag |= 1;
if (GlobalSize16(hi) != 0) flag |= 2;
switch (flag)
{
case 0:
if (hi)
{
MESSAGE("DDE_ACK: neither atom nor handle!!!\n");
hi = 0;
}
break;
case 1:
break; /* atom, nothing to do */
case 3:
MESSAGE("DDE_ACK: %x both atom and handle... choosing handle\n", hi);
/* fall thru */
case 2:
hi = convert_handle_16_to_32(hi, GMEM_DDESHARE);
break;
}
*plparam = PackDDElParam(WM_DDE_ACK, lo, hi);
}
return 0; /* FIXME don't know how to free allocated memory (handle) !! */
if (GlobalGetAtomNameA(hi, buf, 2) > 0) flag |= 1;
if (GlobalSize16(hi) != 0) flag |= 2;
switch (flag)
{
case 0:
if (hi)
{
MESSAGE("DDE_ACK: neither atom nor handle!!!\n");
hi = 0;
}
break;
case 1:
break; /* atom, nothing to do */
case 3:
MESSAGE("DDE_ACK: %x both atom and handle... choosing handle\n", hi);
/* fall thru */
case 2:
hi = convert_handle_16_to_32(hi, GMEM_DDESHARE);
break;
}
*plparam = PackDDElParam(WM_DDE_ACK, lo, hi);
}
return 0; /* FIXME don't know how to free allocated memory (handle) !! */
case WM_DDE_EXECUTE:
*plparam = convert_handle_16_to_32(*plparam, GMEM_DDESHARE);
*plparam = convert_handle_16_to_32(*plparam, GMEM_DDESHARE);
return 0; /* FIXME don't know how to free allocated memory (handle) !! */
default: /* No translation needed */
return 0;
@ -1670,7 +1670,7 @@ LRESULT WINPROC_UnmapMsg16To32A( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
}
HeapFree( GetProcessHeap(), 0, nc );
}
break;
break;
case WM_NCCREATE:
case WM_CREATE:
{
@ -1902,12 +1902,12 @@ LRESULT WINPROC_UnmapMsg16To32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
static HANDLE16 convert_handle_32_to_16(UINT src, unsigned int flags)
{
HANDLE16 dst;
UINT sz = GlobalSize((HANDLE)src);
LPSTR ptr16, ptr32;
HANDLE16 dst;
UINT sz = GlobalSize((HANDLE)src);
LPSTR ptr16, ptr32;
if (!(dst = GlobalAlloc16(flags, sz)))
return 0;
return 0;
ptr32 = GlobalLock((HANDLE)src);
ptr16 = GlobalLock16(dst);
if (ptr16 != NULL && ptr32 != NULL) memcpy(ptr16, ptr32, sz);
@ -2026,11 +2026,11 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
case CB_SETEXTENDEDUI:
case CB_GETEXTENDEDUI:
case CB_GETDROPPEDSTATE:
*pmsg16 = (UINT16)msg32 + (CB_GETEDITSEL16 - CB_GETEDITSEL);
return 0;
*pmsg16 = (UINT16)msg32 + (CB_GETEDITSEL16 - CB_GETEDITSEL);
return 0;
case CB_GETEDITSEL:
*pmsg16 = CB_GETEDITSEL16;
return 1;
*pmsg16 = CB_GETEDITSEL16;
return 1;
case LB_ADDSTRING:
case LB_FINDSTRING:
@ -2050,8 +2050,8 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
case CB_SELECTSTRING:
case CB_DIR:
*plparam = (LPARAM)MapLS( (LPSTR)*plparam );
*pmsg16 = (UINT16)msg32 + (CB_GETEDITSEL16 - CB_GETEDITSEL);
return 1;
*pmsg16 = (UINT16)msg32 + (CB_GETEDITSEL16 - CB_GETEDITSEL);
return 1;
case LB_GETITEMRECT:
{
@ -2060,7 +2060,7 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
*(LPARAM *)(rect + 1) = *plparam; /* Store the previous lParam */
*plparam = MapLS( rect );
}
*pmsg16 = LB_GETITEMRECT16;
*pmsg16 = LB_GETITEMRECT16;
return 1;
case LB_GETSELITEMS:
{
@ -2072,7 +2072,7 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
*items++ = *plparam; /* Store the previous lParam */
*plparam = MapLS( items );
}
*pmsg16 = LB_GETSELITEMS16;
*pmsg16 = LB_GETSELITEMS16;
return 1;
case LB_SETTABSTOPS:
if (wParam32)
@ -2091,29 +2091,29 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
case CB_GETDROPPEDCONTROLRECT:
{
RECT16 *rect = HeapAlloc( GetProcessHeap(), 0, sizeof(RECT16) + sizeof(LPARAM) );
if (!rect) return -1;
*(LPARAM *)(rect + 1) = *plparam; /* Store the previous lParam */
*plparam = (LPARAM)MapLS(rect);
RECT16 *rect = HeapAlloc( GetProcessHeap(), 0, sizeof(RECT16) + sizeof(LPARAM) );
if (!rect) return -1;
*(LPARAM *)(rect + 1) = *plparam; /* Store the previous lParam */
*plparam = (LPARAM)MapLS(rect);
}
*pmsg16 = CB_GETDROPPEDCONTROLRECT16;
*pmsg16 = CB_GETDROPPEDCONTROLRECT16;
return 1;
case LB_GETTEXT:
*plparam = (LPARAM)MapLS( (LPVOID)(*plparam) );
*pmsg16 = LB_GETTEXT16;
return 1;
*plparam = (LPARAM)MapLS( (LPVOID)(*plparam) );
*pmsg16 = LB_GETTEXT16;
return 1;
case CB_GETLBTEXT:
*plparam = (LPARAM)MapLS( (LPVOID)(*plparam) );
*pmsg16 = CB_GETLBTEXT16;
return 1;
*plparam = (LPARAM)MapLS( (LPVOID)(*plparam) );
*pmsg16 = CB_GETLBTEXT16;
return 1;
case EM_SETSEL:
*pwparam16 = 0;
*plparam = MAKELONG( (INT16)(INT)wParam32, (INT16)*plparam );
*pmsg16 = EM_SETSEL16;
return 0;
*pwparam16 = 0;
*plparam = MAKELONG( (INT16)(INT)wParam32, (INT16)*plparam );
*pmsg16 = EM_SETSEL16;
return 0;
case WM_ACTIVATE:
case WM_CHARTOITEM:
@ -2333,8 +2333,8 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
/* else nothing to do */
return 0;
case WM_NOTIFY:
*plparam = MapLS( (NMHDR *)*plparam ); /* NMHDR is already 32-bit */
return 1;
*plparam = MapLS( (NMHDR *)*plparam ); /* NMHDR is already 32-bit */
return 1;
case WM_SETTEXT:
case WM_WININICHANGE:
case WM_DEVMODECHANGE:
@ -2408,57 +2408,57 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
case WM_DDE_TERMINATE:
case WM_DDE_UNADVISE:
case WM_DDE_REQUEST:
*pwparam16 = HWND_16((HWND)wParam32);
return 0;
*pwparam16 = HWND_16((HWND)wParam32);
return 0;
case WM_DDE_ADVISE:
case WM_DDE_DATA:
case WM_DDE_POKE:
{
UINT lo32, hi;
HANDLE16 lo16 = 0;
UINT lo32, hi;
HANDLE16 lo16 = 0;
*pwparam16 = HWND_16((HWND)wParam32);
*pwparam16 = HWND_16((HWND)wParam32);
UnpackDDElParam(msg32, *plparam, &lo32, &hi);
if (lo32 && !(lo16 = convert_handle_32_to_16(lo32, GMEM_DDESHARE)))
return -1;
*plparam = MAKELPARAM(lo16, hi);
}
return 0; /* FIXME don't know how to free allocated memory (handle) !! */
if (lo32 && !(lo16 = convert_handle_32_to_16(lo32, GMEM_DDESHARE)))
return -1;
*plparam = MAKELPARAM(lo16, hi);
}
return 0; /* FIXME don't know how to free allocated memory (handle) !! */
case WM_DDE_ACK:
{
UINT lo, hi;
int flag = 0;
char buf[2];
UINT lo, hi;
int flag = 0;
char buf[2];
*pwparam16 = HWND_16((HWND)wParam32);
*pwparam16 = HWND_16((HWND)wParam32);
UnpackDDElParam(msg32, *plparam, &lo, &hi);
if (GlobalGetAtomNameA((ATOM)hi, buf, sizeof(buf)) > 0) flag |= 1;
if (GlobalSize((HANDLE)hi) != 0) flag |= 2;
switch (flag)
{
case 0:
if (hi)
{
MESSAGE("DDE_ACK: neither atom nor handle!!!\n");
hi = 0;
}
break;
case 1:
break; /* atom, nothing to do */
case 3:
MESSAGE("DDE_ACK: %x both atom and handle... choosing handle\n", hi);
/* fall thru */
case 2:
hi = convert_handle_32_to_16(hi, GMEM_DDESHARE);
break;
}
*plparam = MAKELPARAM(lo, hi);
}
return 0; /* FIXME don't know how to free allocated memory (handle) !! */
if (GlobalGetAtomNameA((ATOM)hi, buf, sizeof(buf)) > 0) flag |= 1;
if (GlobalSize((HANDLE)hi) != 0) flag |= 2;
switch (flag)
{
case 0:
if (hi)
{
MESSAGE("DDE_ACK: neither atom nor handle!!!\n");
hi = 0;
}
break;
case 1:
break; /* atom, nothing to do */
case 3:
MESSAGE("DDE_ACK: %x both atom and handle... choosing handle\n", hi);
/* fall thru */
case 2:
hi = convert_handle_32_to_16(hi, GMEM_DDESHARE);
break;
}
*plparam = MAKELPARAM(lo, hi);
}
return 0; /* FIXME don't know how to free allocated memory (handle) !! */
case WM_DDE_EXECUTE:
*plparam = convert_handle_32_to_16(*plparam, GMEM_DDESHARE);
*plparam = convert_handle_32_to_16(*plparam, GMEM_DDESHARE);
return 0; /* FIXME don't know how to free allocated memory (handle) !! */
default: /* No translation needed */
return 0;
@ -2538,11 +2538,11 @@ void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
break;
case CB_GETEDITSEL:
if( wParam )
*((PUINT)(wParam)) = LOWORD(p16->lResult);
if( lParam )
*((PUINT)(lParam)) = HIWORD(p16->lResult); /* FIXME: substract 1? */
break;
if( wParam )
*((PUINT)(wParam)) = LOWORD(p16->lResult);
if( lParam )
*((PUINT)(lParam)) = HIWORD(p16->lResult); /* FIXME: substract 1? */
break;
case WM_MEASUREITEM:
{
@ -2644,8 +2644,8 @@ void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
}
break;
case WM_NOTIFY:
UnMapLS(p16->lParam);
break;
UnMapLS(p16->lParam);
break;
case WM_GETDLGCODE:
if (p16->lParam)
{
@ -2919,7 +2919,7 @@ static LRESULT WINPROC_CallProc32ATo32W( WNDPROC func, HWND hwnd,
int unmap;
TRACE_(msg)("func %p (hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
if( (unmap = WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam )) == -1) {
ERR_(msg)("Message translation failed. (msg=%s,wp=%08x,lp=%08lx)\n",
@ -3017,7 +3017,7 @@ static LRESULT WINPROC_CallProc32WTo32A( WNDPROC func, HWND hwnd,
int unmap;
TRACE_(msg)("func %p (hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
if (WINPROC_CallProc32WTo32A_fast( func, hwnd, msg, wParam, lParam, &result ))
return result;
@ -3088,7 +3088,7 @@ static LRESULT WINAPI WINPROC_CallProc32ATo16( WNDPROC16 func, HWND hwnd,
MSGPARAM16 mp16;
TRACE_(msg)("func %p (hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
mp16.lParam = lParam;
if (WINPROC_MapMsg32ATo16( hwnd, msg, wParam, &msg16, &mp16.wParam, &mp16.lParam ) == -1)
@ -3113,7 +3113,7 @@ static LRESULT WINAPI WINPROC_CallProc32WTo16( WNDPROC16 func, HWND hwnd,
MSGPARAM16 mp16;
TRACE_(msg)("func %p (hwnd=%p,msg=%s,wp=%08x,lp=%08lx)\n",
func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
func, hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
mp16.lParam = lParam;
if (WINPROC_MapMsg32WTo16( hwnd, msg, wParam, &msg16, &mp16.wParam,