From 172e731c0bc08038555b803b1e4feeaa8d34f619 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 25 Apr 2005 11:33:34 +0000 Subject: [PATCH] Moved most files from the windows directory to dlls/user. --- dlls/user/Makefile.in | 30 +- {windows => dlls/user}/class.c | 0 {windows => dlls/user}/clipboard.c | 58 +- {windows => dlls/user}/cursoricon.c | 828 +++++++++++------------ {windows => dlls/user}/defdlg.c | 44 +- {windows => dlls/user}/defwnd.c | 290 ++++---- {windows => dlls/user}/dialog.c | 62 +- {windows => dlls/user}/input.c | 20 +- {windows => dlls/user}/mdi.c | 0 {windows => dlls/user}/msgbox.c | 0 {windows => dlls/user}/nonclient.c | 422 ++++++------ {windows => dlls/user}/spy.c | 1272 +++++++++++++++++------------------ {windows => dlls/user}/win.c | 42 +- {windows => dlls/user}/winhelp.c | 0 {windows => dlls/user}/winpos.c | 0 {windows => dlls/user}/winproc.c | 340 +++++----- 16 files changed, 1705 insertions(+), 1703 deletions(-) rename {windows => dlls/user}/class.c (100%) rename {windows => dlls/user}/clipboard.c (96%) rename {windows => dlls/user}/cursoricon.c (78%) rename {windows => dlls/user}/defdlg.c (94%) rename {windows => dlls/user}/defwnd.c (82%) rename {windows => dlls/user}/dialog.c (98%) rename {windows => dlls/user}/input.c (98%) rename {windows => dlls/user}/mdi.c (100%) rename {windows => dlls/user}/msgbox.c (100%) rename {windows => dlls/user}/nonclient.c (83%) rename {windows => dlls/user}/spy.c (72%) rename {windows => dlls/user}/win.c (99%) rename {windows => dlls/user}/winhelp.c (100%) rename {windows => dlls/user}/winpos.c (100%) rename {windows => dlls/user}/winproc.c (93%) diff --git a/dlls/user/Makefile.in b/dlls/user/Makefile.in index cdc4bddbdf7..2c1c39c8962 100644 --- a/dlls/user/Makefile.in +++ b/dlls/user/Makefile.in @@ -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 = \ diff --git a/windows/class.c b/dlls/user/class.c similarity index 100% rename from windows/class.c rename to dlls/user/class.c diff --git a/windows/clipboard.c b/dlls/user/clipboard.c similarity index 96% rename from windows/clipboard.c rename to dlls/user/clipboard.c index 178b714142c..444dfd80666 100644 --- a/windows/clipboard.c +++ b/dlls/user/clipboard.c @@ -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; @@ -349,19 +349,19 @@ BOOL WINAPI CloseClipboard(void) BOOL WINAPI EmptyClipboard(void) { CLIPBOARDINFO cbinfo; - + TRACE("()\n"); if (!CLIPBOARD_GetClipboardInfo(&cbinfo) || ~cbinfo.flags & CB_OPEN) - { + { WARN("Clipboard not opened by calling task!\n"); SetLastError(ERROR_CLIPBOARD_NOT_OPEN); return FALSE; } /* Destroy private objects */ - if (cbinfo.hWndOwner) + if (cbinfo.hWndOwner) SendMessageW(cbinfo.hWndOwner, WM_DESTROYCLIPBOARD, 0, 0); /* Tell the driver to acquire the selection. The current owner @@ -369,22 +369,22 @@ BOOL WINAPI EmptyClipboard(void) /* Assign ownership of the clipboard to the current client. We do * this before acquiring the selection so that when we do acquire the - * selection and the selection loser gets notified, it can check if + * selection and the selection loser gets notified, it can check if * it has lost the Wine clipboard ownership. If it did then it knows * that a WM_DESTORYCLIPBOARD has already been sent. Otherwise it - * lost the selection to a X app and it should send the + * lost the selection to a X app and it should send the * WM_DESTROYCLIPBOARD itself. */ CLIPBOARD_SetClipboardOwner(cbinfo.hWndOpen); /* Acquire the selection. This will notify the previous owner - * to clear it's cache. */ - if (USER_Driver.pAcquireClipboard) + * to clear it's cache. */ + if (USER_Driver.pAcquireClipboard) USER_Driver.pAcquireClipboard(cbinfo.hWndOpen); /* Empty the local cache */ - if (USER_Driver.pEmptyClipboard) + if (USER_Driver.pEmptyClipboard) USER_Driver.pEmptyClipboard(FALSE); - + bCBHasChanged = TRUE; return TRUE; @@ -438,31 +438,31 @@ HWND WINAPI GetOpenClipboardWindow(void) HWND WINAPI SetClipboardViewer( HWND hWnd ) { HWND hwndPrev = 0; - + SERVER_START_REQ( set_clipboard_info ) { req->flags = SET_CB_VIEWER; req->viewer = WIN_GetFullHandle(hWnd); - + if (wine_server_call_err( req )) - { + { ERR("Failed to set clipboard.\n"); - } - else + } + else { hwndPrev = reply->old_viewer; } } SERVER_END_REQ; - + TRACE("(%p): returning %p\n", hWnd, hwndPrev); - + return hwndPrev; } /************************************************************************** - * 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) { @@ -491,13 +491,13 @@ BOOL WINAPI ChangeClipboardChain(HWND hWnd, HWND hWndNext) if (hWndViewer) { - if (WIN_GetFullHandle(hWnd) == hWndViewer) + 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; } diff --git a/windows/cursoricon.c b/dlls/user/cursoricon.c similarity index 78% rename from windows/cursoricon.c rename to dlls/user/cursoricon.c index 31be015e168..a55bd4964b0 100644 --- a/windows/cursoricon.c +++ b/dlls/user/cursoricon.c @@ -219,8 +219,8 @@ static int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) else /* assume BITMAPINFOHEADER */ { colors = info->bmiHeader.biClrUsed; - if (colors > 256) /* buffer overflow otherwise */ - colors = 256; + if (colors > 256) /* buffer overflow otherwise */ + colors = 256; if (!colors && (info->bmiHeader.biBitCount <= 8)) colors = 1 << info->bmiHeader.biBitCount; return sizeof(BITMAPINFOHEADER) + colors * @@ -248,7 +248,7 @@ static BOOL is_dib_monochrome( const BITMAPINFO* info ) if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) { RGBTRIPLE *rgb = ((BITMAPCOREINFO *) info)->bmciColors; - + /* Check if the first color is black */ if ((rgb->rgbtRed == 0) && (rgb->rgbtGreen == 0) && (rgb->rgbtBlue == 0)) { @@ -541,7 +541,7 @@ static CURSORICONDIRENTRY *CURSORICON_FindBestCursor( CURSORICONDIR *dir, for(i = 0,entry = &dir->idEntries[0]; i < dir->idCount; i++,entry++) if ((entry->ResInfo.cursor.wWidth <= width) && (entry->ResInfo.cursor.wHeight <= height) && (entry->ResInfo.cursor.wWidth > maxwidth) && (entry->ResInfo.cursor.wHeight > maxheight) && - (entry->wBitCount == 1)) + (entry->wBitCount == 1)) { bestEntry = entry; maxwidth = entry->ResInfo.cursor.wWidth; @@ -554,7 +554,7 @@ static CURSORICONDIRENTRY *CURSORICON_FindBestCursor( CURSORICONDIR *dir, maxwidth = maxheight = 255; for(i = 0,entry = &dir->idEntries[0]; i < dir->idCount; i++,entry++) if ((entry->ResInfo.cursor.wWidth < maxwidth) && (entry->ResInfo.cursor.wHeight < maxheight) && - (entry->wBitCount == 1)) + (entry->wBitCount == 1)) { bestEntry = entry; maxwidth = entry->ResInfo.cursor.wWidth; @@ -580,7 +580,7 @@ static BOOL CURSORICON_SimulateLoadingFromResourceW( LPCWSTR filename, BOOL fCur LPBYTE _free; DWORD filesize; CURSORICONFILEDIR *bits; - int entries, size, i; + int entries, size, i; *res = NULL; *ptr = NULL; @@ -594,16 +594,16 @@ static BOOL CURSORICON_SimulateLoadingFromResourceW( LPCWSTR filename, BOOL fCur FIXME_(cursor)("Animated icons not correctly implemented! %p \n", bits); for (;;) - { if (*(LPDWORD)pos==0x6e6f6369) /* "icon" */ + { if (*(LPDWORD)pos==0x6e6f6369) /* "icon" */ { FIXME_(cursor)("icon entry found! %p\n", bits); - pos+=4; - if ( !*(LPWORD) pos==0x2fe) /* iconsize */ - { goto fail; - } - bits=(CURSORICONFILEDIR*)(pos+4); - FIXME_(cursor)("icon size ok. offset=%p \n", bits); - break; - } + pos+=4; + if ( !*(LPWORD) pos==0x2fe) /* iconsize */ + { goto fail; + } + bits=(CURSORICONFILEDIR*)(pos+4); + FIXME_(cursor)("icon size ok. offset=%p \n", bits); + break; + } pos+=2; if (pos>=(LPBYTE)bits+766) goto fail; } @@ -633,9 +633,9 @@ static BOOL CURSORICON_SimulateLoadingFromResourceW( LPCWSTR filename, BOOL fCur if (fCursor) { (*res)->idEntries[i].ResInfo.cursor.wWidth=bits->idEntries[i].bWidth; (*res)->idEntries[i].ResInfo.cursor.wHeight=bits->idEntries[i].bHeight; - ((LPPOINT16)_free)->x=bits->idEntries[i].xHotspot; - ((LPPOINT16)_free)->y=bits->idEntries[i].yHotspot; - _free+=sizeof(POINT16); + ((LPPOINT16)_free)->x=bits->idEntries[i].xHotspot; + ((LPPOINT16)_free)->y=bits->idEntries[i].yHotspot; + _free+=sizeof(POINT16); } else { (*res)->idEntries[i].ResInfo.icon.bWidth=bits->idEntries[i].bWidth; (*res)->idEntries[i].ResInfo.icon.bHeight=bits->idEntries[i].bHeight; @@ -662,7 +662,7 @@ fail: /********************************************************************** - * CURSORICON_CreateFromResource + * CURSORICON_CreateFromResource * * Create a cursor or icon from in-memory resource template. * @@ -670,8 +670,8 @@ fail: * with cbSize parameter as well. */ static HICON CURSORICON_CreateFromResource( HMODULE16 hModule, HGLOBAL16 hObj, LPBYTE bits, - UINT cbSize, BOOL bIcon, DWORD dwVersion, - INT width, INT height, UINT loadflags ) + UINT cbSize, BOOL bIcon, DWORD dwVersion, + INT width, INT height, UINT loadflags ) { static HDC hdcMem; int sizeAnd, sizeXor; @@ -690,12 +690,12 @@ static HICON CURSORICON_CreateFromResource( HMODULE16 hModule, HGLOBAL16 hObj, L bIcon ? "icon" : "cursor", (loadflags & LR_MONOCHROME) ? "mono" : "" ); if (dwVersion == 0x00020000) { - FIXME_(cursor)("\t2.xx resources are not supported\n"); - return 0; + FIXME_(cursor)("\t2.xx resources are not supported\n"); + return 0; } if (bIcon) - bmi = (BITMAPINFO *)bits; + bmi = (BITMAPINFO *)bits; else /* get the hotspot */ { POINT16 *pt = (POINT16 *)bits; @@ -712,8 +712,8 @@ static HICON CURSORICON_CreateFromResource( HMODULE16 hModule, HGLOBAL16 hObj, L /* Check bitmap header */ if ( (bmi->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) && - (bmi->bmiHeader.biSize != sizeof(BITMAPINFOHEADER) || - bmi->bmiHeader.biCompression != BI_RGB) ) + (bmi->bmiHeader.biSize != sizeof(BITMAPINFOHEADER) || + bmi->bmiHeader.biCompression != BI_RGB) ) { WARN_(cursor)("\tinvalid resource bitmap header.\n"); return 0; @@ -722,28 +722,28 @@ static HICON CURSORICON_CreateFromResource( HMODULE16 hModule, HGLOBAL16 hObj, L if (!screen_dc) screen_dc = CreateDCW( DISPLAYW, NULL, NULL, NULL ); if (screen_dc) { - BITMAPINFO* pInfo; + BITMAPINFO* pInfo; /* Make sure we have room for the monochrome bitmap later on. - * Note that BITMAPINFOINFO and BITMAPCOREHEADER are the same - * up to and including the biBitCount. In-memory icon resource - * format is as follows: - * - * BITMAPINFOHEADER icHeader // DIB header - * RGBQUAD icColors[] // Color table - * BYTE icXOR[] // DIB bits for XOR mask - * BYTE icAND[] // DIB bits for AND mask - */ - - if ((pInfo = HeapAlloc( GetProcessHeap(), 0, - max(size, sizeof(BITMAPINFOHEADER) + 2*sizeof(RGBQUAD))))) - { - memcpy( pInfo, bmi, size ); - pInfo->bmiHeader.biHeight /= 2; - - /* Create the XOR bitmap */ - - if (DoStretch) { + * Note that BITMAPINFOINFO and BITMAPCOREHEADER are the same + * up to and including the biBitCount. In-memory icon resource + * format is as follows: + * + * BITMAPINFOHEADER icHeader // DIB header + * RGBQUAD icColors[] // Color table + * BYTE icXOR[] // DIB bits for XOR mask + * BYTE icAND[] // DIB bits for AND mask + */ + + if ((pInfo = HeapAlloc( GetProcessHeap(), 0, + max(size, sizeof(BITMAPINFOHEADER) + 2*sizeof(RGBQUAD))))) + { + memcpy( pInfo, bmi, size ); + pInfo->bmiHeader.biHeight /= 2; + + /* Create the XOR bitmap */ + + if (DoStretch) { if(bIcon) { hXorBits = CreateCompatibleBitmap(screen_dc, width, height); @@ -754,7 +754,7 @@ static HICON CURSORICON_CreateFromResource( HMODULE16 hModule, HGLOBAL16 hObj, L } if(hXorBits) { - HBITMAP hOld; + HBITMAP hOld; BOOL res = FALSE; if (!hdcMem) hdcMem = CreateCompatibleDC(screen_dc); @@ -765,48 +765,48 @@ static HICON CURSORICON_CreateFromResource( HMODULE16 hModule, HGLOBAL16 hObj, L (char*)bmi + size, pInfo, DIB_RGB_COLORS, SRCCOPY); SelectObject(hdcMem, hOld); } - if (!res) { DeleteObject(hXorBits); hXorBits = 0; } - } - } else { + if (!res) { DeleteObject(hXorBits); hXorBits = 0; } + } + } else { if (is_dib_monochrome(bmi)) { hXorBits = CreateBitmap(width, height, 1, 1, NULL); SetDIBits(screen_dc, hXorBits, 0, height, (char*)bmi + size, pInfo, DIB_RGB_COLORS); } - else + else hXorBits = CreateDIBitmap(screen_dc, &pInfo->bmiHeader, CBM_INIT, (char*)bmi + size, pInfo, DIB_RGB_COLORS); - } + } - if( hXorBits ) - { - char* xbits = (char *)bmi + size + + if( hXorBits ) + { + char* xbits = (char *)bmi + size + get_dib_width_bytes( bmi->bmiHeader.biWidth, bmi->bmiHeader.biBitCount ) * abs( bmi->bmiHeader.biHeight ) / 2; - pInfo->bmiHeader.biBitCount = 1; - if (pInfo->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) - { - RGBQUAD *rgb = pInfo->bmiColors; - - pInfo->bmiHeader.biClrUsed = pInfo->bmiHeader.biClrImportant = 2; - rgb[0].rgbBlue = rgb[0].rgbGreen = rgb[0].rgbRed = 0x00; - rgb[1].rgbBlue = rgb[1].rgbGreen = rgb[1].rgbRed = 0xff; - rgb[0].rgbReserved = rgb[1].rgbReserved = 0; - } - else - { - RGBTRIPLE *rgb = (RGBTRIPLE *)(((BITMAPCOREHEADER *)pInfo) + 1); - - rgb[0].rgbtBlue = rgb[0].rgbtGreen = rgb[0].rgbtRed = 0x00; - rgb[1].rgbtBlue = rgb[1].rgbtGreen = rgb[1].rgbtRed = 0xff; - } - - /* Create the AND bitmap */ - - if (DoStretch) { - if ((hAndBits = CreateBitmap(width, height, 1, 1, NULL))) { - HBITMAP hOld; + pInfo->bmiHeader.biBitCount = 1; + if (pInfo->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) + { + RGBQUAD *rgb = pInfo->bmiColors; + + pInfo->bmiHeader.biClrUsed = pInfo->bmiHeader.biClrImportant = 2; + rgb[0].rgbBlue = rgb[0].rgbGreen = rgb[0].rgbRed = 0x00; + rgb[1].rgbBlue = rgb[1].rgbGreen = rgb[1].rgbRed = 0xff; + rgb[0].rgbReserved = rgb[1].rgbReserved = 0; + } + else + { + RGBTRIPLE *rgb = (RGBTRIPLE *)(((BITMAPCOREHEADER *)pInfo) + 1); + + rgb[0].rgbtBlue = rgb[0].rgbtGreen = rgb[0].rgbtRed = 0x00; + rgb[1].rgbtBlue = rgb[1].rgbtGreen = rgb[1].rgbtRed = 0xff; + } + + /* Create the AND bitmap */ + + if (DoStretch) { + if ((hAndBits = CreateBitmap(width, height, 1, 1, NULL))) { + HBITMAP hOld; BOOL res = FALSE; if (!hdcMem) hdcMem = CreateCompatibleDC(screen_dc); @@ -817,25 +817,25 @@ static HICON CURSORICON_CreateFromResource( HMODULE16 hModule, HGLOBAL16 hObj, L xbits, pInfo, DIB_RGB_COLORS, SRCCOPY); SelectObject(hdcMem, hOld); } - if (!res) { DeleteObject(hAndBits); hAndBits = 0; } - } - } else { + if (!res) { DeleteObject(hAndBits); hAndBits = 0; } + } + } else { hAndBits = CreateBitmap(width, height, 1, 1, NULL); - + if (hAndBits) SetDIBits(screen_dc, hAndBits, 0, height, xbits, pInfo, DIB_RGB_COLORS); - } - if( !hAndBits ) DeleteObject( hXorBits ); - } - HeapFree( GetProcessHeap(), 0, pInfo ); - } + } + if( !hAndBits ) DeleteObject( hXorBits ); + } + HeapFree( GetProcessHeap(), 0, pInfo ); + } } if( !hXorBits || !hAndBits ) { - WARN_(cursor)("\tunable to create an icon bitmap.\n"); - return 0; + WARN_(cursor)("\tunable to create an icon bitmap.\n"); + return 0; } /* Now create the CURSORICONINFO structure */ @@ -845,31 +845,31 @@ static HICON CURSORICON_CreateFromResource( HMODULE16 hModule, HGLOBAL16 hObj, L sizeAnd = bmpAnd.bmHeight * bmpAnd.bmWidthBytes; if (hObj) hObj = GlobalReAlloc16( hObj, - sizeof(CURSORICONINFO) + sizeXor + sizeAnd, GMEM_MOVEABLE ); + sizeof(CURSORICONINFO) + sizeXor + sizeAnd, GMEM_MOVEABLE ); if (!hObj) hObj = GlobalAlloc16( GMEM_MOVEABLE, - sizeof(CURSORICONINFO) + sizeXor + sizeAnd ); + sizeof(CURSORICONINFO) + sizeXor + sizeAnd ); if (hObj) { - CURSORICONINFO *info; + CURSORICONINFO *info; - /* Make it owned by the module */ + /* Make it owned by the module */ if (hModule) hModule = GetExePtr(hModule); FarSetOwner16( hObj, hModule ); - info = (CURSORICONINFO *)GlobalLock16( hObj ); - info->ptHotSpot.x = hotspot.x; - info->ptHotSpot.y = hotspot.y; - info->nWidth = bmpXor.bmWidth; - info->nHeight = bmpXor.bmHeight; - info->nWidthBytes = bmpXor.bmWidthBytes; - info->bPlanes = bmpXor.bmPlanes; - info->bBitsPerPixel = bmpXor.bmBitsPixel; + info = (CURSORICONINFO *)GlobalLock16( hObj ); + info->ptHotSpot.x = hotspot.x; + info->ptHotSpot.y = hotspot.y; + info->nWidth = bmpXor.bmWidth; + info->nHeight = bmpXor.bmHeight; + info->nWidthBytes = bmpXor.bmWidthBytes; + info->bPlanes = bmpXor.bmPlanes; + info->bBitsPerPixel = bmpXor.bmBitsPixel; - /* Transfer the bitmap bits to the CURSORICONINFO structure */ + /* Transfer the bitmap bits to the CURSORICONINFO structure */ - GetBitmapBits( hAndBits, sizeAnd, (char *)(info + 1) ); - GetBitmapBits( hXorBits, sizeXor, (char *)(info + 1) + sizeAnd ); - GlobalUnlock16( hObj ); + GetBitmapBits( hAndBits, sizeAnd, (char *)(info + 1) ); + GetBitmapBits( hXorBits, sizeXor, (char *)(info + 1) + sizeAnd ); + GlobalUnlock16( hObj ); } DeleteObject( hAndBits ); @@ -906,8 +906,8 @@ HICON WINAPI CreateIconFromResourceEx( LPBYTE bits, UINT cbSize, * Load a cursor or icon from resource or file. */ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name, - INT width, INT height, INT colors, - BOOL fCursor, UINT loadflags) + INT width, INT height, INT colors, + BOOL fCursor, UINT loadflags) { HANDLE handle = 0; HICON hIcon = 0; @@ -933,7 +933,7 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name, } else /* Load from resource */ { - HRSRC hGroupRsrc; + HRSRC hGroupRsrc; WORD wResId; DWORD dwBytesInRes; @@ -949,7 +949,7 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name, if (!(hRsrc = FindResourceW( hInstance, name, (LPWSTR)(fCursor ? RT_GROUP_CURSOR : RT_GROUP_ICON) ))) return 0; - hGroupRsrc = hRsrc; + hGroupRsrc = hRsrc; /* Find the best entry in the directory */ @@ -1039,8 +1039,8 @@ static HICON CURSORICON_Copy( HINSTANCE16 hInst16, HICON hIcon ) */ static HICON CURSORICON_ExtCopy(HICON hIcon, UINT nType, - INT iDesiredCX, INT iDesiredCY, - UINT nFlags) + INT iDesiredCX, INT iDesiredCY, + UINT nFlags) { HICON hNew=0; @@ -1049,7 +1049,7 @@ static HICON CURSORICON_ExtCopy(HICON hIcon, UINT nType, if(hIcon == 0) { - return 0; + return 0; } /* Best Fit or Monochrome */ @@ -1139,11 +1139,11 @@ static HICON CURSORICON_ExtCopy(HICON hIcon, UINT nType, pBits = (LPBYTE)LockResource( hMem ); - if(nFlags & LR_DEFAULTSIZE) - { - iTargetCY = GetSystemMetrics(SM_CYICON); + if(nFlags & LR_DEFAULTSIZE) + { + iTargetCY = GetSystemMetrics(SM_CYICON); iTargetCX = GetSystemMetrics(SM_CXICON); - } + } /* Create a New Icon with the proper dimension */ @@ -1293,7 +1293,7 @@ HICON WINAPI CreateIcon( iinfo.hbmColor = CreateDIBitmap( hdc, &bmi.bmiHeader, CBM_INIT, lpXORbits, &bmi, DIB_RGB_COLORS ); - + hIcon=CreateIconIndirect(&iinfo); DeleteObject(iinfo.hbmMask); DeleteObject(iinfo.hbmColor); @@ -1563,7 +1563,7 @@ BOOL WINAPI GetClipCursor( RECT *rect ) * FIXME: exact parameter sizes */ INT16 WINAPI LookupIconIdFromDirectoryEx16( LPBYTE dir, BOOL16 bIcon, - INT16 width, INT16 height, UINT16 cFlag ) + INT16 width, INT16 height, UINT16 cFlag ) { return LookupIconIdFromDirectoryEx( dir, bIcon, width, height, cFlag ); } @@ -1574,55 +1574,55 @@ INT16 WINAPI LookupIconIdFromDirectoryEx16( LPBYTE dir, BOOL16 bIcon, INT WINAPI LookupIconIdFromDirectoryEx( LPBYTE xdir, BOOL bIcon, INT width, INT height, UINT cFlag ) { - CURSORICONDIR *dir = (CURSORICONDIR*)xdir; + CURSORICONDIR *dir = (CURSORICONDIR*)xdir; UINT retVal = 0; if( dir && !dir->idReserved && (dir->idType & 3) ) { - CURSORICONDIRENTRY* entry; - HDC hdc; - UINT palEnts; - int colors; - hdc = GetDC(0); - palEnts = GetSystemPaletteEntries(hdc, 0, 0, NULL); - if (palEnts == 0) - palEnts = 256; - colors = (cFlag & LR_MONOCHROME) ? 2 : palEnts; - - ReleaseDC(0, hdc); - - if( bIcon ) - entry = CURSORICON_FindBestIcon( dir, width, height, colors ); - else - entry = CURSORICON_FindBestCursor( dir, width, height, 1); + CURSORICONDIRENTRY* entry; + HDC hdc; + UINT palEnts; + int colors; + hdc = GetDC(0); + palEnts = GetSystemPaletteEntries(hdc, 0, 0, NULL); + if (palEnts == 0) + palEnts = 256; + colors = (cFlag & LR_MONOCHROME) ? 2 : palEnts; + + ReleaseDC(0, hdc); + + if( bIcon ) + entry = CURSORICON_FindBestIcon( dir, width, height, colors ); + else + entry = CURSORICON_FindBestCursor( dir, width, height, 1); - if( entry ) retVal = entry->wResId; + if( entry ) retVal = entry->wResId; } else WARN_(cursor)("invalid resource directory\n"); return retVal; } /********************************************************************** - * LookupIconIdFromDirectory (USER.?) + * LookupIconIdFromDirectory (USER.?) */ INT16 WINAPI LookupIconIdFromDirectory16( LPBYTE dir, BOOL16 bIcon ) { return LookupIconIdFromDirectoryEx16( dir, bIcon, - bIcon ? GetSystemMetrics(SM_CXICON) : GetSystemMetrics(SM_CXCURSOR), - bIcon ? GetSystemMetrics(SM_CYICON) : GetSystemMetrics(SM_CYCURSOR), bIcon ? 0 : LR_MONOCHROME ); + bIcon ? GetSystemMetrics(SM_CXICON) : GetSystemMetrics(SM_CXCURSOR), + bIcon ? GetSystemMetrics(SM_CYICON) : GetSystemMetrics(SM_CYCURSOR), bIcon ? 0 : LR_MONOCHROME ); } /********************************************************************** - * LookupIconIdFromDirectory (USER32.@) + * LookupIconIdFromDirectory (USER32.@) */ INT WINAPI LookupIconIdFromDirectory( LPBYTE dir, BOOL bIcon ) { return LookupIconIdFromDirectoryEx( dir, bIcon, - bIcon ? GetSystemMetrics(SM_CXICON) : GetSystemMetrics(SM_CXCURSOR), - bIcon ? GetSystemMetrics(SM_CYICON) : GetSystemMetrics(SM_CYCURSOR), bIcon ? 0 : LR_MONOCHROME ); + bIcon ? GetSystemMetrics(SM_CXICON) : GetSystemMetrics(SM_CXCURSOR), + bIcon ? GetSystemMetrics(SM_CYICON) : GetSystemMetrics(SM_CYCURSOR), bIcon ? 0 : LR_MONOCHROME ); } /********************************************************************** - * GetIconID (USER.455) + * GetIconID (USER.455) */ WORD WINAPI GetIconID16( HGLOBAL16 hResource, DWORD resType ) { @@ -1633,32 +1633,32 @@ WORD WINAPI GetIconID16( HGLOBAL16 hResource, DWORD resType ) switch(resType) { - case RT_CURSOR: - return (WORD)LookupIconIdFromDirectoryEx16( lpDir, FALSE, - GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR), LR_MONOCHROME ); - case RT_ICON: - return (WORD)LookupIconIdFromDirectoryEx16( lpDir, TRUE, - GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0 ); - default: - WARN_(cursor)("invalid res type %ld\n", resType ); + case RT_CURSOR: + return (WORD)LookupIconIdFromDirectoryEx16( lpDir, FALSE, + GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR), LR_MONOCHROME ); + case RT_ICON: + return (WORD)LookupIconIdFromDirectoryEx16( lpDir, TRUE, + GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0 ); + default: + WARN_(cursor)("invalid res type %ld\n", resType ); } return 0; } /********************************************************************** - * LoadCursorIconHandler (USER.336) + * LoadCursorIconHandler (USER.336) * * Supposed to load resources of Windows 2.x applications. */ HGLOBAL16 WINAPI LoadCursorIconHandler16( HGLOBAL16 hResource, HMODULE16 hModule, HRSRC16 hRsrc ) { FIXME_(cursor)("(%04x,%04x,%04x): old 2.x resources are not supported!\n", - hResource, hModule, hRsrc); + hResource, hModule, hRsrc); return (HGLOBAL16)0; } /********************************************************************** - * LoadDIBIconHandler (USER.357) + * LoadDIBIconHandler (USER.357) * * RT_ICON resource loader, installed by USER_SignalProc when module * is initialized. @@ -1674,12 +1674,12 @@ HGLOBAL16 WINAPI LoadDIBIconHandler16( HGLOBAL16 hMemObj, HMODULE16 hModule, HRS hMemObj = NE_DefResourceHandler( hMemObj, hModule, hRsrc ); if( hMemObj ) { - LPBYTE bits = (LPBYTE)GlobalLock16( hMemObj ); - hMemObj = HICON_16(CURSORICON_CreateFromResource( - hModule, hMemObj, bits, - SizeofResource16(hModule, hRsrc), TRUE, 0x00030000, - GetSystemMetrics(SM_CXICON), - GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR)); + LPBYTE bits = (LPBYTE)GlobalLock16( hMemObj ); + hMemObj = HICON_16(CURSORICON_CreateFromResource( + hModule, hMemObj, bits, + SizeofResource16(hModule, hRsrc), TRUE, 0x00030000, + GetSystemMetrics(SM_CXICON), + GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR)); } return hMemObj; } @@ -1694,18 +1694,18 @@ HGLOBAL16 WINAPI LoadDIBCursorHandler16( HGLOBAL16 hMemObj, HMODULE16 hModule, H hMemObj = NE_DefResourceHandler( hMemObj, hModule, hRsrc ); if( hMemObj ) { - LPBYTE bits = (LPBYTE)GlobalLock16( hMemObj ); - hMemObj = HICON_16(CURSORICON_CreateFromResource( - hModule, hMemObj, bits, - SizeofResource16(hModule, hRsrc), FALSE, 0x00030000, - GetSystemMetrics(SM_CXCURSOR), - GetSystemMetrics(SM_CYCURSOR), LR_MONOCHROME)); + LPBYTE bits = (LPBYTE)GlobalLock16( hMemObj ); + hMemObj = HICON_16(CURSORICON_CreateFromResource( + hModule, hMemObj, bits, + SizeofResource16(hModule, hRsrc), FALSE, 0x00030000, + GetSystemMetrics(SM_CXCURSOR), + GetSystemMetrics(SM_CYCURSOR), LR_MONOCHROME)); } return hMemObj; } /********************************************************************** - * LoadIconHandler (USER.456) + * LoadIconHandler (USER.456) */ HICON16 WINAPI LoadIconHandler16( HGLOBAL16 hResource, BOOL16 bNew ) { @@ -1714,11 +1714,11 @@ HICON16 WINAPI LoadIconHandler16( HGLOBAL16 hResource, BOOL16 bNew ) TRACE_(cursor)("hRes=%04x\n",hResource); return HICON_16(CURSORICON_CreateFromResource(0, 0, bits, 0, TRUE, - bNew ? 0x00030000 : 0x00020000, 0, 0, LR_DEFAULTCOLOR)); + bNew ? 0x00030000 : 0x00020000, 0, 0, LR_DEFAULTCOLOR)); } /*********************************************************************** - * LoadCursorW (USER32.@) + * LoadCursorW (USER32.@) */ HCURSOR WINAPI LoadCursorW(HINSTANCE hInstance, LPCWSTR name) { @@ -1763,7 +1763,7 @@ HICON WINAPI LoadIconW(HINSTANCE hInstance, LPCWSTR name) } /*********************************************************************** - * LoadIconA (USER32.@) + * LoadIconA (USER32.@) */ HICON WINAPI LoadIconA(HINSTANCE hInstance, LPCSTR name) { @@ -1772,19 +1772,19 @@ HICON WINAPI LoadIconA(HINSTANCE hInstance, LPCSTR name) } /********************************************************************** - * GetIconInfo (USER32.@) + * GetIconInfo (USER32.@) */ BOOL WINAPI GetIconInfo(HICON hIcon, PICONINFO iconinfo) { - CURSORICONINFO *ciconinfo; + CURSORICONINFO *ciconinfo; INT height; ciconinfo = GlobalLock16(HICON_16(hIcon)); if (!ciconinfo) - return FALSE; + return FALSE; if ( (ciconinfo->ptHotSpot.x == ICON_HOTSPOT) && - (ciconinfo->ptHotSpot.y == ICON_HOTSPOT) ) + (ciconinfo->ptHotSpot.y == ICON_HOTSPOT) ) { iconinfo->fIcon = TRUE; iconinfo->xHotspot = ciconinfo->nWidth / 2; @@ -1836,36 +1836,36 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo) sizeAnd = bmpAnd.bmHeight * bmpAnd.bmWidthBytes; hObj = GlobalAlloc16( GMEM_MOVEABLE, - sizeof(CURSORICONINFO) + sizeXor + sizeAnd ); + sizeof(CURSORICONINFO) + sizeXor + sizeAnd ); if (hObj) { - CURSORICONINFO *info; - - info = (CURSORICONINFO *)GlobalLock16( hObj ); - - /* If we are creating an icon, the hotspot is unused */ - if (iconinfo->fIcon) - { - info->ptHotSpot.x = ICON_HOTSPOT; - info->ptHotSpot.y = ICON_HOTSPOT; - } - else - { - info->ptHotSpot.x = iconinfo->xHotspot; - info->ptHotSpot.y = iconinfo->yHotspot; - } - - info->nWidth = bmpXor.bmWidth; - info->nHeight = bmpXor.bmHeight; - info->nWidthBytes = bmpXor.bmWidthBytes; - info->bPlanes = bmpXor.bmPlanes; - info->bBitsPerPixel = bmpXor.bmBitsPixel; - - /* Transfer the bitmap bits to the CURSORICONINFO structure */ - - GetBitmapBits( iconinfo->hbmMask ,sizeAnd,(char*)(info + 1) ); - GetBitmapBits( iconinfo->hbmColor,sizeXor,(char*)(info + 1) +sizeAnd); - GlobalUnlock16( hObj ); + CURSORICONINFO *info; + + info = (CURSORICONINFO *)GlobalLock16( hObj ); + + /* If we are creating an icon, the hotspot is unused */ + if (iconinfo->fIcon) + { + info->ptHotSpot.x = ICON_HOTSPOT; + info->ptHotSpot.y = ICON_HOTSPOT; + } + else + { + info->ptHotSpot.x = iconinfo->xHotspot; + info->ptHotSpot.y = iconinfo->yHotspot; + } + + info->nWidth = bmpXor.bmWidth; + info->nHeight = bmpXor.bmHeight; + info->nWidthBytes = bmpXor.bmWidthBytes; + info->bPlanes = bmpXor.bmPlanes; + info->bBitsPerPixel = bmpXor.bmBitsPixel; + + /* Transfer the bitmap bits to the CURSORICONINFO structure */ + + GetBitmapBits( iconinfo->hbmMask ,sizeAnd,(char*)(info + 1) ); + GetBitmapBits( iconinfo->hbmColor,sizeXor,(char*)(info + 1) +sizeAnd); + GlobalUnlock16( hObj ); } return HICON_32(hObj); } @@ -1911,97 +1911,97 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon, FIXME_(icon)("Ignoring flag DI_COMPAT\n"); if (!flags) { - FIXME_(icon)("no flags set? setting to DI_NORMAL\n"); - flags = DI_NORMAL; + FIXME_(icon)("no flags set? setting to DI_NORMAL\n"); + flags = DI_NORMAL; } /* Calculate the size of the destination image. */ if (cxWidth == 0) { - if (flags & DI_DEFAULTSIZE) - cxWidth = GetSystemMetrics (SM_CXICON); - else - cxWidth = ptr->nWidth; + if (flags & DI_DEFAULTSIZE) + cxWidth = GetSystemMetrics (SM_CXICON); + else + cxWidth = ptr->nWidth; } if (cyWidth == 0) { - if (flags & DI_DEFAULTSIZE) - cyWidth = GetSystemMetrics (SM_CYICON); - else - cyWidth = ptr->nHeight; + if (flags & DI_DEFAULTSIZE) + cyWidth = GetSystemMetrics (SM_CYICON); + else + cyWidth = ptr->nHeight; } DoOffscreen = (GetObjectType( hbr ) == OBJ_BRUSH); if (DoOffscreen) { - RECT r; - - r.left = 0; - r.top = 0; - r.right = cxWidth; - r.bottom = cxWidth; - - hDC_off = CreateCompatibleDC(hdc); - hB_off = CreateCompatibleBitmap(hdc, cxWidth, cyWidth); - if (hDC_off && hB_off) { - hOld = SelectObject(hDC_off, hB_off); - FillRect(hDC_off, &r, hbr); - } + RECT r; + + r.left = 0; + r.top = 0; + r.right = cxWidth; + r.bottom = cxWidth; + + hDC_off = CreateCompatibleDC(hdc); + hB_off = CreateCompatibleBitmap(hdc, cxWidth, cyWidth); + if (hDC_off && hB_off) { + hOld = SelectObject(hDC_off, hB_off); + FillRect(hDC_off, &r, hbr); + } } if (hMemDC && (!DoOffscreen || (hDC_off && hB_off))) { - HBITMAP hXorBits, hAndBits; - COLORREF oldFg, oldBg; - INT nStretchMode; - - nStretchMode = SetStretchBltMode (hdc, STRETCH_DELETESCANS); - - hXorBits = CreateBitmap ( ptr->nWidth, ptr->nHeight, - ptr->bPlanes, ptr->bBitsPerPixel, - (char *)(ptr + 1) - + ptr->nHeight * - get_bitmap_width_bytes(ptr->nWidth,1) ); - hAndBits = CreateBitmap ( ptr->nWidth, ptr->nHeight, - 1, 1, (char *)(ptr+1) ); - oldFg = SetTextColor( hdc, RGB(0,0,0) ); - oldBg = SetBkColor( hdc, RGB(255,255,255) ); - - if (hXorBits && hAndBits) - { - HBITMAP hBitTemp = SelectObject( hMemDC, hAndBits ); - if (flags & DI_MASK) + HBITMAP hXorBits, hAndBits; + COLORREF oldFg, oldBg; + INT nStretchMode; + + nStretchMode = SetStretchBltMode (hdc, STRETCH_DELETESCANS); + + hXorBits = CreateBitmap ( ptr->nWidth, ptr->nHeight, + ptr->bPlanes, ptr->bBitsPerPixel, + (char *)(ptr + 1) + + ptr->nHeight * + get_bitmap_width_bytes(ptr->nWidth,1) ); + hAndBits = CreateBitmap ( ptr->nWidth, ptr->nHeight, + 1, 1, (char *)(ptr+1) ); + oldFg = SetTextColor( hdc, RGB(0,0,0) ); + oldBg = SetBkColor( hdc, RGB(255,255,255) ); + + if (hXorBits && hAndBits) + { + HBITMAP hBitTemp = SelectObject( hMemDC, hAndBits ); + if (flags & DI_MASK) { - if (DoOffscreen) - StretchBlt (hDC_off, 0, 0, cxWidth, cyWidth, - hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCAND); - else - StretchBlt (hdc, x0, y0, cxWidth, cyWidth, - hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCAND); + if (DoOffscreen) + StretchBlt (hDC_off, 0, 0, cxWidth, cyWidth, + hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCAND); + else + StretchBlt (hdc, x0, y0, cxWidth, cyWidth, + hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCAND); } - SelectObject( hMemDC, hXorBits ); - if (flags & DI_IMAGE) + SelectObject( hMemDC, hXorBits ); + if (flags & DI_IMAGE) { - if (DoOffscreen) - StretchBlt (hDC_off, 0, 0, cxWidth, cyWidth, - hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCPAINT); - else - StretchBlt (hdc, x0, y0, cxWidth, cyWidth, - hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCPAINT); + if (DoOffscreen) + StretchBlt (hDC_off, 0, 0, cxWidth, cyWidth, + hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCPAINT); + else + StretchBlt (hdc, x0, y0, cxWidth, cyWidth, + hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCPAINT); } - SelectObject( hMemDC, hBitTemp ); - result = TRUE; - } - - SetTextColor( hdc, oldFg ); - SetBkColor( hdc, oldBg ); - if (hXorBits) DeleteObject( hXorBits ); - if (hAndBits) DeleteObject( hAndBits ); - SetStretchBltMode (hdc, nStretchMode); - if (DoOffscreen) { - BitBlt(hdc, x0, y0, cxWidth, cyWidth, hDC_off, 0, 0, SRCCOPY); - SelectObject(hDC_off, hOld); - } + SelectObject( hMemDC, hBitTemp ); + result = TRUE; + } + + SetTextColor( hdc, oldFg ); + SetBkColor( hdc, oldBg ); + if (hXorBits) DeleteObject( hXorBits ); + if (hAndBits) DeleteObject( hAndBits ); + SetStretchBltMode (hdc, nStretchMode); + if (DoOffscreen) { + BitBlt(hdc, x0, y0, cxWidth, cyWidth, hDC_off, 0, 0, SRCCOPY); + SelectObject(hDC_off, hOld); + } } if (hMemDC) DeleteDC( hMemDC ); if (hDC_off) DeleteDC(hDC_off); @@ -2018,79 +2018,79 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon, */ static void DIB_FixColorsToLoadflags(BITMAPINFO * bmi, UINT loadflags, BYTE pix) { - int colors; - COLORREF c_W, c_S, c_F, c_L, c_C; - int incr,i; - RGBQUAD *ptr; - int bitmap_type; - LONG width; - LONG height; - WORD bpp; - DWORD compr; - - if (((bitmap_type = DIB_GetBitmapInfo((BITMAPINFOHEADER*) bmi, &width, &height, &bpp, &compr)) == -1)) - { - WARN_(resource)("Invalid bitmap\n"); - return; - } - - if (bpp > 8) return; - - if (bitmap_type == 0) /* BITMAPCOREHEADER */ - { - incr = 3; - colors = 1 << bpp; - } - else - { - incr = 4; - colors = bmi->bmiHeader.biClrUsed; - if (colors > 256) colors = 256; - if (!colors && (bpp <= 8)) colors = 1 << bpp; - } - - c_W = GetSysColor(COLOR_WINDOW); - c_S = GetSysColor(COLOR_3DSHADOW); - c_F = GetSysColor(COLOR_3DFACE); - c_L = GetSysColor(COLOR_3DLIGHT); - - if (loadflags & LR_LOADTRANSPARENT) { - switch (bpp) { - case 1: pix = pix >> 7; break; - case 4: pix = pix >> 4; break; - case 8: break; - default: - WARN_(resource)("(%d): Unsupported depth\n", bpp); - return; - } - if (pix >= colors) { - WARN_(resource)("pixel has color index greater than biClrUsed!\n"); - return; - } - if (loadflags & LR_LOADMAP3DCOLORS) c_W = c_F; - ptr = (RGBQUAD*)((char*)bmi->bmiColors+pix*incr); - ptr->rgbBlue = GetBValue(c_W); - ptr->rgbGreen = GetGValue(c_W); - ptr->rgbRed = GetRValue(c_W); - } - if (loadflags & LR_LOADMAP3DCOLORS) - for (i=0; ibmiColors+i*incr); - c_C = RGB(ptr->rgbRed, ptr->rgbGreen, ptr->rgbBlue); - if (c_C == RGB(128, 128, 128)) { - ptr->rgbRed = GetRValue(c_S); - ptr->rgbGreen = GetGValue(c_S); - ptr->rgbBlue = GetBValue(c_S); - } else if (c_C == RGB(192, 192, 192)) { - ptr->rgbRed = GetRValue(c_F); - ptr->rgbGreen = GetGValue(c_F); - ptr->rgbBlue = GetBValue(c_F); - } else if (c_C == RGB(223, 223, 223)) { - ptr->rgbRed = GetRValue(c_L); - ptr->rgbGreen = GetGValue(c_L); - ptr->rgbBlue = GetBValue(c_L); - } + int colors; + COLORREF c_W, c_S, c_F, c_L, c_C; + int incr,i; + RGBQUAD *ptr; + int bitmap_type; + LONG width; + LONG height; + WORD bpp; + DWORD compr; + + if (((bitmap_type = DIB_GetBitmapInfo((BITMAPINFOHEADER*) bmi, &width, &height, &bpp, &compr)) == -1)) + { + WARN_(resource)("Invalid bitmap\n"); + return; + } + + if (bpp > 8) return; + + if (bitmap_type == 0) /* BITMAPCOREHEADER */ + { + incr = 3; + colors = 1 << bpp; + } + else + { + incr = 4; + colors = bmi->bmiHeader.biClrUsed; + if (colors > 256) colors = 256; + if (!colors && (bpp <= 8)) colors = 1 << bpp; + } + + c_W = GetSysColor(COLOR_WINDOW); + c_S = GetSysColor(COLOR_3DSHADOW); + c_F = GetSysColor(COLOR_3DFACE); + c_L = GetSysColor(COLOR_3DLIGHT); + + if (loadflags & LR_LOADTRANSPARENT) { + switch (bpp) { + case 1: pix = pix >> 7; break; + case 4: pix = pix >> 4; break; + case 8: break; + default: + WARN_(resource)("(%d): Unsupported depth\n", bpp); + return; + } + if (pix >= colors) { + WARN_(resource)("pixel has color index greater than biClrUsed!\n"); + return; + } + if (loadflags & LR_LOADMAP3DCOLORS) c_W = c_F; + ptr = (RGBQUAD*)((char*)bmi->bmiColors+pix*incr); + ptr->rgbBlue = GetBValue(c_W); + ptr->rgbGreen = GetGValue(c_W); + ptr->rgbRed = GetRValue(c_W); } + if (loadflags & LR_LOADMAP3DCOLORS) + for (i=0; ibmiColors+i*incr); + c_C = RGB(ptr->rgbRed, ptr->rgbGreen, ptr->rgbBlue); + if (c_C == RGB(128, 128, 128)) { + ptr->rgbRed = GetRValue(c_S); + ptr->rgbGreen = GetGValue(c_S); + ptr->rgbBlue = GetBValue(c_S); + } else if (c_C == RGB(192, 192, 192)) { + ptr->rgbRed = GetRValue(c_F); + ptr->rgbGreen = GetGValue(c_F); + ptr->rgbBlue = GetBValue(c_F); + } else if (c_C == RGB(223, 223, 223)) { + ptr->rgbRed = GetRValue(c_L); + ptr->rgbGreen = GetGValue(c_L); + ptr->rgbBlue = GetBValue(c_L); + } + } } @@ -2109,17 +2109,17 @@ static HBITMAP BITMAP_Load( HINSTANCE instance, LPCWSTR name, UINT loadflags ) if (!(loadflags & LR_LOADFROMFILE)) { - if (!instance) - { - /* OEM bitmap: try to load the resource from user32.dll */ - if (HIWORD(name)) return 0; - instance = user32_module; - } + if (!instance) + { + /* OEM bitmap: try to load the resource from user32.dll */ + if (HIWORD(name)) return 0; + instance = user32_module; + } - if (!(hRsrc = FindResourceW( instance, name, (LPWSTR)RT_BITMAP ))) return 0; - if (!(handle = LoadResource( instance, hRsrc ))) return 0; + if (!(hRsrc = FindResourceW( instance, name, (LPWSTR)RT_BITMAP ))) return 0; + if (!(handle = LoadResource( instance, hRsrc ))) return 0; - if ((info = (BITMAPINFO *)LockResource( handle )) == NULL) return 0; + if ((info = (BITMAPINFO *)LockResource( handle )) == NULL) return 0; } else { @@ -2131,57 +2131,57 @@ static HBITMAP BITMAP_Load( HINSTANCE instance, LPCWSTR name, UINT loadflags ) if ((hFix = GlobalAlloc(0, size))) fix_info=GlobalLock(hFix); if (fix_info) { - BYTE pix; - - memcpy(fix_info, info, size); - pix = *((LPBYTE)info + size); - DIB_FixColorsToLoadflags(fix_info, loadflags, pix); - if (!screen_dc) screen_dc = CreateDCW( DISPLAYW, NULL, NULL, NULL ); - - if (screen_dc) - { - char *bits = (char *)info + size; - - if (loadflags & LR_CREATEDIBSECTION) { - DIBSECTION dib; - fix_info->bmiHeader.biCompression = 0; /* DIBSection can't be compressed */ - hbitmap = CreateDIBSection(screen_dc, fix_info, DIB_RGB_COLORS, NULL, 0, 0); - GetObjectA(hbitmap, sizeof(DIBSECTION), &dib); - SetDIBits(screen_dc, hbitmap, 0, dib.dsBm.bmHeight, bits, info, - DIB_RGB_COLORS); - } - else { - /* If it's possible, create a monochrome bitmap */ + BYTE pix; - LONG width; - LONG height; - WORD bpp; - DWORD compr; + memcpy(fix_info, info, size); + pix = *((LPBYTE)info + size); + DIB_FixColorsToLoadflags(fix_info, loadflags, pix); + if (!screen_dc) screen_dc = CreateDCW( DISPLAYW, NULL, NULL, NULL ); - if (DIB_GetBitmapInfo( &fix_info->bmiHeader, &width, &height, &bpp, &compr ) != -1) - { - if (width < 0) - TRACE("Bitmap has a negative width\n"); - else - { - /* Top-down DIBs have a negative height */ - if (height < 0) height = -height; + if (screen_dc) + { + char *bits = (char *)info + size; + + if (loadflags & LR_CREATEDIBSECTION) { + DIBSECTION dib; + fix_info->bmiHeader.biCompression = 0; /* DIBSection can't be compressed */ + hbitmap = CreateDIBSection(screen_dc, fix_info, DIB_RGB_COLORS, NULL, 0, 0); + GetObjectA(hbitmap, sizeof(DIBSECTION), &dib); + SetDIBits(screen_dc, hbitmap, 0, dib.dsBm.bmHeight, bits, info, + DIB_RGB_COLORS); + } + else { + /* If it's possible, create a monochrome bitmap */ - TRACE("width=%ld, height=%ld, bpp=%u, compr=%lu\n", width, height, bpp, compr); + LONG width; + LONG height; + WORD bpp; + DWORD compr; - if (is_dib_monochrome(fix_info)) - hbitmap = CreateBitmap(width, height, 1, 1, NULL); + if (DIB_GetBitmapInfo( &fix_info->bmiHeader, &width, &height, &bpp, &compr ) != -1) + { + if (width < 0) + TRACE("Bitmap has a negative width\n"); else - hbitmap = CreateCompatibleBitmap(screen_dc, width, height); + { + /* Top-down DIBs have a negative height */ + if (height < 0) height = -height; + + TRACE("width=%ld, height=%ld, bpp=%u, compr=%lu\n", width, height, bpp, compr); - SetDIBits(screen_dc, hbitmap, 0, height, bits, fix_info, DIB_RGB_COLORS); + if (is_dib_monochrome(fix_info)) + hbitmap = CreateBitmap(width, height, 1, 1, NULL); + else + hbitmap = CreateCompatibleBitmap(screen_dc, width, height); + + SetDIBits(screen_dc, hbitmap, 0, height, bits, fix_info, DIB_RGB_COLORS); + } } } - } - } + } - GlobalUnlock(hFix); - GlobalFree(hFix); + GlobalUnlock(hFix); + GlobalFree(hFix); } if (loadflags & LR_LOADFROMFILE) UnmapViewOfFile( ptr ); @@ -2199,7 +2199,7 @@ static HBITMAP BITMAP_Load( HINSTANCE instance, LPCWSTR name, UINT loadflags ) static WINE_EXCEPTION_FILTER(page_fault) { if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) - return EXCEPTION_EXECUTE_HANDLER; + return EXCEPTION_EXECUTE_HANDLER; return EXCEPTION_CONTINUE_SEARCH; } @@ -2220,8 +2220,8 @@ HANDLE WINAPI LoadImageA( HINSTANCE hinst, LPCSTR name, UINT type, MultiByteToWideChar( CP_ACP, 0, name, -1, u_name, len ); } __EXCEPT(page_fault) { - SetLastError( ERROR_INVALID_PARAMETER ); - return 0; + SetLastError( ERROR_INVALID_PARAMETER ); + return 0; } __ENDTRY res = LoadImageW(hinst, u_name, type, desiredx, desiredy, loadflags); @@ -2252,19 +2252,19 @@ HANDLE WINAPI LoadImageW( HINSTANCE hinst, LPCWSTR name, UINT type, { if (HIWORD(name)) { TRACE_(resource)("(%p,%p,%d,%d,%d,0x%08x)\n", - hinst,name,type,desiredx,desiredy,loadflags); + hinst,name,type,desiredx,desiredy,loadflags); } else { TRACE_(resource)("(%p,%p,%d,%d,%d,0x%08x)\n", - hinst,name,type,desiredx,desiredy,loadflags); + hinst,name,type,desiredx,desiredy,loadflags); } if (loadflags & LR_DEFAULTSIZE) { if (type == IMAGE_ICON) { - if (!desiredx) desiredx = GetSystemMetrics(SM_CXICON); - if (!desiredy) desiredy = GetSystemMetrics(SM_CYICON); - } else if (type == IMAGE_CURSOR) { + if (!desiredx) desiredx = GetSystemMetrics(SM_CXICON); + if (!desiredy) desiredy = GetSystemMetrics(SM_CYICON); + } else if (type == IMAGE_CURSOR) { if (!desiredx) desiredx = GetSystemMetrics(SM_CXCURSOR); - if (!desiredy) desiredy = GetSystemMetrics(SM_CYCURSOR); - } + if (!desiredy) desiredy = GetSystemMetrics(SM_CYCURSOR); + } } if (loadflags & LR_LOADFROMFILE) loadflags &= ~LR_SHARED; switch (type) { @@ -2284,7 +2284,7 @@ HANDLE WINAPI LoadImageW( HINSTANCE hinst, LPCWSTR name, UINT type, case IMAGE_CURSOR: return CURSORICON_Load(hinst, name, desiredx, desiredy, - 1, TRUE, loadflags); + 1, TRUE, loadflags); } return 0; } @@ -2311,7 +2311,7 @@ HICON WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx, { switch (type) { - case IMAGE_BITMAP: + case IMAGE_BITMAP: { HBITMAP res; BITMAP bm; @@ -2327,13 +2327,13 @@ HICON WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx, } return (HICON)res; } - case IMAGE_ICON: - return CURSORICON_ExtCopy(hnd,type, desiredx, desiredy, flags); - case IMAGE_CURSOR: - /* Should call CURSORICON_ExtCopy but more testing - * needs to be done before we change this - */ - return CopyCursor(hnd); + case IMAGE_ICON: + return CURSORICON_ExtCopy(hnd,type, desiredx, desiredy, flags); + case IMAGE_CURSOR: + /* Should call CURSORICON_ExtCopy but more testing + * needs to be done before we change this + */ + return CopyCursor(hnd); } return 0; } diff --git a/windows/defdlg.c b/dlls/user/defdlg.c similarity index 94% rename from windows/defdlg.c rename to dlls/user/defdlg.c index 09356f02e52..51694366ad0 100644 --- a/windows/defdlg.c +++ b/dlls/user/defdlg.c @@ -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 ) { diff --git a/windows/defwnd.c b/dlls/user/defwnd.c similarity index 82% rename from windows/defwnd.c rename to dlls/user/defwnd.c index 512d61facfc..e59e2b65302 100644 --- a/windows/defwnd.c +++ b/dlls/user/defwnd.c @@ -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; - - iF10Key = 0; - - if( wParam == VK_F4 ) /* try to close the window */ - { + if( HIWORD(lParam) & KEYDATA_ALT ) + { + /* if( HIWORD(lParam) & ~KEYDATA_PREVSTATE ) */ + if( wParam == VK_MENU && !iMenuSysKey ) + iMenuSysKey = 1; + else + iMenuSysKey = 0; + + iF10Key = 0; + + 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) - */ case WM_IME_CHAR: - { - 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; + { + 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; 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; - - hwndIME = DEFWND_ImmGetDefaultIMEWnd( hwnd ); - if (hwndIME) - result = SendMessageA( hwndIME, msg, wParam, lParam ); - } - break; + { + HWND hwndIME; + + 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) - */ 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; - - hwndIME = DEFWND_ImmGetDefaultIMEWnd( hwnd ); - if (hwndIME) - result = SendMessageW( hwndIME, msg, wParam, lParam ); - } - break; + { + HWND hwndIME; + + 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 */ diff --git a/windows/dialog.c b/dlls/user/dialog.c similarity index 98% rename from windows/dialog.c rename to dlls/user/dialog.c index c6e733a6d63..119c051df8b 100644 --- a/windows/dialog.c +++ b/dlls/user/dialog.c @@ -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,9 +634,9 @@ 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 will be valid only after WM_CREATE message has been handled in DefDlgProc All the members of the structure get filled here using temp variables */ @@ -649,7 +649,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, dlgInfo->idResult = 0; dlgInfo->flags = flags; dlgInfo->hDialogHeap = 0; - + if (template.helpId) SetWindowContextHelpId( hwnd, template.helpId ); if (unicode) SetWindowLongPtrW( hwnd, DWLP_DLGPROC, (ULONG_PTR)dlgProc ); @@ -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 ); } diff --git a/windows/input.c b/dlls/user/input.c similarity index 98% rename from windows/input.c rename to dlls/user/input.c index b2eaa6ce012..4decb81e343 100644 --- a/windows/input.c +++ b/dlls/user/input.c @@ -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 )); diff --git a/windows/mdi.c b/dlls/user/mdi.c similarity index 100% rename from windows/mdi.c rename to dlls/user/mdi.c diff --git a/windows/msgbox.c b/dlls/user/msgbox.c similarity index 100% rename from windows/msgbox.c rename to dlls/user/msgbox.c diff --git a/windows/nonclient.c b/dlls/user/nonclient.c similarity index 83% rename from windows/nonclient.c rename to dlls/user/nonclient.c index 2ef3c02fa7e..cba6da7a22e 100644 --- a/windows/nonclient.c +++ b/dlls/user/nonclient.c @@ -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}; - -#define SC_ABOUTWINE (SC_SCREENSAVE+1) -#define SC_PUTMARK (SC_SCREENSAVE+2) + 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) /* 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)); - - 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); - } + 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); + } } 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)); - - 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 (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 (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); + + 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 (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,13 +1448,13 @@ 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: { HMENU hSysMenu = GetSystemMenu(hwnd, FALSE); UINT 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 | MF_GRAYED)) || (state == 0xFFFFFFFF)) break; @@ -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); diff --git a/windows/spy.c b/dlls/user/spy.c similarity index 72% rename from windows/spy.c rename to dlls/user/spy.c index 0cbb5ed8903..b55e7555f81 100644 --- a/windows/spy.c +++ b/dlls/user/spy.c @@ -47,7 +47,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(message); static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = { - "WM_NULL", /* 0x00 */ + "WM_NULL", /* 0x00 */ "WM_CREATE", "WM_DESTROY", "WM_MOVE", @@ -63,7 +63,7 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_GETTEXT", "WM_GETTEXTLENGTH", "WM_PAINT", - "WM_CLOSE", /* 0x10 */ + "WM_CLOSE", /* 0x10 */ "WM_QUERYENDSESSION", "WM_QUIT", "WM_QUERYOPEN", @@ -79,7 +79,7 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_FONTCHANGE", "WM_TIMECHANGE", "WM_CANCELMODE", - "WM_SETCURSOR", /* 0x20 */ + "WM_SETCURSOR", /* 0x20 */ "WM_MOUSEACTIVATE", "WM_CHILDACTIVATE", "WM_QUEUESYNC", @@ -95,7 +95,7 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_DELETEITEM", "WM_VKEYTOITEM", "WM_CHARTOITEM", - "WM_SETFONT", /* 0x30 */ + "WM_SETFONT", /* 0x30 */ "WM_GETFONT", "WM_SETHOTKEY", "WM_GETHOTKEY", @@ -112,11 +112,11 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "wm_activateshellwindow", NULL, - NULL, /* 0x40 */ + NULL, /* 0x40 */ "wm_compacting", NULL, NULL, "WM_COMMNOTIFY", NULL, - "WM_WINDOWPOSCHANGING", /* 0x0046 */ - "WM_WINDOWPOSCHANGED", /* 0x0047 */ + "WM_WINDOWPOSCHANGING", /* 0x0046 */ + "WM_WINDOWPOSCHANGED", /* 0x0047 */ "WM_POWER", NULL, "WM_COPYDATA", "WM_CANCELJOURNAL", NULL, NULL, @@ -144,14 +144,14 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_DISPLAYCHANGE", "WM_GETICON", - "WM_SETICON", /* 0x0080 */ - "WM_NCCREATE", /* 0x0081 */ - "WM_NCDESTROY", /* 0x0082 */ - "WM_NCCALCSIZE", /* 0x0083 */ - "WM_NCHITTEST", /* 0x0084 */ - "WM_NCPAINT", /* 0x0085 */ - "WM_NCACTIVATE", /* 0x0086 */ - "WM_GETDLGCODE", /* 0x0087 */ + "WM_SETICON", /* 0x0080 */ + "WM_NCCREATE", /* 0x0081 */ + "WM_NCDESTROY", /* 0x0082 */ + "WM_NCCALCSIZE", /* 0x0083 */ + "WM_NCHITTEST", /* 0x0084 */ + "WM_NCPAINT", /* 0x0085 */ + "WM_NCACTIVATE", /* 0x0086 */ + "WM_GETDLGCODE", /* 0x0087 */ "WM_SYNCPAINT", "WM_SYNCTASK", NULL, NULL, NULL, NULL, NULL, NULL, @@ -246,32 +246,32 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "BM_SETIMAGE", /* 0x00f7 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - "WM_KEYDOWN", /* 0x0100 */ - "WM_KEYUP", /* 0x0101 */ - "WM_CHAR", /* 0x0102 */ - "WM_DEADCHAR", /* 0x0103 */ - "WM_SYSKEYDOWN", /* 0x0104 */ - "WM_SYSKEYUP", /* 0x0105 */ - "WM_SYSCHAR", /* 0x0106 */ - "WM_SYSDEADCHAR", /* 0x0107 */ - "WM_KEYLAST", /* 0x0108 */ + "WM_KEYDOWN", /* 0x0100 */ + "WM_KEYUP", /* 0x0101 */ + "WM_CHAR", /* 0x0102 */ + "WM_DEADCHAR", /* 0x0103 */ + "WM_SYSKEYDOWN", /* 0x0104 */ + "WM_SYSKEYUP", /* 0x0105 */ + "WM_SYSCHAR", /* 0x0106 */ + "WM_SYSDEADCHAR", /* 0x0107 */ + "WM_KEYLAST", /* 0x0108 */ NULL, "WM_CONVERTREQUEST", "WM_CONVERTRESULT", "WM_INTERIM", - "WM_IME_STARTCOMPOSITION", /* 0x010d */ - "WM_IME_ENDCOMPOSITION", /* 0x010e */ - "WM_IME_COMPOSITION", /* 0x010f */ - - "WM_INITDIALOG", /* 0x0110 */ - "WM_COMMAND", /* 0x0111 */ - "WM_SYSCOMMAND", /* 0x0112 */ - "WM_TIMER", /* 0x0113 */ - "WM_HSCROLL", /* 0x0114 */ - "WM_VSCROLL", /* 0x0115 */ + "WM_IME_STARTCOMPOSITION", /* 0x010d */ + "WM_IME_ENDCOMPOSITION", /* 0x010e */ + "WM_IME_COMPOSITION", /* 0x010f */ + + "WM_INITDIALOG", /* 0x0110 */ + "WM_COMMAND", /* 0x0111 */ + "WM_SYSCOMMAND", /* 0x0112 */ + "WM_TIMER", /* 0x0113 */ + "WM_HSCROLL", /* 0x0114 */ + "WM_VSCROLL", /* 0x0115 */ "WM_INITMENU", /* 0x0116 */ "WM_INITMENUPOPUP", /* 0x0117 */ - "WM_SYSTIMER", /* 0x0118 */ + "WM_SYSTIMER", /* 0x0118 */ NULL, NULL, NULL, NULL, NULL, NULL, "WM_MENUSELECT", /* 0x011f */ @@ -416,26 +416,26 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - "WM_MOUSEMOVE", /* 0x0200 */ - "WM_LBUTTONDOWN", /* 0x0201 */ - "WM_LBUTTONUP", /* 0x0202 */ - "WM_LBUTTONDBLCLK", /* 0x0203 */ - "WM_RBUTTONDOWN", /* 0x0204 */ - "WM_RBUTTONUP", /* 0x0205 */ - "WM_RBUTTONDBLCLK", /* 0x0206 */ - "WM_MBUTTONDOWN", /* 0x0207 */ - "WM_MBUTTONUP", /* 0x0208 */ - "WM_MBUTTONDBLCLK", /* 0x0209 */ + "WM_MOUSEMOVE", /* 0x0200 */ + "WM_LBUTTONDOWN", /* 0x0201 */ + "WM_LBUTTONUP", /* 0x0202 */ + "WM_LBUTTONDBLCLK", /* 0x0203 */ + "WM_RBUTTONDOWN", /* 0x0204 */ + "WM_RBUTTONUP", /* 0x0205 */ + "WM_RBUTTONDBLCLK", /* 0x0206 */ + "WM_MBUTTONDOWN", /* 0x0207 */ + "WM_MBUTTONUP", /* 0x0208 */ + "WM_MBUTTONDBLCLK", /* 0x0209 */ "WM_MOUSEWHEEL", /* 0x020A */ "WM_XBUTTONDOWN", /* 0x020B */ "WM_XBUTTONUP", /* 0x020C */ "WM_XBUTTONDBLCLK", /* 0x020D */ NULL, NULL, - "WM_PARENTNOTIFY", /* 0x0210 */ + "WM_PARENTNOTIFY", /* 0x0210 */ "WM_ENTERMENULOOP", /* 0x0211 */ "WM_EXITMENULOOP", /* 0x0212 */ - "WM_NEXTMENU", /* 0x0213 */ + "WM_NEXTMENU", /* 0x0213 */ "WM_SIZING", "WM_CAPTURECHANGED", "WM_MOVING", NULL, @@ -462,9 +462,9 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = /* 0x0230*/ "WM_MDISETMENU", /* 0x0230 */ - "WM_ENTERSIZEMOVE", /* 0x0231 */ - "WM_EXITSIZEMOVE", /* 0x0232 */ - "WM_DROPFILES", /* 0x0233 */ + "WM_ENTERSIZEMOVE", /* 0x0231 */ + "WM_EXITSIZEMOVE", /* 0x0232 */ + "WM_DROPFILES", /* 0x0233 */ "WM_MDIREFRESHMENU", NULL, NULL, NULL, /* 0x0238*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -549,7 +549,7 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - "WM_CUT", /* 0x0300 */ + "WM_CUT", /* 0x0300 */ "WM_COPY", "WM_PASTE", "WM_CLEAR", @@ -564,12 +564,12 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_ASKCBFORMATNAME", "WM_CHANGECBCHAIN", "WM_HSCROLLCLIPBOARD", - "WM_QUERYNEWPALETTE", /* 0x030f*/ + "WM_QUERYNEWPALETTE", /* 0x030f*/ "WM_PALETTEISCHANGING", "WM_PALETTECHANGED", - "WM_HOTKEY", /* 0x0312 */ - NULL, NULL, NULL, NULL, + "WM_HOTKEY", /* 0x0312 */ + NULL, NULL, NULL, NULL, "WM_PRINT", "WM_PRINTCLIENT", NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -668,14 +668,14 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = /* 0x03e0 */ "WM_DDE_INITIATE", /* 0x3E0 */ - "WM_DDE_TERMINATE", /* 0x3E1 */ - "WM_DDE_ADVISE", /* 0x3E2 */ - "WM_DDE_UNADVISE", /* 0x3E3 */ - "WM_DDE_ACK", /* 0x3E4 */ - "WM_DDE_DATA", /* 0x3E5 */ - "WM_DDE_REQUEST", /* 0x3E6 */ - "WM_DDE_POKE", /* 0x3E7 */ - "WM_DDE_EXECUTE", /* 0x3E8 */ + "WM_DDE_TERMINATE", /* 0x3E1 */ + "WM_DDE_ADVISE", /* 0x3E2 */ + "WM_DDE_UNADVISE", /* 0x3E3 */ + "WM_DDE_ACK", /* 0x3E4 */ + "WM_DDE_DATA", /* 0x3E5 */ + "WM_DDE_REQUEST", /* 0x3E6 */ + "WM_DDE_POKE", /* 0x3E7 */ + "WM_DDE_EXECUTE", /* 0x3E8 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -690,7 +690,7 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = #define SPY_MAX_LVMMSGNUM 140 static const char * const LVMMessageTypeNames[SPY_MAX_LVMMSGNUM + 1] = { - "LVM_GETBKCOLOR", /* 1000 */ + "LVM_GETBKCOLOR", /* 1000 */ "LVM_SETBKCOLOR", "LVM_GETIMAGELIST", "LVM_SETIMAGELIST", @@ -830,14 +830,14 @@ static const char * const LVMMessageTypeNames[SPY_MAX_LVMMSGNUM + 1] = NULL, NULL, "LVM_SETBKIMAGEW", - "LVM_GETBKIMAGEW" /* 0x108B */ + "LVM_GETBKIMAGEW" /* 0x108B */ }; #define SPY_MAX_TVMSGNUM 65 static const char * const TVMessageTypeNames[SPY_MAX_TVMSGNUM + 1] = { - "TVM_INSERTITEMA", /* 1100 */ + "TVM_INSERTITEMA", /* 1100 */ "TVM_DELETEITEM", "TVM_EXPAND", NULL, @@ -909,7 +909,7 @@ static const char * const TVMessageTypeNames[SPY_MAX_TVMSGNUM + 1] = #define SPY_MAX_HDMMSGNUM 19 static const char * const HDMMessageTypeNames[SPY_MAX_HDMMSGNUM + 1] = { - "HDM_GETITEMCOUNT", /* 1200 */ + "HDM_GETITEMCOUNT", /* 1200 */ "HDM_INSERTITEMA", "HDM_DELETEITEM", "HDM_GETITEMA", @@ -935,7 +935,7 @@ static const char * const HDMMessageTypeNames[SPY_MAX_HDMMSGNUM + 1] = #define SPY_MAX_TCMMSGNUM 62 static const char * const TCMMessageTypeNames[SPY_MAX_TCMMSGNUM + 1] = { - NULL, /* 1300 */ + NULL, /* 1300 */ NULL, "TCM_SETIMAGELIST", "TCM_GETIMAGELIST", @@ -1003,7 +1003,7 @@ static const char * const TCMMessageTypeNames[SPY_MAX_TCMMSGNUM + 1] = #define SPY_MAX_PGMMSGNUM 13 static const char * const PGMMessageTypeNames[SPY_MAX_PGMMSGNUM + 1] = { - NULL, /* 1400 */ + NULL, /* 1400 */ "PGM_SETCHILD", "PGM_RECALCSIZE", "PGM_FORWARDMOUSE", @@ -1023,7 +1023,7 @@ static const char * const PGMMessageTypeNames[SPY_MAX_PGMMSGNUM + 1] = #define SPY_MAX_CCMMSGNUM 9 static const char * const CCMMessageTypeNames[SPY_MAX_CCMMSGNUM + 1] = { - NULL, /* 0x2000 */ + NULL, /* 0x2000 */ "CCM_SETBKCOLOR", "CCM_SETCOLORSCHEME", "CCM_GETCOLORSCHEME", @@ -1050,262 +1050,262 @@ static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] = #define SPY_MAX_VKKEYSNUM 255 static const char * const VK_KeyNames[SPY_MAX_VKKEYSNUM + 1] = { - NULL, /* 0x00 */ - "VK_LBUTTON", /* 0x01 */ - "VK_RBUTTON", /* 0x02 */ - "VK_CANCEL", /* 0x03 */ - "VK_MBUTTON", /* 0x04 */ - "VK_XBUTTON1", /* 0x05 */ - "VK_XBUTTON2", /* 0x06 */ - NULL, /* 0x07 */ - "VK_BACK", /* 0x08 */ - "VK_TAB", /* 0x09 */ - NULL, /* 0x0A */ - NULL, /* 0x0B */ - "VK_CLEAR", /* 0x0C */ - "VK_RETURN", /* 0x0D */ - NULL, /* 0x0E */ - NULL, /* 0x0F */ - "VK_SHIFT", /* 0x10 */ - "VK_CONTROL", /* 0x11 */ - "VK_MENU", /* 0x12 */ - "VK_PAUSE", /* 0x13 */ - "VK_CAPITAL", /* 0x14 */ - NULL, /* 0x15 */ - NULL, /* 0x16 */ - NULL, /* 0x17 */ - NULL, /* 0x18 */ - NULL, /* 0x19 */ - NULL, /* 0x1A */ - "VK_ESCAPE", /* 0x1B */ - NULL, /* 0x1C */ - NULL, /* 0x1D */ - NULL, /* 0x1E */ - NULL, /* 0x1F */ - "VK_SPACE", /* 0x20 */ - "VK_PRIOR", /* 0x21 */ - "VK_NEXT", /* 0x22 */ - "VK_END", /* 0x23 */ - "VK_HOME", /* 0x24 */ - "VK_LEFT", /* 0x25 */ - "VK_UP", /* 0x26 */ - "VK_RIGHT", /* 0x27 */ - "VK_DOWN", /* 0x28 */ - "VK_SELECT", /* 0x29 */ - "VK_PRINT", /* 0x2A */ - "VK_EXECUTE", /* 0x2B */ - "VK_SNAPSHOT", /* 0x2C */ - "VK_INSERT", /* 0x2D */ - "VK_DELETE", /* 0x2E */ - "VK_HELP", /* 0x2F */ - "VK_0", /* 0x30 */ - "VK_1", /* 0x31 */ - "VK_2", /* 0x32 */ - "VK_3", /* 0x33 */ - "VK_4", /* 0x34 */ - "VK_5", /* 0x35 */ - "VK_6", /* 0x36 */ - "VK_7", /* 0x37 */ - "VK_8", /* 0x38 */ - "VK_9", /* 0x39 */ - NULL, /* 0x3A */ - NULL, /* 0x3B */ - NULL, /* 0x3C */ - NULL, /* 0x3D */ - NULL, /* 0x3E */ - NULL, /* 0x3F */ - NULL, /* 0x40 */ - "VK_A", /* 0x41 */ - "VK_B", /* 0x42 */ - "VK_C", /* 0x43 */ - "VK_D", /* 0x44 */ - "VK_E", /* 0x45 */ - "VK_F", /* 0x46 */ - "VK_G", /* 0x47 */ - "VK_H", /* 0x48 */ - "VK_I", /* 0x49 */ - "VK_J", /* 0x4A */ - "VK_K", /* 0x4B */ - "VK_L", /* 0x4C */ - "VK_M", /* 0x4D */ - "VK_N", /* 0x4E */ - "VK_O", /* 0x4F */ - "VK_P", /* 0x50 */ - "VK_Q", /* 0x51 */ - "VK_R", /* 0x52 */ - "VK_S", /* 0x53 */ - "VK_T", /* 0x54 */ - "VK_U", /* 0x55 */ - "VK_V", /* 0x56 */ - "VK_W", /* 0x57 */ - "VK_X", /* 0x58 */ - "VK_Y", /* 0x59 */ - "VK_Z", /* 0x5A */ - "VK_LWIN", /* 0x5B */ - "VK_RWIN", /* 0x5C */ - "VK_APPS", /* 0x5D */ - NULL, /* 0x5E */ - NULL, /* 0x5F */ - "VK_NUMPAD0", /* 0x60 */ - "VK_NUMPAD1", /* 0x61 */ - "VK_NUMPAD2", /* 0x62 */ - "VK_NUMPAD3", /* 0x63 */ - "VK_NUMPAD4", /* 0x64 */ - "VK_NUMPAD5", /* 0x65 */ - "VK_NUMPAD6", /* 0x66 */ - "VK_NUMPAD7", /* 0x67 */ - "VK_NUMPAD8", /* 0x68 */ - "VK_NUMPAD9", /* 0x69 */ - "VK_MULTIPLY", /* 0x6A */ - "VK_ADD", /* 0x6B */ - "VK_SEPARATOR", /* 0x6C */ - "VK_SUBTRACT", /* 0x6D */ - "VK_DECIMAL", /* 0x6E */ - "VK_DIVIDE", /* 0x6F */ - "VK_F1", /* 0x70 */ - "VK_F2", /* 0x71 */ - "VK_F3", /* 0x72 */ - "VK_F4", /* 0x73 */ - "VK_F5", /* 0x74 */ - "VK_F6", /* 0x75 */ - "VK_F7", /* 0x76 */ - "VK_F8", /* 0x77 */ - "VK_F9", /* 0x78 */ - "VK_F10", /* 0x79 */ - "VK_F11", /* 0x7A */ - "VK_F12", /* 0x7B */ - "VK_F13", /* 0x7C */ - "VK_F14", /* 0x7D */ - "VK_F15", /* 0x7E */ - "VK_F16", /* 0x7F */ - "VK_F17", /* 0x80 */ - "VK_F18", /* 0x81 */ - "VK_F19", /* 0x82 */ - "VK_F20", /* 0x83 */ - "VK_F21", /* 0x84 */ - "VK_F22", /* 0x85 */ - "VK_F23", /* 0x86 */ - "VK_F24", /* 0x87 */ - NULL, /* 0x88 */ - NULL, /* 0x89 */ - NULL, /* 0x8A */ - NULL, /* 0x8B */ - NULL, /* 0x8C */ - NULL, /* 0x8D */ - NULL, /* 0x8E */ - NULL, /* 0x8F */ - "VK_NUMLOCK", /* 0x90 */ - "VK_SCROLL", /* 0x91 */ - NULL, /* 0x92 */ - NULL, /* 0x93 */ - NULL, /* 0x94 */ - NULL, /* 0x95 */ - NULL, /* 0x96 */ - NULL, /* 0x97 */ - NULL, /* 0x98 */ - NULL, /* 0x99 */ - NULL, /* 0x9A */ - NULL, /* 0x9B */ - NULL, /* 0x9C */ - NULL, /* 0x9D */ - NULL, /* 0x9E */ - NULL, /* 0x9F */ - "VK_LSHIFT", /* 0xA0 */ - "VK_RSHIFT", /* 0xA1 */ - "VK_LCONTROL", /* 0xA2 */ - "VK_RCONTROL", /* 0xA3 */ - "VK_LMENU", /* 0xA4 */ - "VK_RMENU", /* 0xA5 */ - NULL, /* 0xA6 */ - NULL, /* 0xA7 */ - NULL, /* 0xA8 */ - NULL, /* 0xA9 */ - NULL, /* 0xAA */ - NULL, /* 0xAB */ - NULL, /* 0xAC */ - NULL, /* 0xAD */ - NULL, /* 0xAE */ - NULL, /* 0xAF */ - NULL, /* 0xB0 */ - NULL, /* 0xB1 */ - NULL, /* 0xB2 */ - NULL, /* 0xB3 */ - NULL, /* 0xB4 */ - NULL, /* 0xB5 */ - NULL, /* 0xB6 */ - NULL, /* 0xB7 */ - NULL, /* 0xB8 */ - NULL, /* 0xB9 */ - "VK_OEM_1", /* 0xBA */ - "VK_OEM_PLUS", /* 0xBB */ - "VK_OEM_COMMA", /* 0xBC */ - "VK_OEM_MINUS", /* 0xBD */ - "VK_OEM_PERIOD", /* 0xBE */ - "VK_OEM_2", /* 0xBF */ - "VK_OEM_3", /* 0xC0 */ - NULL, /* 0xC1 */ - NULL, /* 0xC2 */ - NULL, /* 0xC3 */ - NULL, /* 0xC4 */ - NULL, /* 0xC5 */ - NULL, /* 0xC6 */ - NULL, /* 0xC7 */ - NULL, /* 0xC8 */ - NULL, /* 0xC9 */ - NULL, /* 0xCA */ - NULL, /* 0xCB */ - NULL, /* 0xCC */ - NULL, /* 0xCD */ - NULL, /* 0xCE */ - NULL, /* 0xCF */ - NULL, /* 0xD0 */ - NULL, /* 0xD1 */ - NULL, /* 0xD2 */ - NULL, /* 0xD3 */ - NULL, /* 0xD4 */ - NULL, /* 0xD5 */ - NULL, /* 0xD6 */ - NULL, /* 0xD7 */ - NULL, /* 0xD8 */ - NULL, /* 0xD9 */ - NULL, /* 0xDA */ - "VK_OEM_4", /* 0xDB */ - "VK_OEM_5", /* 0xDC */ - "VK_OEM_6", /* 0xDD */ - "VK_OEM_7", /* 0xDE */ - "VK_OEM_8", /* 0xDF */ - NULL, /* 0xE0 */ - "VK_OEM_AX", /* 0xE1 */ - "VK_OEM_102", /* 0xE2 */ - "VK_ICO_HELP", /* 0xE3 */ - "VK_ICO_00", /* 0xE4 */ - "VK_PROCESSKEY", /* 0xE5 */ - NULL, /* 0xE6 */ - NULL, /* 0xE7 */ - NULL, /* 0xE8 */ - NULL, /* 0xE9 */ - NULL, /* 0xEA */ - NULL, /* 0xEB */ - NULL, /* 0xEC */ - NULL, /* 0xED */ - NULL, /* 0xEE */ - NULL, /* 0xEF */ - NULL, /* 0xF0 */ - NULL, /* 0xF1 */ - NULL, /* 0xF2 */ - NULL, /* 0xF3 */ - NULL, /* 0xF4 */ - NULL, /* 0xF5 */ - "VK_ATTN", /* 0xF6 */ - "VK_CRSEL", /* 0xF7 */ - "VK_EXSEL", /* 0xF8 */ - "VK_EREOF", /* 0xF9 */ - "VK_PLAY", /* 0xFA */ - "VK_ZOOM", /* 0xFB */ - "VK_NONAME", /* 0xFC */ - "VK_PA1", /* 0xFD */ - "VK_OEM_CLEAR", /* 0xFE */ - NULL /* 0xFF */ + NULL, /* 0x00 */ + "VK_LBUTTON", /* 0x01 */ + "VK_RBUTTON", /* 0x02 */ + "VK_CANCEL", /* 0x03 */ + "VK_MBUTTON", /* 0x04 */ + "VK_XBUTTON1", /* 0x05 */ + "VK_XBUTTON2", /* 0x06 */ + NULL, /* 0x07 */ + "VK_BACK", /* 0x08 */ + "VK_TAB", /* 0x09 */ + NULL, /* 0x0A */ + NULL, /* 0x0B */ + "VK_CLEAR", /* 0x0C */ + "VK_RETURN", /* 0x0D */ + NULL, /* 0x0E */ + NULL, /* 0x0F */ + "VK_SHIFT", /* 0x10 */ + "VK_CONTROL", /* 0x11 */ + "VK_MENU", /* 0x12 */ + "VK_PAUSE", /* 0x13 */ + "VK_CAPITAL", /* 0x14 */ + NULL, /* 0x15 */ + NULL, /* 0x16 */ + NULL, /* 0x17 */ + NULL, /* 0x18 */ + NULL, /* 0x19 */ + NULL, /* 0x1A */ + "VK_ESCAPE", /* 0x1B */ + NULL, /* 0x1C */ + NULL, /* 0x1D */ + NULL, /* 0x1E */ + NULL, /* 0x1F */ + "VK_SPACE", /* 0x20 */ + "VK_PRIOR", /* 0x21 */ + "VK_NEXT", /* 0x22 */ + "VK_END", /* 0x23 */ + "VK_HOME", /* 0x24 */ + "VK_LEFT", /* 0x25 */ + "VK_UP", /* 0x26 */ + "VK_RIGHT", /* 0x27 */ + "VK_DOWN", /* 0x28 */ + "VK_SELECT", /* 0x29 */ + "VK_PRINT", /* 0x2A */ + "VK_EXECUTE", /* 0x2B */ + "VK_SNAPSHOT", /* 0x2C */ + "VK_INSERT", /* 0x2D */ + "VK_DELETE", /* 0x2E */ + "VK_HELP", /* 0x2F */ + "VK_0", /* 0x30 */ + "VK_1", /* 0x31 */ + "VK_2", /* 0x32 */ + "VK_3", /* 0x33 */ + "VK_4", /* 0x34 */ + "VK_5", /* 0x35 */ + "VK_6", /* 0x36 */ + "VK_7", /* 0x37 */ + "VK_8", /* 0x38 */ + "VK_9", /* 0x39 */ + NULL, /* 0x3A */ + NULL, /* 0x3B */ + NULL, /* 0x3C */ + NULL, /* 0x3D */ + NULL, /* 0x3E */ + NULL, /* 0x3F */ + NULL, /* 0x40 */ + "VK_A", /* 0x41 */ + "VK_B", /* 0x42 */ + "VK_C", /* 0x43 */ + "VK_D", /* 0x44 */ + "VK_E", /* 0x45 */ + "VK_F", /* 0x46 */ + "VK_G", /* 0x47 */ + "VK_H", /* 0x48 */ + "VK_I", /* 0x49 */ + "VK_J", /* 0x4A */ + "VK_K", /* 0x4B */ + "VK_L", /* 0x4C */ + "VK_M", /* 0x4D */ + "VK_N", /* 0x4E */ + "VK_O", /* 0x4F */ + "VK_P", /* 0x50 */ + "VK_Q", /* 0x51 */ + "VK_R", /* 0x52 */ + "VK_S", /* 0x53 */ + "VK_T", /* 0x54 */ + "VK_U", /* 0x55 */ + "VK_V", /* 0x56 */ + "VK_W", /* 0x57 */ + "VK_X", /* 0x58 */ + "VK_Y", /* 0x59 */ + "VK_Z", /* 0x5A */ + "VK_LWIN", /* 0x5B */ + "VK_RWIN", /* 0x5C */ + "VK_APPS", /* 0x5D */ + NULL, /* 0x5E */ + NULL, /* 0x5F */ + "VK_NUMPAD0", /* 0x60 */ + "VK_NUMPAD1", /* 0x61 */ + "VK_NUMPAD2", /* 0x62 */ + "VK_NUMPAD3", /* 0x63 */ + "VK_NUMPAD4", /* 0x64 */ + "VK_NUMPAD5", /* 0x65 */ + "VK_NUMPAD6", /* 0x66 */ + "VK_NUMPAD7", /* 0x67 */ + "VK_NUMPAD8", /* 0x68 */ + "VK_NUMPAD9", /* 0x69 */ + "VK_MULTIPLY", /* 0x6A */ + "VK_ADD", /* 0x6B */ + "VK_SEPARATOR", /* 0x6C */ + "VK_SUBTRACT", /* 0x6D */ + "VK_DECIMAL", /* 0x6E */ + "VK_DIVIDE", /* 0x6F */ + "VK_F1", /* 0x70 */ + "VK_F2", /* 0x71 */ + "VK_F3", /* 0x72 */ + "VK_F4", /* 0x73 */ + "VK_F5", /* 0x74 */ + "VK_F6", /* 0x75 */ + "VK_F7", /* 0x76 */ + "VK_F8", /* 0x77 */ + "VK_F9", /* 0x78 */ + "VK_F10", /* 0x79 */ + "VK_F11", /* 0x7A */ + "VK_F12", /* 0x7B */ + "VK_F13", /* 0x7C */ + "VK_F14", /* 0x7D */ + "VK_F15", /* 0x7E */ + "VK_F16", /* 0x7F */ + "VK_F17", /* 0x80 */ + "VK_F18", /* 0x81 */ + "VK_F19", /* 0x82 */ + "VK_F20", /* 0x83 */ + "VK_F21", /* 0x84 */ + "VK_F22", /* 0x85 */ + "VK_F23", /* 0x86 */ + "VK_F24", /* 0x87 */ + NULL, /* 0x88 */ + NULL, /* 0x89 */ + NULL, /* 0x8A */ + NULL, /* 0x8B */ + NULL, /* 0x8C */ + NULL, /* 0x8D */ + NULL, /* 0x8E */ + NULL, /* 0x8F */ + "VK_NUMLOCK", /* 0x90 */ + "VK_SCROLL", /* 0x91 */ + NULL, /* 0x92 */ + NULL, /* 0x93 */ + NULL, /* 0x94 */ + NULL, /* 0x95 */ + NULL, /* 0x96 */ + NULL, /* 0x97 */ + NULL, /* 0x98 */ + NULL, /* 0x99 */ + NULL, /* 0x9A */ + NULL, /* 0x9B */ + NULL, /* 0x9C */ + NULL, /* 0x9D */ + NULL, /* 0x9E */ + NULL, /* 0x9F */ + "VK_LSHIFT", /* 0xA0 */ + "VK_RSHIFT", /* 0xA1 */ + "VK_LCONTROL", /* 0xA2 */ + "VK_RCONTROL", /* 0xA3 */ + "VK_LMENU", /* 0xA4 */ + "VK_RMENU", /* 0xA5 */ + NULL, /* 0xA6 */ + NULL, /* 0xA7 */ + NULL, /* 0xA8 */ + NULL, /* 0xA9 */ + NULL, /* 0xAA */ + NULL, /* 0xAB */ + NULL, /* 0xAC */ + NULL, /* 0xAD */ + NULL, /* 0xAE */ + NULL, /* 0xAF */ + NULL, /* 0xB0 */ + NULL, /* 0xB1 */ + NULL, /* 0xB2 */ + NULL, /* 0xB3 */ + NULL, /* 0xB4 */ + NULL, /* 0xB5 */ + NULL, /* 0xB6 */ + NULL, /* 0xB7 */ + NULL, /* 0xB8 */ + NULL, /* 0xB9 */ + "VK_OEM_1", /* 0xBA */ + "VK_OEM_PLUS", /* 0xBB */ + "VK_OEM_COMMA", /* 0xBC */ + "VK_OEM_MINUS", /* 0xBD */ + "VK_OEM_PERIOD", /* 0xBE */ + "VK_OEM_2", /* 0xBF */ + "VK_OEM_3", /* 0xC0 */ + NULL, /* 0xC1 */ + NULL, /* 0xC2 */ + NULL, /* 0xC3 */ + NULL, /* 0xC4 */ + NULL, /* 0xC5 */ + NULL, /* 0xC6 */ + NULL, /* 0xC7 */ + NULL, /* 0xC8 */ + NULL, /* 0xC9 */ + NULL, /* 0xCA */ + NULL, /* 0xCB */ + NULL, /* 0xCC */ + NULL, /* 0xCD */ + NULL, /* 0xCE */ + NULL, /* 0xCF */ + NULL, /* 0xD0 */ + NULL, /* 0xD1 */ + NULL, /* 0xD2 */ + NULL, /* 0xD3 */ + NULL, /* 0xD4 */ + NULL, /* 0xD5 */ + NULL, /* 0xD6 */ + NULL, /* 0xD7 */ + NULL, /* 0xD8 */ + NULL, /* 0xD9 */ + NULL, /* 0xDA */ + "VK_OEM_4", /* 0xDB */ + "VK_OEM_5", /* 0xDC */ + "VK_OEM_6", /* 0xDD */ + "VK_OEM_7", /* 0xDE */ + "VK_OEM_8", /* 0xDF */ + NULL, /* 0xE0 */ + "VK_OEM_AX", /* 0xE1 */ + "VK_OEM_102", /* 0xE2 */ + "VK_ICO_HELP", /* 0xE3 */ + "VK_ICO_00", /* 0xE4 */ + "VK_PROCESSKEY", /* 0xE5 */ + NULL, /* 0xE6 */ + NULL, /* 0xE7 */ + NULL, /* 0xE8 */ + NULL, /* 0xE9 */ + NULL, /* 0xEA */ + NULL, /* 0xEB */ + NULL, /* 0xEC */ + NULL, /* 0xED */ + NULL, /* 0xEE */ + NULL, /* 0xEF */ + NULL, /* 0xF0 */ + NULL, /* 0xF1 */ + NULL, /* 0xF2 */ + NULL, /* 0xF3 */ + NULL, /* 0xF4 */ + NULL, /* 0xF5 */ + "VK_ATTN", /* 0xF6 */ + "VK_CRSEL", /* 0xF7 */ + "VK_EXSEL", /* 0xF8 */ + "VK_EREOF", /* 0xF9 */ + "VK_PLAY", /* 0xFA */ + "VK_ZOOM", /* 0xFB */ + "VK_NONAME", /* 0xFC */ + "VK_PA1", /* 0xFD */ + "VK_OEM_CLEAR", /* 0xFE */ + NULL /* 0xFF */ }; @@ -1382,7 +1382,7 @@ static const USER_MSG toolbar_array[] = { USM(TB_PRESSBUTTON ,0), USM(TB_HIDEBUTTON ,0), USM(TB_INDETERMINATE ,0), - USM(TB_MARKBUTTON ,0), + USM(TB_MARKBUTTON ,0), USM(TB_ISBUTTONENABLED ,0), USM(TB_ISBUTTONCHECKED ,0), USM(TB_ISBUTTONPRESSED ,0), @@ -1498,7 +1498,7 @@ static const USER_MSG tooltips_array[] = { USM(TTM_GETMARGIN ,0), USM(TTM_POP ,0), USM(TTM_UPDATE ,0), - USM(TTM_GETBUBBLESIZE ,0), + USM(TTM_GETBUBBLESIZE ,0), USM(TTM_ADDTOOLW ,0), USM(TTM_DELTOOLW ,0), USM(TTM_NEWTOOLRECTW ,0), @@ -1983,27 +1983,27 @@ static const USER_MSG *SPY_Bsearch_Msg( const USER_MSG *first, const USER_MSG *l const USER_MSG *test; while (last >= first) { - count = 1 + last - first; - if (count < 3) { + count = 1 + last - first; + if (count < 3) { #if DEBUG_SPY - TRACE("code=%d, f-value=%d, f-name=%s, l-value=%d, l-name=%s, l-len=%d,\n", - code, first->value, first->name, last->value, last->name, last->len); + TRACE("code=%d, f-value=%d, f-name=%s, l-value=%d, l-name=%s, l-len=%d,\n", + code, first->value, first->name, last->value, last->name, last->len); #endif - if (first->value == code) return first; - if (last->value == code) return last; - return NULL; - } - count = count / 2; - test = first + count; + if (first->value == code) return first; + if (last->value == code) return last; + return NULL; + } + count = count / 2; + test = first + count; #if DEBUG_SPY - TRACE("first=%p, last=%p, test=%p, t-value=%d, code=%d, count=%d\n", - first, last, test, test->value, code, count); + TRACE("first=%p, last=%p, test=%p, t-value=%d, code=%d, count=%d\n", + first, last, test, test->value, code, count); #endif - if (test->value == code) return test; - if (test->value > code) - last = test - 1; - else - first = test + 1; + if (test->value == code) return test; + if (test->value > code) + last = test - 1; + else + first = test + 1; } return NULL; } @@ -2021,7 +2021,7 @@ static void SPY_GetMsgStuff( SPY_INSTANCE *sp_e ) sp_e->data_len = 0; if (!msg_name) { - INT i = 0; + INT i = 0; if (sp_e->msgnum >= 0xc000) { @@ -2033,13 +2033,13 @@ static void SPY_GetMsgStuff( SPY_INSTANCE *sp_e ) } } #if DEBUG_SPY - TRACE("looking class %s\n", debugstr_w(sp_e->wnd_class)); + TRACE("looking class %s\n", debugstr_w(sp_e->wnd_class)); #endif - while (cc_array[i].classname && - strcmpiW(cc_array[i].classname, sp_e->wnd_class) != 0) i++; + while (cc_array[i].classname && + strcmpiW(cc_array[i].classname, sp_e->wnd_class) != 0) i++; - if (cc_array[i].classname) + if (cc_array[i].classname) { #if DEBUG_SPY TRACE("process class %s, first %p, last %p\n", @@ -2081,24 +2081,24 @@ static void SPY_GetWndName( SPY_INSTANCE *sp_e ) save_error = GetLastError(); /* special code to detect a property sheet dialog */ if ((GetClassLongW(sp_e->msg_hwnd, GCW_ATOM) == (LONG)WC_DIALOGW) && - (GetPropW(sp_e->msg_hwnd, PropSheetInfoStr))) { - strcpyW(sp_e->wnd_class, WC_PROPSHEETW); + (GetPropW(sp_e->msg_hwnd, PropSheetInfoStr))) { + strcpyW(sp_e->wnd_class, WC_PROPSHEETW); } else { - GetClassNameW(sp_e->msg_hwnd, sp_e->wnd_class, sizeof(sp_e->wnd_class)/sizeof(WCHAR)); + GetClassNameW(sp_e->msg_hwnd, sp_e->wnd_class, sizeof(sp_e->wnd_class)/sizeof(WCHAR)); } SetLastError(save_error); len = InternalGetWindowText(sp_e->msg_hwnd, sp_e->wnd_name, sizeof(sp_e->wnd_name)/sizeof(WCHAR)); if(!len) /* get class name */ { - LPWSTR dst = sp_e->wnd_name; - LPWSTR src = sp_e->wnd_class; - int n = sizeof(sp_e->wnd_name)/sizeof(WCHAR) - 3; - *dst++ = '{'; - while ((n-- > 0) && *src) *dst++ = *src++; - *dst++ = '}'; - *dst = 0; + LPWSTR dst = sp_e->wnd_name; + LPWSTR src = sp_e->wnd_class; + int n = sizeof(sp_e->wnd_name)/sizeof(WCHAR) - 3; + *dst++ = '{'; + while ((n-- > 0) && *src) *dst++ = *src++; + *dst++ = '}'; + *dst = 0; } } @@ -2130,9 +2130,9 @@ const char *SPY_GetVKeyName(WPARAM wParam) const char *vk_key_name; if(wParam <= SPY_MAX_VKKEYSNUM && VK_KeyNames[wParam]) - vk_key_name = VK_KeyNames[wParam]; + vk_key_name = VK_KeyNames[wParam]; else - vk_key_name = "VK_???"; + vk_key_name = "VK_???"; return vk_key_name; } @@ -2146,27 +2146,27 @@ static const SPY_NOTIFY *SPY_Bsearch_Notify( const SPY_NOTIFY *first, const SPY_ const SPY_NOTIFY *test; while (last >= first) { - count = 1 + last - first; - if (count < 3) { + count = 1 + last - first; + if (count < 3) { #if DEBUG_SPY - TRACE("code=%d, f-value=%d, f-name=%s, l-value=%d, l-name=%s, l-len=%d,\n", - code, first->value, first->name, last->value, last->name, last->len); + TRACE("code=%d, f-value=%d, f-name=%s, l-value=%d, l-name=%s, l-len=%d,\n", + code, first->value, first->name, last->value, last->name, last->len); #endif - if (first->value == code) return first; - if (last->value == code) return last; - return NULL; - } - count = count / 2; - test = first + count; + if (first->value == code) return first; + if (last->value == code) return last; + return NULL; + } + count = count / 2; + test = first + count; #if DEBUG_SPY - TRACE("first=%p, last=%p, test=%p, t-value=%d, code=%d, count=%d\n", - first, last, test, test->value, code, count); + TRACE("first=%p, last=%p, test=%p, t-value=%d, code=%d, count=%d\n", + first, last, test, test->value, code, count); #endif - if (test->value == code) return test; - if (test->value < code) - last = test - 1; - else - first = test + 1; + if (test->value == code) return test; + if (test->value < code) + last = test - 1; + else + first = test + 1; } return NULL; } @@ -2179,29 +2179,29 @@ static void SPY_DumpMem (LPCSTR header, const UINT *q, INT len) int i; for(i=0; imsgnum) - { - case LVM_INSERTITEMW: - case LVM_INSERTITEMA: - case LVM_SETITEMW: - case LVM_SETITEMA: - if (!enter) break; - /* fall through */ - case LVM_GETITEMW: - case LVM_GETITEMA: - { - LPLVITEMA item = (LPLVITEMA) sp_e->lParam; - if (item) { - SPY_DumpMem ("LVITEM", (UINT*)item, sizeof(LVITEMA)); - } - break; - } - case TCM_INSERTITEMW: - case TCM_INSERTITEMA: - case TCM_SETITEMW: - case TCM_SETITEMA: - if (!enter) break; - /* fall through */ - case TCM_GETITEMW: - case TCM_GETITEMA: - { - TCITEMA *item = (TCITEMA *) sp_e->lParam; - if (item) { - SPY_DumpMem ("TCITEM", (UINT*)item, sizeof(TCITEMA)); - } - break; - } - case TCM_ADJUSTRECT: - case LVM_GETITEMRECT: - case LVM_GETSUBITEMRECT: - { - LPRECT rc = (LPRECT) sp_e->lParam; - if (rc) { - TRACE("lParam rect (%ld,%ld)-(%ld,%ld)\n", - rc->left, rc->top, rc->right, rc->bottom); - } - break; - } - case LVM_SETITEMPOSITION32: - if (!enter) break; - /* fall through */ - case LVM_GETITEMPOSITION: - case LVM_GETORIGIN: - { - LPPOINT point = (LPPOINT) sp_e->lParam; - if (point) { - TRACE("lParam point x=%ld, y=%ld\n", point->x, point->y); - } - break; - } - case SBM_SETRANGE: - if (!enter && (sp_e->msgnum == SBM_SETRANGE)) break; - TRACE("min=%d max=%d\n", (INT)sp_e->wParam, (INT)sp_e->lParam); - break; - case SBM_GETRANGE: - if ((enter && (sp_e->msgnum == SBM_GETRANGE)) || - (!enter && (sp_e->msgnum == SBM_SETRANGE))) break; - { - LPINT ptmin = (LPINT) sp_e->wParam; - LPINT ptmax = (LPINT) sp_e->lParam; - if (ptmin && ptmax) - TRACE("min=%d max=%d\n", *ptmin, *ptmax); - else if (ptmin) - TRACE("min=%d max=n/a\n", *ptmin); - else if (ptmax) - TRACE("min=n/a max=%d\n", *ptmax); - break; - } - case EM_EXSETSEL: - if (enter && sp_e->lParam) - { - CHARRANGE *cr = (CHARRANGE *) sp_e->lParam; - TRACE("CHARRANGE: cpMin=%ld cpMax=%ld\n", cr->cpMin, cr->cpMax); - } - break; - case EM_SETCHARFORMAT: - if (enter && sp_e->lParam) - { - CHARFORMATW *cf = (CHARFORMATW *) sp_e->lParam; - TRACE("CHARFORMAT: dwMask=0x%08lx dwEffects=", cf->dwMask); - if ((cf->dwMask & CFM_BOLD) && (cf->dwEffects & CFE_BOLD)) - TRACE(" CFE_BOLD"); - if ((cf->dwMask & CFM_COLOR) && (cf->dwEffects & CFE_AUTOCOLOR)) - TRACE(" CFE_AUTOCOLOR"); - if ((cf->dwMask & CFM_ITALIC) && (cf->dwEffects & CFE_ITALIC)) - TRACE(" CFE_ITALIC"); - if ((cf->dwMask & CFM_PROTECTED) && (cf->dwEffects & CFE_PROTECTED)) - TRACE(" CFE_PROTECTED"); - if ((cf->dwMask & CFM_STRIKEOUT) && (cf->dwEffects & CFE_STRIKEOUT)) - TRACE(" CFE_STRIKEOUT"); - if ((cf->dwMask & CFM_UNDERLINE) && (cf->dwEffects & CFE_UNDERLINE)) - TRACE(" CFE_UNDERLINE"); - TRACE("\n"); - if (cf->dwMask & CFM_SIZE) - TRACE("yHeight=%ld\n", cf->yHeight); - if (cf->dwMask & CFM_OFFSET) - TRACE("yOffset=%ld\n", cf->yOffset); - if ((cf->dwMask & CFM_COLOR) && !(cf->dwEffects & CFE_AUTOCOLOR)) - TRACE("crTextColor=%lx\n", cf->crTextColor); - TRACE("bCharSet=%x bPitchAndFamily=%x\n", cf->bCharSet, cf->bPitchAndFamily); - /* FIXME: we should try to be a bit more intelligent about - * whether this is in ANSI or Unicode (it could be either) */ - if (cf->dwMask & CFM_FACE) - TRACE("szFaceName=%s\n", debugstr_wn(cf->szFaceName, LF_FACESIZE)); - /* FIXME: handle CHARFORMAT2 too */ - } - break; - case WM_DRAWITEM: - if (!enter) break; - { - DRAWITEMSTRUCT *lpdis = (DRAWITEMSTRUCT*) sp_e->lParam; - TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n", - lpdis->CtlType, lpdis->CtlID); - TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n", - lpdis->itemID, lpdis->itemAction, lpdis->itemState); - TRACE("hWnd=%p hDC=%p (%ld,%ld)-(%ld,%ld) itemData=0x%08lx\n", - lpdis->hwndItem, lpdis->hDC, lpdis->rcItem.left, - lpdis->rcItem.top, lpdis->rcItem.right, - lpdis->rcItem.bottom, lpdis->itemData); - } - break; - case WM_MEASUREITEM: - { - MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) sp_e->lParam; - TRACE("MEASUREITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n", - lpmis->CtlType, lpmis->CtlID); - TRACE("itemID=0x%08x itemWidth=0x%08x itemHeight=0x%08x\n", - lpmis->itemID, lpmis->itemWidth, lpmis->itemHeight); - TRACE("itemData=0x%08lx\n", lpmis->itemData); - } - break; + { + case LVM_INSERTITEMW: + case LVM_INSERTITEMA: + case LVM_SETITEMW: + case LVM_SETITEMA: + if (!enter) break; + /* fall through */ + case LVM_GETITEMW: + case LVM_GETITEMA: + { + LPLVITEMA item = (LPLVITEMA) sp_e->lParam; + if (item) { + SPY_DumpMem ("LVITEM", (UINT*)item, sizeof(LVITEMA)); + } + break; + } + case TCM_INSERTITEMW: + case TCM_INSERTITEMA: + case TCM_SETITEMW: + case TCM_SETITEMA: + if (!enter) break; + /* fall through */ + case TCM_GETITEMW: + case TCM_GETITEMA: + { + TCITEMA *item = (TCITEMA *) sp_e->lParam; + if (item) { + SPY_DumpMem ("TCITEM", (UINT*)item, sizeof(TCITEMA)); + } + break; + } + case TCM_ADJUSTRECT: + case LVM_GETITEMRECT: + case LVM_GETSUBITEMRECT: + { + LPRECT rc = (LPRECT) sp_e->lParam; + if (rc) { + TRACE("lParam rect (%ld,%ld)-(%ld,%ld)\n", + rc->left, rc->top, rc->right, rc->bottom); + } + break; + } + case LVM_SETITEMPOSITION32: + if (!enter) break; + /* fall through */ + case LVM_GETITEMPOSITION: + case LVM_GETORIGIN: + { + LPPOINT point = (LPPOINT) sp_e->lParam; + if (point) { + TRACE("lParam point x=%ld, y=%ld\n", point->x, point->y); + } + break; + } + case SBM_SETRANGE: + if (!enter && (sp_e->msgnum == SBM_SETRANGE)) break; + TRACE("min=%d max=%d\n", (INT)sp_e->wParam, (INT)sp_e->lParam); + break; + case SBM_GETRANGE: + if ((enter && (sp_e->msgnum == SBM_GETRANGE)) || + (!enter && (sp_e->msgnum == SBM_SETRANGE))) break; + { + LPINT ptmin = (LPINT) sp_e->wParam; + LPINT ptmax = (LPINT) sp_e->lParam; + if (ptmin && ptmax) + TRACE("min=%d max=%d\n", *ptmin, *ptmax); + else if (ptmin) + TRACE("min=%d max=n/a\n", *ptmin); + else if (ptmax) + TRACE("min=n/a max=%d\n", *ptmax); + break; + } + case EM_EXSETSEL: + if (enter && sp_e->lParam) + { + CHARRANGE *cr = (CHARRANGE *) sp_e->lParam; + TRACE("CHARRANGE: cpMin=%ld cpMax=%ld\n", cr->cpMin, cr->cpMax); + } + break; + case EM_SETCHARFORMAT: + if (enter && sp_e->lParam) + { + CHARFORMATW *cf = (CHARFORMATW *) sp_e->lParam; + TRACE("CHARFORMAT: dwMask=0x%08lx dwEffects=", cf->dwMask); + if ((cf->dwMask & CFM_BOLD) && (cf->dwEffects & CFE_BOLD)) + TRACE(" CFE_BOLD"); + if ((cf->dwMask & CFM_COLOR) && (cf->dwEffects & CFE_AUTOCOLOR)) + TRACE(" CFE_AUTOCOLOR"); + if ((cf->dwMask & CFM_ITALIC) && (cf->dwEffects & CFE_ITALIC)) + TRACE(" CFE_ITALIC"); + if ((cf->dwMask & CFM_PROTECTED) && (cf->dwEffects & CFE_PROTECTED)) + TRACE(" CFE_PROTECTED"); + if ((cf->dwMask & CFM_STRIKEOUT) && (cf->dwEffects & CFE_STRIKEOUT)) + TRACE(" CFE_STRIKEOUT"); + if ((cf->dwMask & CFM_UNDERLINE) && (cf->dwEffects & CFE_UNDERLINE)) + TRACE(" CFE_UNDERLINE"); + TRACE("\n"); + if (cf->dwMask & CFM_SIZE) + TRACE("yHeight=%ld\n", cf->yHeight); + if (cf->dwMask & CFM_OFFSET) + TRACE("yOffset=%ld\n", cf->yOffset); + if ((cf->dwMask & CFM_COLOR) && !(cf->dwEffects & CFE_AUTOCOLOR)) + TRACE("crTextColor=%lx\n", cf->crTextColor); + TRACE("bCharSet=%x bPitchAndFamily=%x\n", cf->bCharSet, cf->bPitchAndFamily); + /* FIXME: we should try to be a bit more intelligent about + * whether this is in ANSI or Unicode (it could be either) */ + if (cf->dwMask & CFM_FACE) + TRACE("szFaceName=%s\n", debugstr_wn(cf->szFaceName, LF_FACESIZE)); + /* FIXME: handle CHARFORMAT2 too */ + } + break; + case WM_DRAWITEM: + if (!enter) break; + { + DRAWITEMSTRUCT *lpdis = (DRAWITEMSTRUCT*) sp_e->lParam; + TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n", + lpdis->CtlType, lpdis->CtlID); + TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n", + lpdis->itemID, lpdis->itemAction, lpdis->itemState); + TRACE("hWnd=%p hDC=%p (%ld,%ld)-(%ld,%ld) itemData=0x%08lx\n", + lpdis->hwndItem, lpdis->hDC, lpdis->rcItem.left, + lpdis->rcItem.top, lpdis->rcItem.right, + lpdis->rcItem.bottom, lpdis->itemData); + } + break; + case WM_MEASUREITEM: + { + MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) sp_e->lParam; + TRACE("MEASUREITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n", + lpmis->CtlType, lpmis->CtlID); + TRACE("itemID=0x%08x itemWidth=0x%08x itemHeight=0x%08x\n", + lpmis->itemID, lpmis->itemWidth, lpmis->itemHeight); + TRACE("itemData=0x%08lx\n", lpmis->itemData); + } + break; case WM_SIZE: if (!enter) break; TRACE("cx=%d cy=%d\n", LOWORD(sp_e->lParam), HIWORD(sp_e->lParam)); break; - case WM_WINDOWPOSCHANGED: - if (!enter) break; - case WM_WINDOWPOSCHANGING: - { - WINDOWPOS *lpwp = (WINDOWPOS *)sp_e->lParam; - TRACE("WINDOWPOS hwnd=%p, after=%p, at (%d,%d) w=%d h=%d, flags=0x%08x\n", - lpwp->hwnd, lpwp->hwndInsertAfter, lpwp->x, lpwp->y, - lpwp->cx, lpwp->cy, lpwp->flags); - } - break; - case WM_STYLECHANGED: - if (!enter) break; - case WM_STYLECHANGING: - { - LPSTYLESTRUCT ss = (LPSTYLESTRUCT) sp_e->lParam; - TRACE("STYLESTRUCT: StyleOld=0x%08lx, StyleNew=0x%08lx\n", - ss->styleOld, ss->styleNew); - } - break; - case WM_NCCALCSIZE: - { - RECT *rc = (RECT *)sp_e->lParam; - TRACE("Rect (%ld,%ld)-(%ld,%ld)\n", - rc->left, rc->top, rc->right, rc->bottom); - } - break; - case WM_NOTIFY: - /* if (!enter) break; */ - { - NMHDR * pnmh = (NMHDR*) sp_e->lParam; - UINT *q, dumplen; - const SPY_NOTIFY *p; - WCHAR from_class[60]; - DWORD save_error; - - p = SPY_Bsearch_Notify (&spnfy_array[0], end_spnfy_array, - pnmh->code); - if (p) { - TRACE("NMHDR hwndFrom=%p idFrom=0x%08x code=%s<0x%08x>, extra=0x%x\n", - pnmh->hwndFrom, pnmh->idFrom, p->name, pnmh->code, p->len); - dumplen = p->len; - - /* for CUSTOMDRAW, dump all the data for TOOLBARs */ - if (pnmh->code == NM_CUSTOMDRAW) { - /* save and restore error code over the next call */ - save_error = GetLastError(); - GetClassNameW(pnmh->hwndFrom, from_class, - sizeof(from_class)/sizeof(WCHAR)); - SetLastError(save_error); - if (strcmpW(TOOLBARCLASSNAMEW, from_class) == 0) - dumplen = sizeof(NMTBCUSTOMDRAW)-sizeof(NMHDR); - } else if ((pnmh->code >= HDN_ITEMCHANGINGA) && (pnmh->code <= HDN_ENDDRAG)) { - dumplen = sizeof(NMHEADERA)-sizeof(NMHDR); - } - if (dumplen > 0) { - q = (UINT *)(pnmh + 1); - SPY_DumpMem ("NM extra", q, (INT)dumplen); - } - } - else - TRACE("NMHDR hwndFrom=%p idFrom=0x%08x code=0x%08x\n", - pnmh->hwndFrom, pnmh->idFrom, pnmh->code); - } - default: - if (sp_e->data_len > 0) - SPY_DumpMem ("MSG lParam", (UINT *)sp_e->lParam, sp_e->data_len); - break; - } + case WM_WINDOWPOSCHANGED: + if (!enter) break; + case WM_WINDOWPOSCHANGING: + { + WINDOWPOS *lpwp = (WINDOWPOS *)sp_e->lParam; + TRACE("WINDOWPOS hwnd=%p, after=%p, at (%d,%d) w=%d h=%d, flags=0x%08x\n", + lpwp->hwnd, lpwp->hwndInsertAfter, lpwp->x, lpwp->y, + lpwp->cx, lpwp->cy, lpwp->flags); + } + break; + case WM_STYLECHANGED: + if (!enter) break; + case WM_STYLECHANGING: + { + LPSTYLESTRUCT ss = (LPSTYLESTRUCT) sp_e->lParam; + TRACE("STYLESTRUCT: StyleOld=0x%08lx, StyleNew=0x%08lx\n", + ss->styleOld, ss->styleNew); + } + break; + case WM_NCCALCSIZE: + { + RECT *rc = (RECT *)sp_e->lParam; + TRACE("Rect (%ld,%ld)-(%ld,%ld)\n", + rc->left, rc->top, rc->right, rc->bottom); + } + break; + case WM_NOTIFY: + /* if (!enter) break; */ + { + NMHDR * pnmh = (NMHDR*) sp_e->lParam; + UINT *q, dumplen; + const SPY_NOTIFY *p; + WCHAR from_class[60]; + DWORD save_error; + + p = SPY_Bsearch_Notify (&spnfy_array[0], end_spnfy_array, + pnmh->code); + if (p) { + TRACE("NMHDR hwndFrom=%p idFrom=0x%08x code=%s<0x%08x>, extra=0x%x\n", + pnmh->hwndFrom, pnmh->idFrom, p->name, pnmh->code, p->len); + dumplen = p->len; + + /* for CUSTOMDRAW, dump all the data for TOOLBARs */ + if (pnmh->code == NM_CUSTOMDRAW) { + /* save and restore error code over the next call */ + save_error = GetLastError(); + GetClassNameW(pnmh->hwndFrom, from_class, + sizeof(from_class)/sizeof(WCHAR)); + SetLastError(save_error); + if (strcmpW(TOOLBARCLASSNAMEW, from_class) == 0) + dumplen = sizeof(NMTBCUSTOMDRAW)-sizeof(NMHDR); + } else if ((pnmh->code >= HDN_ITEMCHANGINGA) && (pnmh->code <= HDN_ENDDRAG)) { + dumplen = sizeof(NMHEADERA)-sizeof(NMHDR); + } + if (dumplen > 0) { + q = (UINT *)(pnmh + 1); + SPY_DumpMem ("NM extra", q, (INT)dumplen); + } + } + else + TRACE("NMHDR hwndFrom=%p idFrom=0x%08x code=0x%08x\n", + pnmh->hwndFrom, pnmh->idFrom, pnmh->code); + } + default: + if (sp_e->data_len > 0) + SPY_DumpMem ("MSG lParam", (UINT *)sp_e->lParam, sp_e->data_len); + break; + } } /*********************************************************************** @@ -2469,21 +2469,21 @@ void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg, sp_e.msg_name, taskName, wParam, lParam ); else { TRACE("%*s(%p) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n", - indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg, - sp_e.msg_name, taskName, wParam, lParam ); - SPY_DumpStructure(&sp_e, TRUE); - } + indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg, + sp_e.msg_name, taskName, wParam, lParam ); + SPY_DumpStructure(&sp_e, TRUE); + } } break; case SPY_DEFWNDPROC16: - if( SPY_ExcludeDWP ) return; + if( SPY_ExcludeDWP ) return; TRACE("%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n", indent, "", HWND_16(hWnd), sp_e.msg_name, msg, wParam, lParam ); break; case SPY_DEFWNDPROC: - if( SPY_ExcludeDWP ) return; + if( SPY_ExcludeDWP ) return; TRACE("%*s(%p) DefWindowProc32: %s [%04x] wp=%08x lp=%08lx\n", indent, "", hWnd, sp_e.msg_name, msg, wParam, lParam ); @@ -2503,8 +2503,8 @@ void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn, int indent; if (!TRACE_ON(message) || SPY_EXCLUDE(msg) || - (SPY_ExcludeDWP && (iFlag == SPY_RESULT_DEFWND16 || iFlag == SPY_RESULT_DEFWND)) ) - return; + (SPY_ExcludeDWP && (iFlag == SPY_RESULT_DEFWND16 || iFlag == SPY_RESULT_DEFWND)) ) + return; sp_e.msgnum = msg; sp_e.msg_hwnd = hWnd; @@ -2522,14 +2522,14 @@ void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn, switch(iFlag) { case SPY_RESULT_DEFWND16: - TRACE(" %*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n", + TRACE(" %*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n", indent, "", HWND_16(hWnd), sp_e.msg_name, msg, lReturn ); - break; + break; case SPY_RESULT_DEFWND: - TRACE(" %*s(%p) DefWindowProc32: %s [%04x] returned %08lx\n", - indent, "", hWnd, sp_e.msg_name, msg, lReturn ); - break; + TRACE(" %*s(%p) DefWindowProc32: %s [%04x] returned %08lx\n", + indent, "", hWnd, sp_e.msg_name, msg, lReturn ); + break; case SPY_RESULT_OK16: TRACE(" %*s(%04x) %-16s message [%04x] %s returned %08lx\n", @@ -2541,7 +2541,7 @@ void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn, TRACE(" %*s(%p) %-16s message [%04x] %s returned %08lx\n", indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg, sp_e.msg_name, lReturn ); - SPY_DumpStructure(&sp_e, FALSE); + SPY_DumpStructure(&sp_e, FALSE); break; case SPY_RESULT_INVALIDHWND16: @@ -2609,14 +2609,14 @@ int SPY_Init(void) p = &spnfy_array[0]; j = 0xffffffff; while (p->name) { - if ((UINT)p->value > (UINT)j) { - ERR("Notify message array out of order\n"); - ERR(" between values [%08x] %s and [%08x] %s\n", - j, (p-1)->name, p->value, p->name); - break; - } - j = p->value; - p++; + if ((UINT)p->value > (UINT)j) { + ERR("Notify message array out of order\n"); + ERR(" between values [%08x] %s and [%08x] %s\n", + j, (p-1)->name, p->value, p->name); + break; + } + j = p->value; + p++; } p--; end_spnfy_array = p; @@ -2627,23 +2627,23 @@ int SPY_Init(void) i = 0; while (cc_array[i].classname) { - j = 0x0400; /* minimum entry in array */ - q = cc_array[i].classmsg; - while(q->name) { - if (q->value <= j) { - ERR("Class message array out of order for class %s\n", - debugstr_w(cc_array[i].classname)); - ERR(" between values [%04x] %s and [%04x] %s\n", - j, (q-1)->name, q->value, q->name); - break; - } - j = q->value; - q++; - } - q--; - cc_array[i].lastmsg = (USER_MSG *)q; - - i++; + j = 0x0400; /* minimum entry in array */ + q = cc_array[i].classmsg; + while(q->name) { + if (q->value <= j) { + ERR("Class message array out of order for class %s\n", + debugstr_w(cc_array[i].classname)); + ERR(" between values [%04x] %s and [%04x] %s\n", + j, (q-1)->name, q->value, q->name); + break; + } + j = q->value; + q++; + } + q--; + cc_array[i].lastmsg = (USER_MSG *)q; + + i++; } return 1; diff --git a/windows/win.c b/dlls/user/win.c similarity index 99% rename from windows/win.c rename to dlls/user/win.c index 76a7ef74515..8fe089fa508 100644 --- a/windows/win.c +++ b/dlls/user/win.c @@ -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; } diff --git a/windows/winhelp.c b/dlls/user/winhelp.c similarity index 100% rename from windows/winhelp.c rename to dlls/user/winhelp.c diff --git a/windows/winpos.c b/dlls/user/winpos.c similarity index 100% rename from windows/winpos.c rename to dlls/user/winpos.c diff --git a/windows/winproc.c b/dlls/user/winproc.c similarity index 93% rename from windows/winproc.c rename to dlls/user/winproc.c index cadc4404f2a..fbf5cab8d9d 100644 --- a/windows/winproc.c +++ b/dlls/user/winproc.c @@ -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; - - *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) !! */ + 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) !! */ case WM_DDE_ACK: { - UINT lo, hi; - int flag = 0; - char buf[2]; - - *pwparam32 = (WPARAM)WIN_Handle32(wParam16); - - 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) !! */ + UINT lo, hi; + int flag = 0; + char buf[2]; + + *pwparam32 = (WPARAM)WIN_Handle32(wParam16); + + 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) !! */ 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, -- 2.11.4.GIT