mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
strip whitespace from end of lines
svn path=/trunk/; revision=15167
This commit is contained in:
parent
ae4b8f6e93
commit
6a73e87d9b
39 changed files with 564 additions and 564 deletions
|
@ -6,9 +6,9 @@
|
|||
#ifndef MAKEINTATOMA
|
||||
#define MAKEINTATOMA(atom) ((LPCSTR)((ULONG_PTR)((WORD)(atom))))
|
||||
#endif
|
||||
#ifndef WM_ISACTIVEICON
|
||||
#ifndef WM_ISACTIVEICON
|
||||
#define WM_ISACTIVEICON 0x0035
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __USE_W32API
|
||||
#if defined(STRICT)
|
||||
|
|
|
@ -824,7 +824,7 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
|
|||
|
||||
case WM_GETDLGCODE:
|
||||
result = DLGC_HASSETSEL | DLGC_WANTCHARS | DLGC_WANTARROWS;
|
||||
|
||||
|
||||
if (es->style & ES_MULTILINE)
|
||||
{
|
||||
result |= DLGC_WANTALLKEYS;
|
||||
|
@ -3799,7 +3799,7 @@ static void EDIT_WM_Char(EDITSTATE *es, WCHAR c)
|
|||
/*If Edit control style is ES_NUMBER allow users to key in only numeric values*/
|
||||
if( (es->style & ES_NUMBER) && !( c >= '0' && c <= '9') )
|
||||
break;
|
||||
|
||||
|
||||
if (!(es->style & ES_READONLY) && (c >= ' ') && (c != 127)) {
|
||||
WCHAR str[2];
|
||||
str[0] = c;
|
||||
|
@ -4593,7 +4593,7 @@ static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs, BOOL unicode)
|
|||
* If WS_BORDER without WS_EX_CLIENTEDGE is specified we shouldn't have
|
||||
* a nonclient area and we should handle painting the border ourselves.
|
||||
*
|
||||
* When making modifications please ensure that the code still works
|
||||
* When making modifications please ensure that the code still works
|
||||
* for edit controls created directly with style 0x50800000, exStyle 0
|
||||
* (which should have a single pixel border)
|
||||
*/
|
||||
|
|
|
@ -19,7 +19,7 @@ static void RegisterBuiltinClass(const struct builtin_class_descr *Descr)
|
|||
WNDCLASSEXW wc;
|
||||
UNICODE_STRING ClassName;
|
||||
UNICODE_STRING MenuName;
|
||||
|
||||
|
||||
wc.cbSize = sizeof(WNDCLASSEXW);
|
||||
wc.lpszClassName = Descr->name;
|
||||
wc.lpfnWndProc = Descr->procW;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#define SCROLL_FIRST_DELAY 200 /* Delay (in ms) before first repetition when
|
||||
holding the button down */
|
||||
#define SCROLL_REPEAT_DELAY 50 /* Delay (in ms) between scroll repetitions */
|
||||
|
||||
|
||||
#define SCROLL_TIMER 0 /* Scroll timer id */
|
||||
|
||||
/* Minimum size of the rectangle between the arrows */
|
||||
|
@ -157,7 +157,7 @@ IntDrawScrollInterior(HWND hWnd, HDC hDC, INT nBar, BOOL Vertical,
|
|||
SelectObject(hDC, hSaveBrush);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ThumbTop -= ScrollBarInfo->dxyLineButton;
|
||||
|
||||
if (ScrollBarInfo->dxyLineButton)
|
||||
|
@ -312,7 +312,7 @@ IntScrollGetObjectId(INT SBType)
|
|||
|
||||
STATIC BOOL FASTCALL
|
||||
IntGetScrollBarInfo(HWND Wnd, INT Bar, PSCROLLBARINFO ScrollBarInfo)
|
||||
{
|
||||
{
|
||||
ScrollBarInfo->cbSize = sizeof(SCROLLBARINFO);
|
||||
|
||||
return NtUserGetScrollBarInfo(Wnd, IntScrollGetObjectId(Bar), ScrollBarInfo);
|
||||
|
@ -349,7 +349,7 @@ IntDrawScrollBar(HWND Wnd, HDC DC, INT Bar)
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (IsRectEmpty(&Info.rcScrollBar))
|
||||
{
|
||||
return;
|
||||
|
@ -419,7 +419,7 @@ IntScrollHitTest(PSCROLLBARINFO ScrollBarInfo, BOOL Vertical, POINT Pt, BOOL Dra
|
|||
ThumbSize = ScrollBarInfo->xyThumbBottom - ThumbPos;
|
||||
ArrowSize = ScrollBarInfo->dxyLineButton;
|
||||
|
||||
if (Vertical)
|
||||
if (Vertical)
|
||||
{
|
||||
if (Pt.y < ScrollBarInfo->rcScrollBar.top + ArrowSize)
|
||||
{
|
||||
|
@ -1069,7 +1069,7 @@ static void IntScrollCreateScrollBar(
|
|||
LPCREATESTRUCTW lpCreate /* [in] The style and place of the scroll bar */)
|
||||
{
|
||||
SCROLLINFO Info;
|
||||
|
||||
|
||||
Info.cbSize = sizeof(SCROLLINFO);
|
||||
Info.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
|
||||
Info.nMin = 0;
|
||||
|
@ -1098,7 +1098,7 @@ static void IntScrollCreateScrollBar(
|
|||
}
|
||||
else if (0 != (lpCreate->style & SBS_SIZEBOXBOTTOMRIGHTALIGN))
|
||||
{
|
||||
MoveWindow(Wnd, lpCreate->x + lpCreate->cx - GetSystemMetrics(SM_CXVSCROLL) - 1,
|
||||
MoveWindow(Wnd, lpCreate->x + lpCreate->cx - GetSystemMetrics(SM_CXVSCROLL) - 1,
|
||||
lpCreate->y + lpCreate->cy - GetSystemMetrics(SM_CYHSCROLL) - 1,
|
||||
GetSystemMetrics(SM_CXVSCROLL) + 1,
|
||||
GetSystemMetrics(SM_CYHSCROLL) + 1, FALSE);
|
||||
|
@ -1140,7 +1140,7 @@ STATIC INT FASTCALL
|
|||
IntScrollGetScrollPos(HWND Wnd, INT Bar)
|
||||
{
|
||||
SCROLLINFO ScrollInfo;
|
||||
|
||||
|
||||
ScrollInfo.cbSize = sizeof(SCROLLINFO);
|
||||
ScrollInfo.fMask = SIF_POS;
|
||||
if (! NtUserGetScrollInfo(Wnd, Bar, &ScrollInfo))
|
||||
|
@ -1156,13 +1156,13 @@ IntScrollGetScrollRange(HWND Wnd, int Bar, LPINT MinPos, LPINT MaxPos)
|
|||
{
|
||||
BOOL Result;
|
||||
SCROLLINFO ScrollInfo;
|
||||
|
||||
|
||||
if (NULL == MinPos || NULL == MaxPos)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
ScrollInfo.cbSize = sizeof(SCROLLINFO);
|
||||
ScrollInfo.fMask = SIF_RANGE;
|
||||
Result = NtUserGetScrollInfo(Wnd, Bar, &ScrollInfo);
|
||||
|
@ -1171,7 +1171,7 @@ IntScrollGetScrollRange(HWND Wnd, int Bar, LPINT MinPos, LPINT MaxPos)
|
|||
*MinPos = ScrollInfo.nMin;
|
||||
*MaxPos = ScrollInfo.nMax;
|
||||
}
|
||||
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
@ -1194,7 +1194,7 @@ ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt)
|
|||
if (SB_CTL != SBType)
|
||||
{
|
||||
NtUserGetWindowRect(Wnd, &WindowRect);
|
||||
|
||||
|
||||
Pt.x -= WindowRect.left;
|
||||
Pt.y -= WindowRect.top;
|
||||
|
||||
|
@ -1551,10 +1551,10 @@ SetScrollPos(HWND hWnd, INT nBar, INT nPos, BOOL bRedraw)
|
|||
{
|
||||
INT Result = 0;
|
||||
SCROLLINFO ScrollInfo;
|
||||
|
||||
|
||||
ScrollInfo.cbSize = sizeof(SCROLLINFO);
|
||||
ScrollInfo.fMask = SIF_POS;
|
||||
|
||||
|
||||
/*
|
||||
* Call NtUserGetScrollInfo() to get the previous position that
|
||||
* we will later return.
|
||||
|
@ -1569,7 +1569,7 @@ SetScrollPos(HWND hWnd, INT nBar, INT nPos, BOOL bRedraw)
|
|||
NtUserSetScrollInfo(hWnd, nBar, &ScrollInfo, bRedraw);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
HPEN STDCALL GetSysColorPen (int nIndex);;
|
||||
HPEN STDCALL GetSysColorPen (int nIndex);
|
||||
|
|
|
@ -110,7 +110,7 @@ SystemParametersInfoA(UINT uiAction,
|
|||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* FIXME - Read the registry key for now, but what happens if the wallpaper was
|
||||
changed without SPIF_UPDATEINIFILE?! */
|
||||
if(RegOpenKeyExW(HKEY_CURRENT_USER,
|
||||
|
@ -138,7 +138,7 @@ SystemParametersInfoA(UINT uiAction,
|
|||
HBITMAP hNewWallpaper;
|
||||
BOOL Ret;
|
||||
LPSTR lpWallpaper = (LPSTR)pvParam;
|
||||
|
||||
|
||||
if(lpWallpaper != NULL && *lpWallpaper != '\0')
|
||||
{
|
||||
hNewWallpaper = LoadImageA(0, lpWallpaper, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
|
||||
|
@ -152,7 +152,7 @@ SystemParametersInfoA(UINT uiAction,
|
|||
hNewWallpaper = NULL;
|
||||
lpWallpaper = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Set the wallpaper bitmap */
|
||||
if(!NtUserSystemParametersInfo(SPI_SETDESKWALLPAPER, 0, &hNewWallpaper, fWinIni & SPIF_SENDCHANGE))
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ SystemParametersInfoA(UINT uiAction,
|
|||
return FALSE;
|
||||
}
|
||||
/* Do not use the bitmap handle anymore, it doesn't belong to our process anymore! */
|
||||
|
||||
|
||||
Ret = TRUE;
|
||||
if(fWinIni & SPIF_UPDATEINIFILE)
|
||||
{
|
||||
|
@ -317,12 +317,12 @@ CreateDesktopA(LPCSTR lpszDesktop,
|
|||
HDESK hDesktop;
|
||||
DEVMODEW DevmodeW;
|
||||
|
||||
if (lpszDesktop != NULL)
|
||||
if (lpszDesktop != NULL)
|
||||
{
|
||||
RtlInitAnsiString(&DesktopNameA, (LPSTR)lpszDesktop);
|
||||
RtlAnsiStringToUnicodeString(&DesktopNameU, &DesktopNameA, TRUE);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlInitUnicodeString(&DesktopNameU, NULL);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ EnumDisplayDevicesA(
|
|||
BOOL rc;
|
||||
UNICODE_STRING Device;
|
||||
DISPLAY_DEVICEW DisplayDeviceW;
|
||||
|
||||
|
||||
if ( !RtlCreateUnicodeStringFromAsciiz ( &Device, (PCSZ)lpDevice ) )
|
||||
{
|
||||
SetLastError ( ERROR_OUTOFMEMORY );
|
||||
|
@ -62,7 +62,7 @@ EnumDisplayDevicesA(
|
|||
iDevNum,
|
||||
&DisplayDeviceW,
|
||||
dwFlags );
|
||||
|
||||
|
||||
/* Copy result from DisplayDeviceW to lpDisplayDevice */
|
||||
lpDisplayDevice->StateFlags = DisplayDeviceW.StateFlags;
|
||||
WideCharToMultiByte(CP_ACP,0,
|
||||
|
|
|
@ -36,7 +36,7 @@ InitThread(VOID)
|
|||
{
|
||||
PUSER32_THREAD_DATA ThreadData;
|
||||
|
||||
ThreadData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||
ThreadData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||
sizeof(USER32_THREAD_DATA));
|
||||
TlsSetValue(User32TlsIndex, ThreadData);
|
||||
}
|
||||
|
|
|
@ -43,10 +43,10 @@
|
|||
* Execution continues in WinLogon, which calls ExitWindowsEx() again to
|
||||
* terminate COM processes in the interactive user's session.
|
||||
* - WinLogon stops impersonating the interactive user (whos processes are
|
||||
* all dead by now). and enters log-out state
|
||||
* all dead by now). and enters log-out state
|
||||
* - If the ExitWindowsEx() request was for a logoff, WinLogon sends a SAS
|
||||
* event (to display the "press ctrl+alt+del") to the GINA. WinLogon then
|
||||
* waits for the GINA to send a SAS event to login.
|
||||
* waits for the GINA to send a SAS event to login.
|
||||
* - If the ExitWindowsEx() request was for shutdown/restart, WinLogon calls
|
||||
* ExitWindowsEx() again in the system process context.
|
||||
* - CSRSS goes through the motions of sending WM_QUERYENDSESSION/WM_ENDSESSION
|
||||
|
|
|
@ -333,9 +333,9 @@ static UINT ICO_ExtractIconExW(
|
|||
NE_NAMEINFO *pIconStorage = NULL;
|
||||
NE_NAMEINFO *pIconDir = NULL;
|
||||
LPicoICONDIR lpiID = NULL;
|
||||
|
||||
|
||||
TRACE("-- OS2/icon Signature (0x%08lx)\n", sig);
|
||||
|
||||
|
||||
if (pData == (BYTE*)-1)
|
||||
{
|
||||
pCIDir = ICO_GetIconDirectory(peimage, &lpiID, &uSize); /* check for .ICO file */
|
||||
|
@ -361,7 +361,7 @@ static UINT ICO_ExtractIconExW(
|
|||
}
|
||||
pTInfo = (NE_TYPEINFO *)((char*)(pTInfo+1)+pTInfo->count*sizeof(NE_NAMEINFO));
|
||||
}
|
||||
|
||||
|
||||
if ((pIconStorage && pIconDir) || lpiID) /* load resources and create icons */
|
||||
{
|
||||
if (nIcons == 0)
|
||||
|
@ -375,7 +375,7 @@ static UINT ICO_ExtractIconExW(
|
|||
UINT16 i, icon;
|
||||
if (nIcons > iconDirCount - nIconIndex)
|
||||
nIcons = iconDirCount - nIconIndex;
|
||||
|
||||
|
||||
for (i = 0; i < nIcons; i++)
|
||||
{
|
||||
/* .ICO files have only one icon directory */
|
||||
|
@ -385,7 +385,7 @@ static UINT ICO_ExtractIconExW(
|
|||
}
|
||||
if (lpiID && pCIDir) /* *.ico file, deallocate heap pointer*/
|
||||
HeapFree(GetProcessHeap(), 0, pCIDir);
|
||||
|
||||
|
||||
for (icon = 0; icon < nIcons; icon++)
|
||||
{
|
||||
pCIDir = NULL;
|
||||
|
@ -395,7 +395,7 @@ static UINT ICO_ExtractIconExW(
|
|||
for (i = 0; i < iconCount; i++)
|
||||
if (pIconStorage[i].id == ((int)pIconId[icon] | 0x8000) )
|
||||
pCIDir = USER32_LoadResource(peimage, pIconStorage + i, *(WORD*)pData, &uSize);
|
||||
|
||||
|
||||
if (pCIDir)
|
||||
RetPtr[icon] = (HICON)CreateIconFromResourceEx(pCIDir, uSize, TRUE, 0x00030000,
|
||||
(icon & 1) ? cx2 : cx1, (icon & 1) ? cy2 : cy1, flags);
|
||||
|
@ -410,7 +410,7 @@ static UINT ICO_ExtractIconExW(
|
|||
|
||||
/* exe/dll */
|
||||
else if( sig == IMAGE_NT_SIGNATURE )
|
||||
#endif
|
||||
#endif
|
||||
if( sig == IMAGE_NT_SIGNATURE )
|
||||
{
|
||||
LPBYTE idata,igdata;
|
||||
|
|
|
@ -93,15 +93,15 @@ GetUserObjectInformationA(
|
|||
LPDWORD lpnLengthNeeded)
|
||||
{
|
||||
LPWSTR buffer;
|
||||
BOOL ret = TRUE;
|
||||
|
||||
BOOL ret = TRUE;
|
||||
|
||||
DPRINT("GetUserObjectInformationA(%x %d %x %d %x)\n", hObj, nIndex,
|
||||
pvInfo, nLength, lpnLengthNeeded);
|
||||
|
||||
|
||||
if (nIndex != UOI_NAME && nIndex != UOI_TYPE)
|
||||
return GetUserObjectInformationW(hObj, nIndex, pvInfo, nLength, lpnLengthNeeded);
|
||||
|
||||
/* allocate unicode buffer */
|
||||
/* allocate unicode buffer */
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, nLength*2);
|
||||
if (buffer == NULL)
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ GetUserObjectInformationA(
|
|||
}
|
||||
}
|
||||
|
||||
/* free resources */
|
||||
/* free resources */
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ int STDCALL LoadStringA
|
|||
strBuf.Buffer = lpBuffer;
|
||||
|
||||
nErrCode = RtlUnicodeStringToAnsiString(&strBuf, &wstrResStr, FALSE);
|
||||
|
||||
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
{
|
||||
/* failure */
|
||||
|
@ -198,10 +198,10 @@ int STDCALL LoadStringW
|
|||
|
||||
/* copy the string */
|
||||
memcpy(lpBuffer, wstrResStr.Buffer, nStringLen * sizeof(WCHAR));
|
||||
|
||||
|
||||
/* null-terminate it */
|
||||
lpBuffer[nStringLen] = 0;
|
||||
|
||||
|
||||
/* success */
|
||||
return nStringLen;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ NTSTATUS
|
|||
HEAP_strcpyAtoW ( LPWSTR lpszW, LPCSTR lpszA, DWORD len )
|
||||
{
|
||||
NTSTATUS Status =
|
||||
RtlMultiByteToUnicodeN ( lpszW, len*sizeof(WCHAR), NULL, (LPSTR)lpszA, len );
|
||||
RtlMultiByteToUnicodeN ( lpszW, len*sizeof(WCHAR), NULL, (LPSTR)lpszA, len );
|
||||
lpszW[len] = L'\0';
|
||||
return Status;
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ EndTask(
|
|||
BOOL fForce)
|
||||
{
|
||||
SendMessageW(hWnd, WM_CLOSE, 0, 0);
|
||||
|
||||
|
||||
if (IsWindow(hWnd))
|
||||
{
|
||||
if (fForce)
|
||||
|
@ -185,7 +185,7 @@ EndTask(
|
|||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -515,7 +515,7 @@ BroadcastSystemMessageExA(
|
|||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
BOOL
|
||||
STDCALL
|
||||
AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)
|
||||
{
|
||||
|
@ -752,7 +752,7 @@ IMPGetIMEA( HWND hwnd, LPIMEPROA ime)
|
|||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
LRESULT
|
||||
LRESULT
|
||||
STDCALL
|
||||
SendIMEMessageExW(HWND hwnd,LPARAM lparam)
|
||||
{
|
||||
|
@ -763,7 +763,7 @@ SendIMEMessageExW(HWND hwnd,LPARAM lparam)
|
|||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
LRESULT
|
||||
LRESULT
|
||||
STDCALL
|
||||
SendIMEMessageExA(HWND hwnd, LPARAM lparam)
|
||||
{
|
||||
|
|
|
@ -43,7 +43,7 @@ KillSystemTimer(
|
|||
HWND hWnd,
|
||||
UINT_PTR IDEvent)
|
||||
{
|
||||
return NtUserKillSystemTimer(hWnd, IDEvent);
|
||||
return NtUserKillSystemTimer(hWnd, IDEvent);
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@ KillTimer(
|
|||
HWND hWnd,
|
||||
UINT_PTR IDEvent)
|
||||
{
|
||||
return NtUserKillTimer(hWnd, IDEvent);
|
||||
return NtUserKillTimer(hWnd, IDEvent);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ WinHelpA(HWND hWnd, LPCSTR lpszHelp, UINT uCommand, DWORD dwData)
|
|||
if (WinExec("winhlp32.exe -x", SW_SHOWNORMAL) < 32) {
|
||||
//ERR("can't start winhlp32.exe -x ?\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (!(hDest = FindWindowA("MS_WINHELP", NULL))) {
|
||||
//FIXME("did not find MS_WINHELP (FindWindow() failed, maybe global window handling still unimplemented)\n");
|
||||
return FALSE;
|
||||
|
|
|
@ -35,14 +35,14 @@ CreateWindowStationA(LPSTR lpwinsta,
|
|||
ANSI_STRING WindowStationNameA;
|
||||
UNICODE_STRING WindowStationNameU;
|
||||
HWINSTA hWinSta;
|
||||
|
||||
if (lpwinsta != NULL)
|
||||
|
||||
if (lpwinsta != NULL)
|
||||
{
|
||||
RtlInitAnsiString(&WindowStationNameA, lpwinsta);
|
||||
RtlAnsiStringToUnicodeString(&WindowStationNameU, &WindowStationNameA,
|
||||
RtlAnsiStringToUnicodeString(&WindowStationNameU, &WindowStationNameA,
|
||||
TRUE);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlInitUnicodeString(&WindowStationNameU, NULL);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ CreateWindowStationA(LPSTR lpwinsta,
|
|||
lpsa);
|
||||
|
||||
RtlFreeUnicodeString(&WindowStationNameU);
|
||||
|
||||
|
||||
return hWinSta;
|
||||
}
|
||||
|
||||
|
@ -68,9 +68,9 @@ CreateWindowStationW(LPWSTR lpwinsta,
|
|||
LPSECURITY_ATTRIBUTES lpsa)
|
||||
{
|
||||
UNICODE_STRING WindowStationName;
|
||||
|
||||
|
||||
RtlInitUnicodeString(&WindowStationName, lpwinsta);
|
||||
|
||||
|
||||
return NtUserCreateWindowStation(&WindowStationName,
|
||||
dwDesiredAccess,
|
||||
lpsa, 0, 0, 0);
|
||||
|
@ -294,22 +294,22 @@ OpenWindowStationA(LPSTR lpszWinSta,
|
|||
ANSI_STRING WindowStationNameA;
|
||||
UNICODE_STRING WindowStationNameU;
|
||||
HWINSTA hWinSta;
|
||||
|
||||
if (lpszWinSta != NULL)
|
||||
|
||||
if (lpszWinSta != NULL)
|
||||
{
|
||||
RtlInitAnsiString(&WindowStationNameA, lpszWinSta);
|
||||
RtlAnsiStringToUnicodeString(&WindowStationNameU, &WindowStationNameA,
|
||||
RtlAnsiStringToUnicodeString(&WindowStationNameU, &WindowStationNameA,
|
||||
TRUE);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlInitUnicodeString(&WindowStationNameU, NULL);
|
||||
}
|
||||
|
||||
|
||||
hWinSta = OpenWindowStationW(WindowStationNameU.Buffer,
|
||||
fInherit,
|
||||
dwDesiredAccess);
|
||||
|
||||
|
||||
RtlFreeUnicodeString(&WindowStationNameU);
|
||||
|
||||
return hWinSta;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* PROJECT: ReactOS User32
|
||||
* PURPOSE: [w]sprintf functions
|
||||
* FILE: lib/user32/wsprintf.c
|
||||
* PROGRAMER: Steven Edwards
|
||||
* PROGRAMER: Steven Edwards
|
||||
* REVISION HISTORY: 2003/07/13 Merged from wine user/wsprintf.c
|
||||
* NOTES: Adapted from Wine
|
||||
*/
|
||||
|
|
|
@ -59,7 +59,7 @@ U32_ACCEL_CACHE_ENTRY ** WINAPI U32AccelCacheFind(HANDLE Object, HGLOBAL Data)
|
|||
return a pointer to the list link that points to the desired entry
|
||||
*/
|
||||
U32_ACCEL_CACHE_ENTRY ** ppEntry = &U32AccelCache;
|
||||
|
||||
|
||||
for(; *ppEntry; ppEntry = &((*ppEntry)->Next))
|
||||
if((*ppEntry)->Object == Object || (*ppEntry)->Data == Data) break;
|
||||
|
||||
|
@ -145,7 +145,7 @@ HACCEL WINAPI U32LoadAccelerators(HINSTANCE hInstance, HRSRC hTableRes)
|
|||
|
||||
/* free the buffer */
|
||||
LocalFree(pAccTableData);
|
||||
|
||||
|
||||
/* failure */
|
||||
if(hAccTable == NULL) goto l_Leave;
|
||||
|
||||
|
@ -229,7 +229,7 @@ HACCEL WINAPI LoadAcceleratorsW(HINSTANCE hInstance, LPCWSTR lpTableName)
|
|||
{
|
||||
return U32LoadAccelerators
|
||||
(
|
||||
hInstance,
|
||||
hInstance,
|
||||
FindResourceExW(hInstance, MAKEINTRESOURCEW(RT_ACCELERATOR), lpTableName, 0)
|
||||
);
|
||||
}
|
||||
|
@ -296,9 +296,9 @@ int WINAPI CopyAcceleratorTableA
|
|||
)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
cAccelEntries = CopyAcceleratorTableW(hAccelSrc, lpAccelDst, cAccelEntries);
|
||||
|
||||
|
||||
if (lpAccelDst == NULL) return cAccelEntries;
|
||||
|
||||
for(i = 0; i < cAccelEntries; ++ i)
|
||||
|
@ -310,11 +310,11 @@ int WINAPI CopyAcceleratorTableA
|
|||
NULL,
|
||||
(PWCHAR)&lpAccelDst[i].key,
|
||||
sizeof(lpAccelDst[i].key)
|
||||
);
|
||||
|
||||
);
|
||||
|
||||
if(!NT_SUCCESS(nErrCode)) lpAccelDst[i].key = 0;
|
||||
}
|
||||
|
||||
|
||||
return cAccelEntries;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ LoadImageA(HINSTANCE hinst,
|
|||
UNICODE_STRING NameString;
|
||||
|
||||
if (HIWORD(lpszName))
|
||||
{
|
||||
{
|
||||
RtlCreateUnicodeStringFromAsciiz(&NameString, (LPSTR)lpszName);
|
||||
lpszWName = NameString.Buffer;
|
||||
Handle = LoadImageW(hinst, lpszWName, uType, cxDesired,
|
||||
|
@ -93,7 +93,7 @@ LoadCursorImage(HINSTANCE hinst, LPCWSTR lpszName, UINT fuLoad)
|
|||
INT id;
|
||||
ICONIMAGE *ResIcon;
|
||||
UINT ColorBits;
|
||||
|
||||
|
||||
if (!(fuLoad & LR_LOADFROMFILE))
|
||||
{
|
||||
if (hinst == NULL)
|
||||
|
@ -105,7 +105,7 @@ LoadCursorImage(HINSTANCE hinst, LPCWSTR lpszName, UINT fuLoad)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (fuLoad & LR_SHARED)
|
||||
{
|
||||
/* FIXME - pass size! */
|
||||
|
@ -151,7 +151,7 @@ LoadCursorImage(HINSTANCE hinst, LPCWSTR lpszName, UINT fuLoad)
|
|||
32, 32, fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME));
|
||||
if (hIcon && 0 != (fuLoad & LR_SHARED))
|
||||
{
|
||||
NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, (HRSRC)hfRes,
|
||||
NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, (HRSRC)hfRes,
|
||||
(HRSRC)NULL);
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ LoadCursorImage(HINSTANCE hinst, LPCWSTR lpszName, UINT fuLoad)
|
|||
{
|
||||
DbgPrint("FIXME: need LR_SHARED support loading cursor images from files\n");
|
||||
}
|
||||
|
||||
|
||||
hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING, 0, NULL);
|
||||
if (hFile == NULL)
|
||||
|
@ -185,7 +185,7 @@ LoadCursorImage(HINSTANCE hinst, LPCWSTR lpszName, UINT fuLoad)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Get a handle to the screen dc, the icon we create is going to be
|
||||
* compatable with it.
|
||||
*/
|
||||
|
@ -219,7 +219,7 @@ LoadCursorImage(HINSTANCE hinst, LPCWSTR lpszName, UINT fuLoad)
|
|||
return(NULL);
|
||||
}
|
||||
|
||||
SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes);
|
||||
SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes);
|
||||
memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes);
|
||||
|
||||
/* at this point we have a copy of the icon image to play with */
|
||||
|
@ -241,7 +241,7 @@ LoadCursorImage(HINSTANCE hinst, LPCWSTR lpszName, UINT fuLoad)
|
|||
}
|
||||
HeaderSize = sizeof(BITMAPINFOHEADER) + ColorCount * sizeof(RGBQUAD);
|
||||
}
|
||||
|
||||
|
||||
/* make data point to the start of the XOR image data */
|
||||
Data = (PBYTE)SafeIconImage + HeaderSize;
|
||||
|
||||
|
@ -271,7 +271,7 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL
|
|||
GRPCURSORICONDIR* IconResDir;
|
||||
INT id;
|
||||
ICONIMAGE *ResIcon;
|
||||
|
||||
|
||||
if (!(fuLoad & LR_LOADFROMFILE))
|
||||
{
|
||||
if (hinst == NULL)
|
||||
|
@ -283,7 +283,7 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL
|
|||
{
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
if (fuLoad & LR_SHARED)
|
||||
{
|
||||
hIcon = NtUserFindExistingCursorIcon(hinst, (HRSRC)hfRes, width, height);
|
||||
|
@ -326,7 +326,7 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL
|
|||
width, height, fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME));
|
||||
if (hIcon && 0 != (fuLoad & LR_SHARED))
|
||||
{
|
||||
NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, (HRSRC)hfRes,
|
||||
NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, (HRSRC)hfRes,
|
||||
(HRSRC)NULL);
|
||||
}
|
||||
return hIcon;
|
||||
|
@ -334,7 +334,7 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL
|
|||
else
|
||||
{
|
||||
/*
|
||||
* FIXME: This code is incorrect and is likely to crash in many cases.
|
||||
* FIXME: This code is incorrect and is likely to crash in many cases.
|
||||
* In the file the cursor/icon directory records are stored like
|
||||
* CURSORICONFILEDIR, but we treat them like CURSORICONDIR. In Wine
|
||||
* this is solved by creating a fake cursor/icon directory in memory
|
||||
|
@ -345,7 +345,7 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL
|
|||
{
|
||||
DbgPrint("FIXME: need LR_SHARED support for loading icon images from files\n");
|
||||
}
|
||||
|
||||
|
||||
hFile = CreateFileW(lpszName,
|
||||
GENERIC_READ,
|
||||
FILE_SHARE_READ,
|
||||
|
@ -396,7 +396,7 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL
|
|||
return(NULL);
|
||||
}
|
||||
|
||||
SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes);
|
||||
SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes);
|
||||
|
||||
memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes);
|
||||
|
||||
|
@ -423,7 +423,7 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL
|
|||
}
|
||||
HeaderSize = sizeof(BITMAPINFOHEADER) + ColorCount * sizeof(RGBQUAD);
|
||||
}
|
||||
|
||||
|
||||
//make data point to the start of the XOR image data
|
||||
Data = (PBYTE)SafeIconImage + HeaderSize;
|
||||
|
||||
|
@ -503,7 +503,7 @@ LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad)
|
|||
NULL);
|
||||
CloseHandle(hFile);
|
||||
if (hSection == NULL)
|
||||
{
|
||||
{
|
||||
return(NULL);
|
||||
}
|
||||
BitmapInfo = MapViewOfFile(hSection,
|
||||
|
@ -567,7 +567,7 @@ LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad)
|
|||
{
|
||||
DIBSECTION Dib;
|
||||
|
||||
hBitmap = CreateDIBSection(hScreenDc, PrivateInfo, DIB_RGB_COLORS, NULL,
|
||||
hBitmap = CreateDIBSection(hScreenDc, PrivateInfo, DIB_RGB_COLORS, NULL,
|
||||
0, 0);
|
||||
GetObjectA(hBitmap, sizeof(DIBSECTION), &Dib);
|
||||
SetDIBits(hScreenDc, hBitmap, 0, Dib.dsBm.bmHeight, Data, BitmapInfo,
|
||||
|
@ -595,7 +595,7 @@ LoadImageW(HINSTANCE hinst,
|
|||
int cxDesired,
|
||||
int cyDesired,
|
||||
UINT fuLoad)
|
||||
{
|
||||
{
|
||||
if (fuLoad & LR_DEFAULTSIZE)
|
||||
{
|
||||
if (uType == IMAGE_ICON)
|
||||
|
@ -692,7 +692,7 @@ CopyImage(HANDLE hnd, UINT type, INT desiredx, INT desiredy, UINT flags)
|
|||
}
|
||||
return res;
|
||||
}
|
||||
case IMAGE_ICON:
|
||||
case IMAGE_ICON:
|
||||
{
|
||||
static BOOL IconMsgDisplayed = FALSE;
|
||||
/* FIXME: support loading the image as shared from an instance */
|
||||
|
@ -702,7 +702,7 @@ CopyImage(HANDLE hnd, UINT type, INT desiredx, INT desiredy, UINT flags)
|
|||
}
|
||||
return CopyIcon(hnd);
|
||||
}
|
||||
case IMAGE_CURSOR:
|
||||
case IMAGE_CURSOR:
|
||||
{
|
||||
static BOOL IconMsgDisplayed = FALSE;
|
||||
/* FIXME: support loading the image as shared from an instance */
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
void DrawCaret(HWND hWnd, PTHRDCARETINFO CaretInfo)
|
||||
{
|
||||
HDC hDC, hComp;
|
||||
|
||||
|
||||
hDC = GetDC(hWnd);
|
||||
if(hDC)
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@ static BOOL GetClassInfoExCommon(
|
|||
else
|
||||
{
|
||||
Status = HEAP_strdupAtoW(&str, (LPCSTR)lpszClass, NULL);
|
||||
|
||||
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
|
@ -278,7 +278,7 @@ GetClassNameA(
|
|||
int result;
|
||||
LPWSTR ClassNameW;
|
||||
NTSTATUS Status;
|
||||
|
||||
|
||||
if(!lpClassName)
|
||||
return 0;
|
||||
|
||||
|
@ -436,7 +436,7 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
|
|||
/* Yes, this is correct. We should modify the passed structure. */
|
||||
if (lpwcx->hInstance == NULL)
|
||||
((WNDCLASSEXA*)lpwcx)->hInstance = GetModuleHandleW(NULL);
|
||||
|
||||
|
||||
RtlCopyMemory(&WndClass, lpwcx, sizeof(WNDCLASSEXW));
|
||||
|
||||
if (IS_ATOM(lpwcx->lpszMenuName) || lpwcx->lpszMenuName == 0)
|
||||
|
@ -728,7 +728,7 @@ UnregisterClassA(
|
|||
LPWSTR ClassName;
|
||||
NTSTATUS Status;
|
||||
BOOL Result;
|
||||
|
||||
|
||||
if(!IS_ATOM(lpClassName))
|
||||
{
|
||||
Status = HEAP_strdupAtoW(&ClassName, lpClassName, NULL);
|
||||
|
@ -740,12 +740,12 @@ UnregisterClassA(
|
|||
}
|
||||
else
|
||||
ClassName = (LPWSTR)lpClassName;
|
||||
|
||||
|
||||
Result = (BOOL)NtUserUnregisterClass((LPCWSTR)ClassName, hInstance, 0);
|
||||
|
||||
if(ClassName && !IS_ATOM(lpClassName))
|
||||
|
||||
if(ClassName && !IS_ATOM(lpClassName))
|
||||
HEAP_free(ClassName);
|
||||
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ GetClipboardFormatNameA(UINT format, LPSTR lpszFormatName, int cchMaxCount)
|
|||
HEAP_strcpyWtoA(lpszFormatName, lpBuffer, Length);
|
||||
HEAP_free(lpBuffer);
|
||||
DPRINT("GetClipboardFormatNameA(%x): returning %s\n", format, lpszFormatName);
|
||||
|
||||
|
||||
return Length;
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ GetClipboardFormatNameW(UINT format, LPWSTR lpszFormatName, INT cchMaxCount)
|
|||
{
|
||||
UNICODE_STRING FormatName;
|
||||
ULONG Ret;
|
||||
|
||||
|
||||
FormatName.Length = 0;
|
||||
FormatName.MaximumLength = cchMaxCount * sizeof(WCHAR);
|
||||
FormatName.Buffer = (PWSTR)lpszFormatName;
|
||||
|
|
|
@ -44,7 +44,7 @@ User32SetupDefaultCursors(PVOID Arguments, ULONG ArgumentLength)
|
|||
{
|
||||
BOOL *DefaultCursor = (BOOL*)Arguments;
|
||||
LRESULT Result = TRUE;
|
||||
|
||||
|
||||
if(*DefaultCursor)
|
||||
{
|
||||
/* set default cursor */
|
||||
|
@ -56,7 +56,7 @@ User32SetupDefaultCursors(PVOID Arguments, ULONG ArgumentLength)
|
|||
SetCursor(0);
|
||||
SetCursor(LoadCursorW(0, (LPCWSTR)IDC_ARROW));
|
||||
}
|
||||
|
||||
|
||||
return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ HCURSOR STDCALL
|
|||
CopyCursor(HCURSOR pcur)
|
||||
{
|
||||
ICONINFO IconInfo;
|
||||
|
||||
|
||||
if(NtUserGetCursorIconInfo((HANDLE)pcur, &IconInfo))
|
||||
{
|
||||
return (HCURSOR)NtUserCreateCursorIconHandle(&IconInfo, FALSE);
|
||||
|
@ -124,10 +124,10 @@ CreateCursor(HINSTANCE hInst,
|
|||
IconInfo.hbmMask = CreateDIBitmap(hScreenDc, &bwBIH->bmiHeader, 0,
|
||||
NULL, bwBIH, DIB_RGB_COLORS);
|
||||
if (IconInfo.hbmMask)
|
||||
{
|
||||
SetDIBits(hScreenDc, IconInfo.hbmMask, 0, nHeight,
|
||||
{
|
||||
SetDIBits(hScreenDc, IconInfo.hbmMask, 0, nHeight,
|
||||
pvXORPlane, bwBIH, DIB_RGB_COLORS);
|
||||
SetDIBits(hScreenDc, IconInfo.hbmMask, nHeight, nHeight,
|
||||
SetDIBits(hScreenDc, IconInfo.hbmMask, nHeight, nHeight,
|
||||
pvANDPlane, bwBIH, DIB_RGB_COLORS);
|
||||
}
|
||||
else
|
||||
|
@ -141,7 +141,7 @@ CreateCursor(HINSTANCE hInst,
|
|||
IconInfo.xHotspot = xHotSpot;
|
||||
IconInfo.yHotspot = yHotSpot;
|
||||
IconInfo.hbmColor = 0;
|
||||
|
||||
|
||||
return (HCURSOR)NtUserCreateCursorIconHandle(&IconInfo, FALSE);
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ GetCursorPos(LPPOINT lpPoint)
|
|||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
res = NtUserGetCursorPos(lpPoint);
|
||||
|
||||
return res;
|
||||
|
@ -232,7 +232,7 @@ LoadCursorFromFileA(LPCSTR lpFileName)
|
|||
UNICODE_STRING FileName;
|
||||
HCURSOR Result;
|
||||
RtlCreateUnicodeStringFromAsciiz(&FileName, (LPSTR)lpFileName);
|
||||
Result = LoadImageW(0, FileName.Buffer, IMAGE_CURSOR, 0, 0,
|
||||
Result = LoadImageW(0, FileName.Buffer, IMAGE_CURSOR, 0, 0,
|
||||
LR_LOADFROMFILE | LR_DEFAULTSIZE);
|
||||
RtlFreeUnicodeString(&FileName);
|
||||
return(Result);
|
||||
|
@ -245,7 +245,7 @@ LoadCursorFromFileA(LPCSTR lpFileName)
|
|||
HCURSOR STDCALL
|
||||
LoadCursorFromFileW(LPCWSTR lpFileName)
|
||||
{
|
||||
return(LoadImageW(0, lpFileName, IMAGE_CURSOR, 0, 0,
|
||||
return(LoadImageW(0, lpFileName, IMAGE_CURSOR, 0, 0,
|
||||
LR_LOADFROMFILE | LR_DEFAULTSIZE));
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,7 @@ SetCursorPos(int X,
|
|||
int Y)
|
||||
{
|
||||
INPUT Input;
|
||||
|
||||
|
||||
Input.type = INPUT_MOUSE;
|
||||
Input.mi.dx = (LONG)X;
|
||||
Input.mi.dy = (LONG)Y;
|
||||
|
@ -300,7 +300,7 @@ SetCursorPos(int X,
|
|||
Input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
|
||||
Input.mi.time = 0;
|
||||
Input.mi.dwExtraInfo = 0;
|
||||
|
||||
|
||||
NtUserSendInput(1, &Input, sizeof(INPUT));
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ GetSysColor(int nIndex)
|
|||
{
|
||||
return SysColors[nIndex];
|
||||
}
|
||||
|
||||
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ SetSysColors(
|
|||
|
||||
ChangeSysColors.Elements = (INT*)lpaElements;
|
||||
ChangeSysColors.Colors = (COLORREF*)lpaRgbValues;
|
||||
|
||||
|
||||
if(cElements > 0)
|
||||
{
|
||||
Ret = NtUserSetSysColors(&ChangeSysColors, cElements);
|
||||
|
@ -147,7 +147,7 @@ SetSysColors(
|
|||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
Ret = FALSE;
|
||||
}
|
||||
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
@ -286,15 +286,15 @@ DefWndHandleSetCursor(HWND hWnd, WPARAM wParam, LPARAM lParam, ULONG Style)
|
|||
return((LRESULT)SetCursor(LoadCursorW(0, IDC_ARROW)));
|
||||
}
|
||||
|
||||
static LONG
|
||||
static LONG
|
||||
DefWndStartSizeMove(HWND hWnd, WPARAM wParam, POINT *capturePoint)
|
||||
{
|
||||
LONG hittest = 0;
|
||||
POINT pt;
|
||||
MSG msg;
|
||||
RECT rectWindow;
|
||||
ULONG Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||
|
||||
ULONG Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||
|
||||
GetWindowRect(hWnd, &rectWindow);
|
||||
|
||||
if ((wParam & 0xfff0) == SC_MOVE)
|
||||
|
@ -327,10 +327,10 @@ DefWndStartSizeMove(HWND hWnd, WPARAM wParam, POINT *capturePoint)
|
|||
if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT))
|
||||
hittest = 0;
|
||||
break;
|
||||
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
return 0;
|
||||
|
||||
|
||||
case WM_KEYDOWN:
|
||||
switch(msg.wParam)
|
||||
{
|
||||
|
@ -375,21 +375,21 @@ DefWndStartSizeMove(HWND hWnd, WPARAM wParam, POINT *capturePoint)
|
|||
#define ON_BOTTOM_BORDER(hit) \
|
||||
(((hit) == HTBOTTOM) || ((hit) == HTBOTTOMLEFT) || ((hit) == HTBOTTOMRIGHT))
|
||||
|
||||
VOID STATIC
|
||||
VOID STATIC
|
||||
UserDrawWindowFrame(HDC hdc, const RECT *rect,
|
||||
ULONG width, ULONG height)
|
||||
{
|
||||
static HBRUSH hDraggingRectBrush = NULL;
|
||||
|
||||
|
||||
if(!hDraggingRectBrush)
|
||||
{
|
||||
static HBITMAP hDraggingPattern = NULL;
|
||||
const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA};
|
||||
|
||||
|
||||
hDraggingPattern = CreateBitmap(8, 8, 1, 1, Pattern);
|
||||
hDraggingRectBrush = CreatePatternBrush(hDraggingPattern);
|
||||
}
|
||||
|
||||
|
||||
HBRUSH hbrush = SelectObject( hdc, hDraggingRectBrush );
|
||||
PatBlt( hdc, rect->left, rect->top,
|
||||
rect->right - rect->left - width, height, PATINVERT );
|
||||
|
@ -427,7 +427,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
POINT minTrack, maxTrack;
|
||||
POINT capturePoint, pt;
|
||||
ULONG Style = GetWindowLongW(hwnd, GWL_STYLE);
|
||||
ULONG ExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE);
|
||||
ULONG ExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE);
|
||||
BOOL thickframe;
|
||||
BOOL iconic = Style & WS_MINIMIZE;
|
||||
BOOL moved = FALSE;
|
||||
|
@ -436,20 +436,20 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
HWND hWndParent = NULL;
|
||||
|
||||
SystemParametersInfoA(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0);
|
||||
|
||||
|
||||
pt.x = GET_X_LPARAM(dwPoint);
|
||||
pt.y = GET_Y_LPARAM(dwPoint);
|
||||
capturePoint = pt;
|
||||
|
||||
|
||||
if (IsZoomed(hwnd) || !IsWindowVisible(hwnd))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
thickframe = UserHasThickFrameStyle(Style, ExStyle) && !(Style & WS_MINIMIZE);
|
||||
if ((wParam & 0xfff0) == SC_MOVE)
|
||||
{
|
||||
if (!hittest)
|
||||
if (!hittest)
|
||||
{
|
||||
hittest = DefWndStartSizeMove(hwnd, wParam, &capturePoint);
|
||||
}
|
||||
|
@ -481,7 +481,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
}
|
||||
|
||||
/* Get min/max info */
|
||||
|
||||
|
||||
WinPosGetMinMaxInfo(hwnd, NULL, NULL, &minTrack, &maxTrack);
|
||||
GetWindowRect(hwnd, &sizingRect);
|
||||
if (Style & WS_CHILD)
|
||||
|
@ -493,7 +493,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
clipRect = mouseRect;
|
||||
MapWindowPoints(hWndParent, HWND_DESKTOP, (LPPOINT)&clipRect, 2);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if(!(ExStyle & WS_EX_TOPMOST))
|
||||
{
|
||||
|
@ -508,7 +508,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
unmodRect = sizingRect;
|
||||
}
|
||||
ClipCursor(&clipRect);
|
||||
|
||||
|
||||
origRect = sizingRect;
|
||||
if (ON_LEFT_BORDER(hittest))
|
||||
{
|
||||
|
@ -531,14 +531,14 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
mouseRect.bottom = min( mouseRect.bottom, sizingRect.top+maxTrack.y );
|
||||
}
|
||||
if (Style & WS_CHILD)
|
||||
{
|
||||
{
|
||||
MapWindowPoints( hWndParent, 0, (LPPOINT)&mouseRect, 2 );
|
||||
}
|
||||
|
||||
|
||||
SendMessageA( hwnd, WM_ENTERSIZEMOVE, 0, 0 );
|
||||
NtUserSetGUIThreadHandle(MSQ_STATE_MOVESIZE, hwnd);
|
||||
if (GetCapture() != hwnd) SetCapture( hwnd );
|
||||
|
||||
if (GetCapture() != hwnd) SetCapture( hwnd );
|
||||
|
||||
if (Style & WS_CHILD)
|
||||
{
|
||||
/* Retrieve a default cache DC (without using the window style) */
|
||||
|
@ -550,9 +550,9 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
hdc = GetDC( 0 );
|
||||
DesktopRgn = CreateRectRgnIndirect(&clipRect);
|
||||
}
|
||||
|
||||
|
||||
SelectObject(hdc, DesktopRgn);
|
||||
|
||||
|
||||
if( iconic ) /* create a cursor for dragging */
|
||||
{
|
||||
HICON hIcon = (HICON)GetClassLongW(hwnd, GCL_HICON);
|
||||
|
@ -560,25 +560,25 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
if( hIcon ) hDragCursor = CursorIconToCursor( hIcon, TRUE );
|
||||
if( !hDragCursor ) iconic = FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* invert frame if WIN31_LOOK to indicate mouse click on caption */
|
||||
if( !iconic && !DragFullWindows)
|
||||
{
|
||||
UserDrawMovingFrame( hdc, &sizingRect, thickframe);
|
||||
}
|
||||
|
||||
|
||||
for(;;)
|
||||
{
|
||||
int dx = 0, dy = 0;
|
||||
|
||||
if (GetMessageW(&msg, 0, 0, 0) <= 0)
|
||||
break;
|
||||
|
||||
|
||||
/* Exit on button-up, Return, or Esc */
|
||||
if ((msg.message == WM_LBUTTONUP) ||
|
||||
((msg.message == WM_KEYDOWN) &&
|
||||
((msg.message == WM_KEYDOWN) &&
|
||||
((msg.wParam == VK_RETURN) || (msg.wParam == VK_ESCAPE)))) break;
|
||||
|
||||
|
||||
if (msg.message == WM_PAINT)
|
||||
{
|
||||
if(!iconic && !DragFullWindows) UserDrawMovingFrame( hdc, &sizingRect, thickframe );
|
||||
|
@ -586,47 +586,47 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
if(!iconic && !DragFullWindows) UserDrawMovingFrame( hdc, &sizingRect, thickframe );
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ((msg.message != WM_KEYDOWN) && (msg.message != WM_MOUSEMOVE))
|
||||
continue; /* We are not interested in other messages */
|
||||
|
||||
|
||||
pt = msg.pt;
|
||||
|
||||
|
||||
if (msg.message == WM_KEYDOWN) switch(msg.wParam)
|
||||
{
|
||||
case VK_UP: pt.y -= 8; break;
|
||||
case VK_DOWN: pt.y += 8; break;
|
||||
case VK_LEFT: pt.x -= 8; break;
|
||||
case VK_RIGHT: pt.x += 8; break;
|
||||
case VK_RIGHT: pt.x += 8; break;
|
||||
}
|
||||
|
||||
|
||||
pt.x = max( pt.x, mouseRect.left );
|
||||
pt.x = min( pt.x, mouseRect.right );
|
||||
pt.y = max( pt.y, mouseRect.top );
|
||||
pt.y = min( pt.y, mouseRect.bottom );
|
||||
|
||||
|
||||
dx = pt.x - capturePoint.x;
|
||||
dy = pt.y - capturePoint.y;
|
||||
|
||||
|
||||
if (dx || dy)
|
||||
{
|
||||
if( !moved )
|
||||
{
|
||||
moved = TRUE;
|
||||
|
||||
|
||||
if( iconic ) /* ok, no system popup tracking */
|
||||
{
|
||||
hOldCursor = SetCursor(hDragCursor);
|
||||
ShowCursor( TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (msg.message == WM_KEYDOWN) SetCursorPos( pt.x, pt.y );
|
||||
else
|
||||
{
|
||||
RECT newRect = unmodRect;
|
||||
WPARAM wpSizingHit = 0;
|
||||
|
||||
|
||||
if (hittest == HTCAPTION) OffsetRect( &newRect, dx, dy );
|
||||
if (ON_LEFT_BORDER(hittest)) newRect.left += dx;
|
||||
else if (ON_RIGHT_BORDER(hittest)) newRect.right += dx;
|
||||
|
@ -634,13 +634,13 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
else if (ON_BOTTOM_BORDER(hittest)) newRect.bottom += dy;
|
||||
if(!iconic && !DragFullWindows) UserDrawMovingFrame( hdc, &sizingRect, thickframe );
|
||||
capturePoint = pt;
|
||||
|
||||
|
||||
/* determine the hit location */
|
||||
if (hittest >= HTLEFT && hittest <= HTBOTTOMRIGHT)
|
||||
wpSizingHit = WMSZ_LEFT + (hittest - HTLEFT);
|
||||
unmodRect = newRect;
|
||||
SendMessageA( hwnd, WM_SIZING, wpSizingHit, (LPARAM)&newRect );
|
||||
|
||||
|
||||
if (!iconic)
|
||||
{
|
||||
if(!DragFullWindows)
|
||||
|
@ -658,7 +658,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ReleaseCapture();
|
||||
ClipCursor(NULL);
|
||||
if( iconic )
|
||||
|
@ -672,7 +672,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
}
|
||||
else if(!DragFullWindows)
|
||||
UserDrawMovingFrame( hdc, &sizingRect, thickframe );
|
||||
|
||||
|
||||
if (Style & WS_CHILD)
|
||||
ReleaseDC( hWndParent, hdc );
|
||||
else
|
||||
|
@ -686,7 +686,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
NtUserSetGUIThreadHandle(MSQ_STATE_MOVESIZE, NULL);
|
||||
SendMessageA( hwnd, WM_EXITSIZEMOVE, 0, 0 );
|
||||
SendMessageA( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L);
|
||||
|
||||
|
||||
/* window moved or resized */
|
||||
if (moved)
|
||||
{
|
||||
|
@ -708,17 +708,17 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
|||
origRect.right - origRect.left,
|
||||
origRect.bottom - origRect.top,
|
||||
( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( IsWindow(hwnd) )
|
||||
if( Style & WS_MINIMIZE )
|
||||
{
|
||||
/* Single click brings up the system menu when iconized */
|
||||
|
||||
if( !moved )
|
||||
|
||||
if( !moved )
|
||||
{
|
||||
if( Style & WS_SYSMENU )
|
||||
if( Style & WS_SYSMENU )
|
||||
SendMessageA( hwnd, WM_SYSCOMMAND,
|
||||
SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y));
|
||||
}
|
||||
|
@ -760,7 +760,7 @@ LRESULT
|
|||
DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, POINT Pt)
|
||||
{
|
||||
WINDOWPLACEMENT wp;
|
||||
|
||||
|
||||
switch (wParam & 0xfff0)
|
||||
{
|
||||
case SC_MOVE:
|
||||
|
@ -933,7 +933,7 @@ DefWndControlColor(HDC hDC, UINT ctlType)
|
|||
VOID FASTCALL
|
||||
DefWndScreenshot(HWND hWnd)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
LRESULT STDCALL
|
||||
|
@ -1028,9 +1028,9 @@ User32DefWindowProc(HWND hWnd,
|
|||
POINT Pt;
|
||||
DWORD Style;
|
||||
LONG HitCode;
|
||||
|
||||
|
||||
Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||
|
||||
|
||||
Pt.x = GET_X_LPARAM(lParam);
|
||||
Pt.y = GET_Y_LPARAM(lParam);
|
||||
if (Style & WS_CHILD)
|
||||
|
@ -1044,17 +1044,17 @@ User32DefWindowProc(HWND hWnd,
|
|||
{
|
||||
HMENU SystemMenu;
|
||||
UINT Flags;
|
||||
|
||||
|
||||
if((SystemMenu = GetSystemMenu(hWnd, FALSE)))
|
||||
{
|
||||
MenuInitSysMenuPopup(SystemMenu, GetWindowLongW(hWnd, GWL_STYLE),
|
||||
GetClassLongW(hWnd, GCL_STYLE), HitCode);
|
||||
|
||||
|
||||
if(HitCode == HTCAPTION)
|
||||
Flags = TPM_LEFTBUTTON | TPM_RIGHTBUTTON;
|
||||
else
|
||||
Flags = TPM_LEFTBUTTON;
|
||||
|
||||
|
||||
TrackPopupMenu(SystemMenu, Flags,
|
||||
Pt.x, Pt.y, 0, hWnd, NULL);
|
||||
}
|
||||
|
@ -1062,7 +1062,7 @@ User32DefWindowProc(HWND hWnd,
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case WM_PRINT:
|
||||
{
|
||||
/* FIXME: Implement. */
|
||||
|
@ -1075,7 +1075,7 @@ User32DefWindowProc(HWND hWnd,
|
|||
PAINTSTRUCT Ps;
|
||||
HDC hDC = BeginPaint(hWnd, &Ps);
|
||||
if (hDC)
|
||||
{
|
||||
{
|
||||
HICON hIcon;
|
||||
if (GetWindowLongW(hWnd, GWL_STYLE) & WS_MINIMIZE &&
|
||||
(hIcon = (HICON)GetClassLongW(hWnd, GCL_HICON)) != NULL)
|
||||
|
@ -1088,7 +1088,7 @@ User32DefWindowProc(HWND hWnd,
|
|||
y = (ClientRect.bottom - ClientRect.top -
|
||||
GetSystemMetrics(SM_CYICON)) / 2;
|
||||
DrawIcon(hDC, x, y, hIcon);
|
||||
}
|
||||
}
|
||||
EndPaint(hWnd, &Ps);
|
||||
}
|
||||
return (0);
|
||||
|
@ -1195,7 +1195,7 @@ User32DefWindowProc(HWND hWnd,
|
|||
FillRect((HDC)wParam, &Rect, hBrush);
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
case WM_CTLCOLORMSGBOX:
|
||||
case WM_CTLCOLOREDIT:
|
||||
case WM_CTLCOLORLISTBOX:
|
||||
|
@ -1208,7 +1208,7 @@ User32DefWindowProc(HWND hWnd,
|
|||
case WM_SETCURSOR:
|
||||
{
|
||||
ULONG Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||
|
||||
|
||||
if (Style & WS_CHILD)
|
||||
{
|
||||
if (LOWORD(lParam) < HTLEFT || LOWORD(lParam) > HTBOTTOMRIGHT)
|
||||
|
@ -1272,7 +1272,7 @@ User32DefWindowProc(HWND hWnd,
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case WM_SHOWWINDOW:
|
||||
{
|
||||
LONG Style;
|
||||
|
@ -1307,7 +1307,7 @@ User32DefWindowProc(HWND hWnd,
|
|||
return (-1);
|
||||
/*
|
||||
case WM_DROPOBJECT:
|
||||
|
||||
|
||||
break;
|
||||
*/
|
||||
case WM_QUERYDROPOBJECT:
|
||||
|
@ -1382,7 +1382,7 @@ User32DefWindowProc(HWND hWnd,
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case WM_SYSTIMER:
|
||||
{
|
||||
THRDCARETINFO CaretInfo;
|
||||
|
@ -1457,7 +1457,7 @@ DefWindowProcA(HWND hWnd,
|
|||
{
|
||||
ANSI_STRING AnsiString;
|
||||
UNICODE_STRING UnicodeString;
|
||||
|
||||
|
||||
if(lParam)
|
||||
{
|
||||
RtlInitAnsiString(&AnsiString, (LPSTR)lParam);
|
||||
|
@ -1467,7 +1467,7 @@ DefWindowProcA(HWND hWnd,
|
|||
}
|
||||
else
|
||||
NtUserDefSetText(hWnd, NULL);
|
||||
|
||||
|
||||
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
||||
{
|
||||
DefWndNCPaint(hWnd, (HRGN)1, -1);
|
||||
|
@ -1525,9 +1525,9 @@ DefWindowProcW(HWND hWnd,
|
|||
|
||||
if(lParam)
|
||||
RtlInitUnicodeString(&UnicodeString, (LPWSTR)lParam);
|
||||
|
||||
|
||||
NtUserDefSetText(hWnd, (lParam ? &UnicodeString : NULL));
|
||||
|
||||
|
||||
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
||||
{
|
||||
DefWndNCPaint(hWnd, (HRGN)1, -1);
|
||||
|
|
|
@ -233,7 +233,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
|
|||
info->y = GET_WORD(p); p++;
|
||||
info->cx = GET_WORD(p); p++;
|
||||
info->cy = GET_WORD(p); p++;
|
||||
|
||||
|
||||
if (dialogEx)
|
||||
{
|
||||
/* id is a DWORD for DIALOGEX */
|
||||
|
@ -245,7 +245,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
|
|||
info->id = GET_WORD(p);
|
||||
p++;
|
||||
}
|
||||
|
||||
|
||||
if (GET_WORD(p) == 0xffff)
|
||||
{
|
||||
static const WCHAR class_names[6][10] =
|
||||
|
@ -274,7 +274,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
|
|||
info->className = (LPCWSTR)p;
|
||||
p += wcslen( info->className ) + 1;
|
||||
}
|
||||
|
||||
|
||||
if (GET_WORD(p) == 0xffff) /* Is it an integer id? */
|
||||
{
|
||||
info->windowName = HeapAlloc( GetProcessHeap(), 0, 10 );
|
||||
|
@ -288,7 +288,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
|
|||
info->windowNameFree = FALSE;
|
||||
p += wcslen( info->windowName ) + 1;
|
||||
}
|
||||
|
||||
|
||||
if (GET_WORD(p))
|
||||
{
|
||||
info->data = p + 1;
|
||||
|
@ -296,9 +296,9 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
|
|||
}
|
||||
else info->data = NULL;
|
||||
p++;
|
||||
|
||||
|
||||
/* Next control is on dword boundary */
|
||||
return (const WORD *)((((int)p) + 3) & ~3);
|
||||
return (const WORD *)((((int)p) + 3) & ~3);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -366,7 +366,7 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
|
|||
if (HIWORD(class)) HeapFree( GetProcessHeap(), 0, class );
|
||||
if (HIWORD(caption)) HeapFree( GetProcessHeap(), 0, caption );
|
||||
}
|
||||
|
||||
|
||||
if (info.windowNameFree)
|
||||
{
|
||||
HeapFree( GetProcessHeap(), 0, (LPVOID)info.windowName );
|
||||
|
@ -411,7 +411,7 @@ static HWND DIALOG_FindMsgDestination( HWND hwndDlg )
|
|||
{
|
||||
HWND hParent = GetParent(hwndDlg);
|
||||
if (!hParent) break;
|
||||
|
||||
|
||||
if (!IsWindow(hParent)) break;
|
||||
|
||||
if (!GETDLGINFO(hParent)) /* TODO: Correct? */
|
||||
|
@ -589,9 +589,9 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
|
|||
p += wcslen( result->menuName ) + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Get the class name */
|
||||
|
||||
|
||||
switch(GET_WORD(p))
|
||||
{
|
||||
case 0x0000:
|
||||
|
@ -607,7 +607,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
|
|||
p += wcslen( result->className ) + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Get the window caption */
|
||||
|
||||
result->caption = (LPCWSTR)p;
|
||||
|
@ -669,7 +669,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
|
|||
dlgTemplate = DIALOG_ParseTemplate32( dlgTemplate, &template );
|
||||
|
||||
/* Initialise dialog extra data */
|
||||
|
||||
|
||||
if (!(dlgInfo = HeapAlloc( GetProcessHeap(), 0, sizeof(*dlgInfo) ))) return 0;
|
||||
dlgInfo->hwndFocus = 0;
|
||||
dlgInfo->hUserFont = 0;
|
||||
|
@ -679,11 +679,11 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
|
|||
dlgInfo->idResult = 0;
|
||||
dlgInfo->flags = 0;
|
||||
//dlgInfo->hDialogHeap = 0;
|
||||
|
||||
|
||||
/* Load menu */
|
||||
|
||||
if (template.menuName) dlgInfo->hMenu = LoadMenuW( hInst, template.menuName );
|
||||
|
||||
|
||||
/* Create custom font if needed */
|
||||
|
||||
if (template.style & DS_SETFONT)
|
||||
|
@ -758,7 +758,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
|
|||
if( rect.top < 0 ) rect.top = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (modal)
|
||||
{
|
||||
ownerEnabled = DIALOG_DisableOwner( owner );
|
||||
|
@ -795,7 +795,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
|
|||
owner, dlgInfo->hMenu, hInst, NULL );
|
||||
if (HIWORD(class)) HeapFree( GetProcessHeap(), 0, class );
|
||||
if (HIWORD(caption)) HeapFree( GetProcessHeap(), 0, caption );
|
||||
}
|
||||
}
|
||||
|
||||
if (!hwnd)
|
||||
{
|
||||
|
@ -819,12 +819,12 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
|
|||
SETDLGINFO(hwnd, dlgInfo);
|
||||
SetWindowLongA( hwnd, DWL_DLGPROC, (LONG)dlgProc );
|
||||
}
|
||||
|
||||
|
||||
if (dlgInfo->hUserFont)
|
||||
SendMessageA( hwnd, WM_SETFONT, (WPARAM)dlgInfo->hUserFont, 0 );
|
||||
|
||||
|
||||
/* Create controls */
|
||||
|
||||
|
||||
if (DIALOG_CreateControls32( hwnd, dlgTemplate, &template, hInst, unicode ))
|
||||
{
|
||||
/* Send initialisation messages and set focus */
|
||||
|
@ -843,7 +843,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
|
|||
}
|
||||
return hwnd;
|
||||
}
|
||||
|
||||
|
||||
if( IsWindow(hwnd) ) DestroyWindow( hwnd );
|
||||
if (modal && ownerEnabled) DIALOG_EnableOwner(owner);
|
||||
return 0;
|
||||
|
@ -874,7 +874,7 @@ static void DEFDLG_SetFocus( HWND hwndDlg, HWND hwndCtrl )
|
|||
*/
|
||||
static void DEFDLG_SaveFocus( HWND hwnd )
|
||||
{
|
||||
DIALOGINFO *infoPtr;
|
||||
DIALOGINFO *infoPtr;
|
||||
HWND hwndFocus = GetFocus();
|
||||
|
||||
if (!hwndFocus || !IsChild( hwnd, hwndFocus )) return;
|
||||
|
@ -985,7 +985,7 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
|
|||
GlobalFree16(dlgInfo->hDialogHeap);
|
||||
}*/
|
||||
if (dlgInfo->hUserFont) DeleteObject( dlgInfo->hUserFont );
|
||||
if (dlgInfo->hMenu) DestroyMenu( dlgInfo->hMenu );
|
||||
if (dlgInfo->hMenu) DestroyMenu( dlgInfo->hMenu );
|
||||
HeapFree( GetProcessHeap(), 0, dlgInfo );
|
||||
}
|
||||
/* Window clean-up */
|
||||
|
@ -1337,8 +1337,8 @@ BOOL CALLBACK GetDlgItemEnumProc (HWND hwnd, LPARAM lParam )
|
|||
{
|
||||
GETDLGITEMINFO * info = (GETDLGITEMINFO *)lParam;
|
||||
if(info->nIDDlgItem == GetWindowLongW( hwnd, GWL_ID ))
|
||||
{
|
||||
info->control = hwnd;
|
||||
{
|
||||
info->control = hwnd;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -1458,7 +1458,7 @@ DefDlgProcA(
|
|||
DIALOGINFO * dlgInfo;
|
||||
|
||||
/* if there's no dialog info property then call default windows proc?? */
|
||||
if (!(dlgInfo = GETDLGINFO(hDlg)))
|
||||
if (!(dlgInfo = GETDLGINFO(hDlg)))
|
||||
return DefWindowProcA( hDlg, Msg, wParam, lParam );
|
||||
|
||||
SetWindowLongW( hDlg, DWL_MSGRESULT, 0 );
|
||||
|
@ -1519,7 +1519,7 @@ DefDlgProcW(
|
|||
DIALOGINFO * dlgInfo;
|
||||
|
||||
/* if there's no dialog info property then call default windows proc?? */
|
||||
if (!(dlgInfo = GETDLGINFO(hDlg)))
|
||||
if (!(dlgInfo = GETDLGINFO(hDlg)))
|
||||
return DefWindowProcW( hDlg, Msg, wParam, lParam );
|
||||
|
||||
SetWindowLongW( hDlg, DWL_MSGRESULT, 0 );
|
||||
|
@ -1636,7 +1636,7 @@ DialogBoxParamA(
|
|||
HWND hwnd;
|
||||
HRSRC hrsrc;
|
||||
LPCDLGTEMPLATE ptr;
|
||||
|
||||
|
||||
if (!(hrsrc = FindResourceA( hInstance, lpTemplateName, (LPCSTR)RT_DIALOG ))) return 0;
|
||||
if (!(ptr = (LPCDLGTEMPLATE)LoadResource(hInstance, hrsrc))) return 0;
|
||||
hwnd = DIALOG_CreateIndirect(hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam, FALSE, TRUE);
|
||||
|
@ -1660,7 +1660,7 @@ DialogBoxParamW(
|
|||
HWND hwnd;
|
||||
HRSRC hrsrc;
|
||||
LPCDLGTEMPLATE ptr;
|
||||
|
||||
|
||||
if (!(hrsrc = FindResourceW( hInstance, lpTemplateName, (LPCWSTR)RT_DIALOG ))) return 0;
|
||||
if (!(ptr = (LPCDLGTEMPLATE)LoadResource(hInstance, hrsrc))) return 0;
|
||||
hwnd = DIALOG_CreateIndirect(hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam, TRUE, TRUE);
|
||||
|
@ -1811,7 +1811,7 @@ EndDialog(
|
|||
HWND owner;
|
||||
|
||||
if (!(dlgInfo = GETDLGINFO(hDlg))) return FALSE;
|
||||
|
||||
|
||||
dlgInfo->idResult = nResult;
|
||||
dlgInfo->flags |= DF_END;
|
||||
wasEnabled = (dlgInfo->flags & DF_OWNERENABLED);
|
||||
|
@ -2058,20 +2058,20 @@ IsDialogMessageA(
|
|||
LPMSG lpMsg)
|
||||
{
|
||||
INT dlgCode = 0;
|
||||
|
||||
|
||||
// FIXME: hooks
|
||||
//if (CallMsgFilterA( lpMsg, MSGF_DIALOGBOX )) return TRUE;
|
||||
|
||||
|
||||
if ((hDlg != lpMsg->hwnd) && !IsChild( hDlg, lpMsg->hwnd )) return FALSE;
|
||||
|
||||
|
||||
hDlg = DIALOG_FindMsgDestination(hDlg);
|
||||
|
||||
|
||||
switch(lpMsg->message)
|
||||
{
|
||||
case WM_KEYDOWN:
|
||||
dlgCode = SendMessageA( lpMsg->hwnd, WM_GETDLGCODE, lpMsg->wParam, (LPARAM)lpMsg );
|
||||
if (dlgCode & DLGC_WANTMESSAGE) break;
|
||||
|
||||
|
||||
switch(lpMsg->wParam)
|
||||
{
|
||||
case VK_TAB:
|
||||
|
@ -2081,7 +2081,7 @@ IsDialogMessageA(
|
|||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case VK_RIGHT:
|
||||
case VK_DOWN:
|
||||
case VK_LEFT:
|
||||
|
@ -2094,12 +2094,12 @@ IsDialogMessageA(
|
|||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case VK_CANCEL:
|
||||
case VK_ESCAPE:
|
||||
SendMessageA( hDlg, WM_COMMAND, IDCANCEL, (LPARAM)GetDlgItem( hDlg, IDCANCEL ) );
|
||||
return TRUE;
|
||||
|
||||
|
||||
case VK_EXECUTE:
|
||||
case VK_RETURN:
|
||||
{
|
||||
|
@ -2112,19 +2112,19 @@ IsDialogMessageA(
|
|||
else
|
||||
{
|
||||
SendMessageA( hDlg, WM_COMMAND, IDOK, (LPARAM)GetDlgItem( hDlg, IDOK ) );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case WM_CHAR:
|
||||
dlgCode = SendMessageA( lpMsg->hwnd, WM_GETDLGCODE, lpMsg->wParam, (LPARAM)lpMsg );
|
||||
if (dlgCode & (DLGC_WANTCHARS|DLGC_WANTMESSAGE)) break;
|
||||
if (lpMsg->wParam == '\t' && (dlgCode & DLGC_WANTTAB)) break;
|
||||
/* drop through */
|
||||
|
||||
|
||||
case WM_SYSCHAR:
|
||||
if (DIALOG_IsAccelerator( lpMsg->hwnd, hDlg, lpMsg->wParam ))
|
||||
{
|
||||
|
@ -2133,7 +2133,7 @@ IsDialogMessageA(
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
TranslateMessage( lpMsg );
|
||||
DispatchMessageA( lpMsg );
|
||||
return TRUE;
|
||||
|
@ -2150,20 +2150,20 @@ IsDialogMessageW(
|
|||
LPMSG lpMsg)
|
||||
{
|
||||
INT dlgCode = 0;
|
||||
|
||||
|
||||
// FIXME: hooks
|
||||
//if (CallMsgFilterW( lpMsg, MSGF_DIALOGBOX )) return TRUE;
|
||||
|
||||
|
||||
if ((hDlg != lpMsg->hwnd) && !IsChild( hDlg, lpMsg->hwnd )) return FALSE;
|
||||
|
||||
|
||||
hDlg = DIALOG_FindMsgDestination(hDlg);
|
||||
|
||||
|
||||
switch(lpMsg->message)
|
||||
{
|
||||
case WM_KEYDOWN:
|
||||
dlgCode = SendMessageW( lpMsg->hwnd, WM_GETDLGCODE, lpMsg->wParam, (LPARAM)lpMsg );
|
||||
if (dlgCode & DLGC_WANTMESSAGE) break;
|
||||
|
||||
|
||||
switch(lpMsg->wParam)
|
||||
{
|
||||
case VK_TAB:
|
||||
|
@ -2173,7 +2173,7 @@ IsDialogMessageW(
|
|||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case VK_RIGHT:
|
||||
case VK_DOWN:
|
||||
case VK_LEFT:
|
||||
|
@ -2186,12 +2186,12 @@ IsDialogMessageW(
|
|||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case VK_CANCEL:
|
||||
case VK_ESCAPE:
|
||||
SendMessageW( hDlg, WM_COMMAND, IDCANCEL, (LPARAM)GetDlgItem( hDlg, IDCANCEL ) );
|
||||
return TRUE;
|
||||
|
||||
|
||||
case VK_EXECUTE:
|
||||
case VK_RETURN:
|
||||
{
|
||||
|
@ -2204,19 +2204,19 @@ IsDialogMessageW(
|
|||
else
|
||||
{
|
||||
SendMessageW( hDlg, WM_COMMAND, IDOK, (LPARAM)GetDlgItem( hDlg, IDOK ) );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case WM_CHAR:
|
||||
dlgCode = SendMessageW( lpMsg->hwnd, WM_GETDLGCODE, lpMsg->wParam, (LPARAM)lpMsg );
|
||||
if (dlgCode & (DLGC_WANTCHARS|DLGC_WANTMESSAGE)) break;
|
||||
if (lpMsg->wParam == '\t' && (dlgCode & DLGC_WANTTAB)) break;
|
||||
/* drop through */
|
||||
|
||||
|
||||
case WM_SYSCHAR:
|
||||
if (DIALOG_IsAccelerator( lpMsg->hwnd, hDlg, lpMsg->wParam ))
|
||||
{
|
||||
|
@ -2225,7 +2225,7 @@ IsDialogMessageW(
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
TranslateMessage( lpMsg );
|
||||
DispatchMessageW( lpMsg );
|
||||
return TRUE;
|
||||
|
@ -2366,7 +2366,7 @@ static BOOL CALLBACK CheckRB(HWND hwnd, LPARAM lParam)
|
|||
{
|
||||
LONG lChildID = GetWindowLongW(hwnd, GWL_ID);
|
||||
RADIOGROUP *lpRadioGroup = (RADIOGROUP *)lParam;
|
||||
|
||||
|
||||
if((lChildID >= lpRadioGroup->firstID) &&
|
||||
(lChildID <= lpRadioGroup->lastID))
|
||||
{
|
||||
|
@ -2379,7 +2379,7 @@ static BOOL CALLBACK CheckRB(HWND hwnd, LPARAM lParam)
|
|||
SendMessageW(hwnd, BM_SETCHECK, BST_UNCHECKED, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -2395,11 +2395,11 @@ CheckRadioButton(
|
|||
int nIDCheckButton)
|
||||
{
|
||||
RADIOGROUP radioGroup;
|
||||
|
||||
|
||||
radioGroup.firstID = nIDFirstButton;
|
||||
radioGroup.lastID = nIDLastButton;
|
||||
radioGroup.checkID = nIDCheckButton;
|
||||
|
||||
|
||||
return EnumChildWindows(hDlg, CheckRB, (LPARAM)&radioGroup);
|
||||
}
|
||||
|
||||
|
|
|
@ -1370,21 +1370,21 @@ IntGrayString(
|
|||
ForeColor = SetTextColor(hDC, RGB(0, 0, 0));
|
||||
BackColor = SetBkColor(hDC, RGB(255, 255, 255));
|
||||
|
||||
|
||||
|
||||
if (! hBrush)
|
||||
{
|
||||
// The documentation is a little vague on what exactly should happen
|
||||
// here. Something about using the same brush for window text???
|
||||
hBrush = (HBRUSH) GetCurrentObject(hDC, OBJ_BRUSH);
|
||||
}
|
||||
|
||||
|
||||
if ((nCount == -1) && (! lpOutputFunc))
|
||||
return FALSE;
|
||||
|
||||
|
||||
if (! nCount)
|
||||
{
|
||||
// TODO: calculate the length (easy enough)
|
||||
|
||||
|
||||
if (unicode)
|
||||
nCount = lstrlenW((WCHAR*)lpData);
|
||||
else
|
||||
|
@ -1395,19 +1395,19 @@ IntGrayString(
|
|||
{
|
||||
SIZE s;
|
||||
// TODO: calculate the rect
|
||||
|
||||
|
||||
if (unicode)
|
||||
success = GetTextExtentPoint32W(hDC, (WCHAR*) lpData, nCount, &s);
|
||||
else
|
||||
success = GetTextExtentPoint32A(hDC, (CHAR*) lpData, nCount, &s);
|
||||
|
||||
if (! success) goto cleanup;
|
||||
|
||||
|
||||
if (! nWidth) nWidth = s.cx;
|
||||
if (! nHeight) nHeight = s.cy;
|
||||
}
|
||||
|
||||
SetRect(&r, X, Y, X + nWidth, Y + nHeight);
|
||||
SetRect(&r, X, Y, X + nWidth, Y + nHeight);
|
||||
|
||||
MemDC = CreateCompatibleDC(hDC);
|
||||
if (! MemDC) goto cleanup;
|
||||
|
@ -1424,11 +1424,11 @@ IntGrayString(
|
|||
|
||||
SetTextColor(MemDC, RGB(255, 255, 255));
|
||||
SetBkColor(MemDC, RGB(0, 0, 0));
|
||||
|
||||
|
||||
if (lpOutputFunc)
|
||||
{
|
||||
success = lpOutputFunc(MemDC, lpData, nCount); // Set brush etc first?
|
||||
|
||||
|
||||
if ((nCount == -1) && (! success))
|
||||
{
|
||||
// Don't gray (documented behaviour)
|
||||
|
@ -1442,7 +1442,7 @@ IntGrayString(
|
|||
success = TextOutW(MemDC, 0, 0, (WCHAR*) lpData, nCount);
|
||||
else
|
||||
success = TextOutA(MemDC, 0, 0, (CHAR*) lpData, nCount);
|
||||
|
||||
|
||||
if (! success) goto cleanup;
|
||||
|
||||
PatBlt(MemDC, 0, 0, nWidth, nHeight, PATCOPY);
|
||||
|
@ -1780,12 +1780,12 @@ FrameRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr)
|
|||
|
||||
if ((r.right <= r.left) || (r.bottom <= r.top)) return 0;
|
||||
if (!(oldbrush = SelectObject(hDC, hbr))) return 0;
|
||||
|
||||
|
||||
PatBlt(hDC, r.left, r.top, 1, r.bottom - r.top, PATCOPY);
|
||||
PatBlt(hDC, r.right - 1, r.top, 1, r.bottom - r.top, PATCOPY);
|
||||
PatBlt(hDC, r.left, r.top, r.right - r.left, 1, PATCOPY);
|
||||
PatBlt(hDC, r.left, r.bottom - 1, r.right - r.left, 1, PATCOPY);
|
||||
|
||||
|
||||
SelectObject(hDC, oldbrush);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1817,7 +1817,7 @@ INT STDCALL
|
|||
FillRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr)
|
||||
{
|
||||
HBRUSH prevhbr;
|
||||
|
||||
|
||||
if (hbr <= (HBRUSH)(COLOR_MENUBAR + 1))
|
||||
{
|
||||
hbr = GetSysColorBrush((int)hbr - 1);
|
||||
|
@ -1852,21 +1852,21 @@ DrawFocusRect(HDC hdc, CONST RECT *rect)
|
|||
static HBRUSH hFocusRectBrush = NULL;
|
||||
HGDIOBJ OldObj;
|
||||
UINT cx, cy;
|
||||
|
||||
|
||||
if(!hFocusRectBrush)
|
||||
{
|
||||
static HBITMAP hFocusPattern = NULL;
|
||||
const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA};
|
||||
|
||||
|
||||
hFocusPattern = CreateBitmap(8, 8, 1, 1, Pattern);
|
||||
hFocusRectBrush = CreatePatternBrush(hFocusPattern);
|
||||
}
|
||||
|
||||
|
||||
NtUserSystemParametersInfo(SPI_GETFOCUSBORDERWIDTH, 0, &cx, 0);
|
||||
NtUserSystemParametersInfo(SPI_GETFOCUSBORDERHEIGHT, 0, &cy, 0);
|
||||
|
||||
|
||||
OldObj = SelectObject(hdc, hFocusRectBrush);
|
||||
|
||||
|
||||
/* top */
|
||||
PatBlt(hdc, rect->left, rect->top, rect->right - rect->left, cy, PATINVERT);
|
||||
/* bottom */
|
||||
|
@ -1875,7 +1875,7 @@ DrawFocusRect(HDC hdc, CONST RECT *rect)
|
|||
PatBlt(hdc, rect->left, rect->top + cy, cx, rect->bottom - rect->top - (2 * cy), PATINVERT);
|
||||
/* right */
|
||||
PatBlt(hdc, rect->right - cx, rect->top + cy, cx, rect->bottom - rect->top - (2 * cy), PATINVERT);
|
||||
|
||||
|
||||
SelectObject(hdc, OldObj);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -52,8 +52,8 @@ ICON_CreateIconFromData(HDC hDC, PVOID ImageData, ICONIMAGE* IconImage, int cxDe
|
|||
DIB_RGB_COLORS);
|
||||
|
||||
/* Make ImageData point to the start of the AND image data. */
|
||||
ImageData = ((PBYTE)ImageData) + (((IconImage->icHeader.biWidth *
|
||||
IconImage->icHeader.biBitCount + 31) & ~31) >> 3) *
|
||||
ImageData = ((PBYTE)ImageData) + (((IconImage->icHeader.biWidth *
|
||||
IconImage->icHeader.biBitCount + 31) & ~31) >> 3) *
|
||||
(IconImage->icHeader.biHeight );
|
||||
|
||||
/* Create a BITMAPINFO header for the monocrome part of the icon. */
|
||||
|
@ -82,10 +82,10 @@ ICON_CreateIconFromData(HDC hDC, PVOID ImageData, ICONIMAGE* IconImage, int cxDe
|
|||
/* Load the AND bitmap. */
|
||||
IconInfo.hbmMask = CreateDIBitmap(hDC, &bwBIH->bmiHeader, 0,
|
||||
ImageData, bwBIH, DIB_RGB_COLORS);
|
||||
|
||||
|
||||
SetDIBits(hDC, IconInfo.hbmMask, 0, IconImage->icHeader.biHeight,
|
||||
ImageData, bwBIH, DIB_RGB_COLORS);
|
||||
|
||||
|
||||
/* Create the icon based on everything we have so far */
|
||||
return NtUserCreateCursorIconHandle(&IconInfo, FALSE);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ ICON_CreateCursorFromData(HDC hDC, PVOID ImageData, ICONIMAGE* IconImage, int cx
|
|||
IconInfo.fIcon = FALSE;
|
||||
IconInfo.xHotspot = xHotspot;
|
||||
IconInfo.yHotspot = yHotspot;
|
||||
|
||||
|
||||
/* Create a BITMAPINFO header for the monocrome part of the icon */
|
||||
bwBIH->bmiHeader.biBitCount = 1;
|
||||
bwBIH->bmiHeader.biWidth = IconImage->icHeader.biWidth;
|
||||
|
@ -131,12 +131,12 @@ ICON_CreateCursorFromData(HDC hDC, PVOID ImageData, ICONIMAGE* IconImage, int cx
|
|||
XORImageData, bwBIH, DIB_RGB_COLORS);
|
||||
if (IconInfo.hbmMask)
|
||||
{
|
||||
SetDIBits(hDC, IconInfo.hbmMask, 0, IconImage->icHeader.biHeight,
|
||||
SetDIBits(hDC, IconInfo.hbmMask, 0, IconImage->icHeader.biHeight,
|
||||
XORImageData, bwBIH, DIB_RGB_COLORS);
|
||||
}
|
||||
|
||||
|
||||
IconInfo.hbmColor = (HBITMAP)0;
|
||||
|
||||
|
||||
/* Create the icon based on everything we have so far */
|
||||
return NtUserCreateCursorIconHandle(&IconInfo, FALSE);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ CopyIcon(
|
|||
HICON hIcon)
|
||||
{
|
||||
ICONINFO IconInfo;
|
||||
|
||||
|
||||
if(NtUserGetCursorIconInfo((HANDLE)hIcon, &IconInfo))
|
||||
{
|
||||
return NtUserCreateCursorIconHandle(&IconInfo, FALSE);
|
||||
|
@ -190,7 +190,7 @@ CreateIcon(
|
|||
DeleteObject(IconInfo.hbmMask);
|
||||
return (HICON)0;
|
||||
}
|
||||
|
||||
|
||||
return NtUserCreateCursorIconHandle(&IconInfo, FALSE);
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ CreateIconFromResourceEx(
|
|||
HDC hScreenDc;
|
||||
WORD wXHotspot;
|
||||
WORD wYHotspot;
|
||||
|
||||
|
||||
/*
|
||||
FIXME - does win support LR_SHARED? According to msdn it does but we don't
|
||||
have useful information to identify the icon
|
||||
|
@ -261,11 +261,11 @@ CreateIconFromResourceEx(
|
|||
/* get an safe copy of the icon data */
|
||||
SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, cbIconBits);
|
||||
memcpy(SafeIconImage, pbIconBits, cbIconBits);
|
||||
|
||||
|
||||
/* take into acount the origonal height was for both the AND and XOR images */
|
||||
if(fIcon)
|
||||
SafeIconImage->icHeader.biHeight /= 2;
|
||||
|
||||
|
||||
if (SafeIconImage->icHeader.biSize == sizeof(BITMAPCOREHEADER))
|
||||
{
|
||||
BITMAPCOREHEADER* Core = (BITMAPCOREHEADER*)SafeIconImage;
|
||||
|
@ -274,7 +274,7 @@ CreateIconFromResourceEx(
|
|||
}
|
||||
else
|
||||
{
|
||||
ColourCount = (SafeIconImage->icHeader.biBitCount <= 8) ?
|
||||
ColourCount = (SafeIconImage->icHeader.biBitCount <= 8) ?
|
||||
(1 << SafeIconImage->icHeader.biBitCount) : 0;
|
||||
HeaderSize = sizeof(BITMAPINFOHEADER) + ColourCount * sizeof(RGBQUAD);
|
||||
}
|
||||
|
@ -326,7 +326,7 @@ CreateIconIndirect(PICONINFO IconInfo)
|
|||
{
|
||||
return (HICON)0;
|
||||
}
|
||||
|
||||
|
||||
/* FIXME - i doubt this is right (monochrome cursors */
|
||||
/*if(ColorBitmap.bmWidth != MaskBitmap.bmWidth ||
|
||||
ColorBitmap.bmHeight != MaskBitmap.bmWidth)
|
||||
|
@ -334,7 +334,7 @@ CreateIconIndirect(PICONINFO IconInfo)
|
|||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return (HICON)0;
|
||||
}*/
|
||||
|
||||
|
||||
return (HICON)NtUserCreateCursorIconHandle(IconInfo, TRUE);
|
||||
}
|
||||
|
||||
|
@ -381,8 +381,8 @@ DrawIconEx(
|
|||
HBRUSH hbrFlickerFreeDraw,
|
||||
UINT diFlags)
|
||||
{
|
||||
return (BOOL)NtUserDrawIconEx(hdc, xLeft, yTop, hIcon, cxWidth, cyWidth,
|
||||
istepIfAniCur, hbrFlickerFreeDraw, diFlags,
|
||||
return (BOOL)NtUserDrawIconEx(hdc, xLeft, yTop, hIcon, cxWidth, cyWidth,
|
||||
istepIfAniCur, hbrFlickerFreeDraw, diFlags,
|
||||
0, 0);
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ CURSORICON_FindBestCursor( GRPCURSORICONDIR *dir, int width, int height, int col
|
|||
DPRINT("Empty directory!\n");
|
||||
return NULL;
|
||||
}
|
||||
if (dir->idCount == 1)
|
||||
if (dir->idCount == 1)
|
||||
return &dir->idEntries[0]; /* No choice... */
|
||||
|
||||
/* Find Best Fit */
|
||||
|
|
|
@ -80,9 +80,9 @@ EnableWindow(HWND hWnd,
|
|||
LONG Style = NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE);
|
||||
Style = bEnable ? Style & ~WS_DISABLED : Style | WS_DISABLED;
|
||||
NtUserSetWindowLong(hWnd, GWL_STYLE, Style, FALSE);
|
||||
|
||||
|
||||
SendMessageA(hWnd, WM_ENABLE, (LPARAM) IsWindowEnabled(hWnd), 0);
|
||||
|
||||
|
||||
// Return nonzero if it was disabled, or zero if it wasn't:
|
||||
return IsWindowEnabled(hWnd);
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ GetKeyNameTextA(LONG lParam,
|
|||
LPSTR lpString,
|
||||
int nSize)
|
||||
{
|
||||
LPWSTR intermediateString =
|
||||
LPWSTR intermediateString =
|
||||
HeapAlloc(GetProcessHeap(),0,nSize * sizeof(WCHAR));
|
||||
int ret = 0;
|
||||
UINT wstrLen = 0;
|
||||
|
@ -149,9 +149,9 @@ GetKeyNameTextA(LONG lParam,
|
|||
if( !intermediateString ) return 0;
|
||||
ret = GetKeyNameTextW(lParam,intermediateString,nSize);
|
||||
if( ret == 0 ) { lpString[0] = 0; return 0; }
|
||||
|
||||
|
||||
wstrLen = wcslen( intermediateString );
|
||||
ret = WideCharToMultiByte(CP_ACP, 0,
|
||||
ret = WideCharToMultiByte(CP_ACP, 0,
|
||||
intermediateString, wstrLen,
|
||||
lpString, nSize, ".", &defChar );
|
||||
lpString[ret] = 0;
|
||||
|
@ -222,7 +222,7 @@ GetKeyboardLayoutNameW(LPWSTR pwszKLID)
|
|||
BOOL STDCALL
|
||||
GetKeyboardState(PBYTE lpKeyState)
|
||||
{
|
||||
|
||||
|
||||
return (BOOL) NtUserGetKeyboardState((LPBYTE) lpKeyState);
|
||||
}
|
||||
|
||||
|
@ -438,7 +438,7 @@ ToUnicode(UINT wVirtKey,
|
|||
int cchBuff,
|
||||
UINT wFlags)
|
||||
{
|
||||
return ToUnicodeEx( wVirtKey, wScanCode, lpKeyState, pwszBuff, cchBuff,
|
||||
return ToUnicodeEx( wVirtKey, wScanCode, lpKeyState, pwszBuff, cchBuff,
|
||||
wFlags, 0 );
|
||||
}
|
||||
|
||||
|
@ -582,14 +582,14 @@ keybd_event(
|
|||
|
||||
{
|
||||
INPUT Input;
|
||||
|
||||
|
||||
Input.type = INPUT_KEYBOARD;
|
||||
Input.ki.wVk = bVk;
|
||||
Input.ki.wScan = bScan;
|
||||
Input.ki.dwFlags = dwFlags;
|
||||
Input.ki.time = 0;
|
||||
Input.ki.dwExtraInfo = dwExtraInfo;
|
||||
|
||||
|
||||
NtUserSendInput(1, &Input, sizeof(INPUT));
|
||||
}
|
||||
|
||||
|
@ -607,7 +607,7 @@ mouse_event(
|
|||
ULONG_PTR dwExtraInfo)
|
||||
{
|
||||
INPUT Input;
|
||||
|
||||
|
||||
Input.type = INPUT_MOUSE;
|
||||
Input.mi.dx = dx;
|
||||
Input.mi.dy = dy;
|
||||
|
@ -615,7 +615,7 @@ mouse_event(
|
|||
Input.mi.dwFlags = dwFlags;
|
||||
Input.mi.time = 0;
|
||||
Input.mi.dwExtraInfo = dwExtraInfo;
|
||||
|
||||
|
||||
NtUserSendInput(1, &Input, sizeof(INPUT));
|
||||
}
|
||||
|
||||
|
|
|
@ -149,8 +149,8 @@ BOOL CALLBACK MDI_GetChildByID_EnumProc (HWND hwnd, LPARAM lParam )
|
|||
{
|
||||
DWORD *control = (DWORD *)lParam;
|
||||
if(*control == GetWindowLongW( hwnd, GWL_ID ))
|
||||
{
|
||||
*control = (DWORD)hwnd;
|
||||
{
|
||||
*control = (DWORD)hwnd;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -1285,7 +1285,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
|
|||
SetWindowLongPtrW( hwnd, 0, (LONG_PTR)ci );
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
|
||||
case WM_CREATE:
|
||||
{
|
||||
RECT rect;
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
(0 != ((MenuInfo)->Flags & MF_POPUP) && 0 != ((MenuInfo)->Flags & MF_SYSMENU))
|
||||
|
||||
#define IS_MAGIC_ITEM(Bmp) ((int) Bmp <12)
|
||||
|
||||
|
||||
#define MENU_BAR_ITEMS_SPACE (12)
|
||||
#define SEPARATOR_HEIGHT (5)
|
||||
#define MENU_TAB_SPACE (8)
|
||||
|
@ -126,8 +126,8 @@ const struct builtin_class_descr POPUPMENU_builtin_class =
|
|||
|
||||
/* INTERNAL FUNCTIONS ********************************************************/
|
||||
|
||||
/* Rip the fun and easy to use and fun WINE unicode string manipulation routines.
|
||||
* Of course I didnt copy the ASM code because we want this to be portable
|
||||
/* Rip the fun and easy to use and fun WINE unicode string manipulation routines.
|
||||
* Of course I didnt copy the ASM code because we want this to be portable
|
||||
* and it needs to go away.
|
||||
*/
|
||||
|
||||
|
@ -164,7 +164,7 @@ MenuGetRosMenuInfo(PROSMENUINFO MenuInfo, HMENU Menu)
|
|||
{
|
||||
MenuInfo->cbSize = sizeof(ROSMENUINFO);
|
||||
MenuInfo->fMask = MIM_BACKGROUND | MIM_HELPID | MIM_MAXHEIGHT | MIM_MENUDATA | MIM_STYLE;
|
||||
|
||||
|
||||
return NtUserMenuInfo(Menu, MenuInfo, FALSE);
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ MenuSetRosMenuInfo(PROSMENUINFO MenuInfo)
|
|||
{
|
||||
MenuInfo->cbSize = sizeof(ROSMENUINFO);
|
||||
MenuInfo->fMask = MIM_BACKGROUND | MIM_HELPID | MIM_MAXHEIGHT | MIM_MENUDATA | MIM_STYLE;
|
||||
|
||||
|
||||
return NtUserMenuInfo(MenuInfo->Self, MenuInfo, TRUE);
|
||||
}
|
||||
|
||||
|
@ -255,7 +255,7 @@ MenuSetRosMenuItemInfo(HMENU Menu, UINT Index, PROSMENUITEMINFO ItemInfo)
|
|||
ItemInfo->fMask = MIIM_BITMAP | MIIM_CHECKMARKS | MIIM_DATA | MIIM_FTYPE
|
||||
| MIIM_ID | MIIM_STATE | MIIM_STRING | MIIM_SUBMENU | MIIM_TYPE;
|
||||
|
||||
|
||||
|
||||
Ret = NtUserMenuItemInfo(Menu, Index, TRUE, ItemInfo, TRUE);
|
||||
|
||||
return Ret;
|
||||
|
@ -1063,7 +1063,7 @@ BOOL
|
|||
MenuInit(VOID)
|
||||
{
|
||||
NONCLIENTMETRICSW ncm;
|
||||
|
||||
|
||||
/* get the menu font */
|
||||
if(!hMenuFont || !hMenuFontBold)
|
||||
{
|
||||
|
@ -1073,14 +1073,14 @@ MenuInit(VOID)
|
|||
DbgPrint("MenuInit(): SystemParametersInfoW(SPI_GETNONCLIENTMETRICS) failed!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
hMenuFont = CreateFontIndirectW(&ncm.lfMenuFont);
|
||||
if(hMenuFont == NULL)
|
||||
{
|
||||
DbgPrint("MenuInit(): CreateFontIndirectW(hMenuFont) failed!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
ncm.lfMenuFont.lfWeight = max(ncm.lfMenuFont.lfWeight + 300, 1000);
|
||||
hMenuFontBold = CreateFontIndirectW(&ncm.lfMenuFont);
|
||||
if(hMenuFontBold == NULL)
|
||||
|
@ -1905,8 +1905,8 @@ MenuMoveSelection(HWND WndOwner, PROSMENUINFO MenuInfo, INT Offset)
|
|||
i = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
i = MenuInfo->FocusedItem;
|
||||
{
|
||||
i = MenuInfo->FocusedItem;
|
||||
}
|
||||
|
||||
do
|
||||
|
@ -1968,7 +1968,7 @@ MenuInitSysMenuPopup(HMENU Menu, DWORD Style, DWORD ClsStyle, LONG HitTest )
|
|||
{
|
||||
EnableMenuItem(Menu, SC_CLOSE, MF_GRAYED);
|
||||
}
|
||||
|
||||
|
||||
/* Set default menu item */
|
||||
if(Style & WS_MINIMIZE)
|
||||
{
|
||||
|
@ -1988,7 +1988,7 @@ MenuInitSysMenuPopup(HMENU Menu, DWORD Style, DWORD ClsStyle, LONG HitTest )
|
|||
#if 0
|
||||
mii.cbSize = sizeof(MENUITEMINFOW);
|
||||
mii.fMask = MIIM_STATE;
|
||||
if((DefItem != SC_CLOSE) && GetMenuItemInfoW(Menu, DefItem, FALSE, &mii) &&
|
||||
if((DefItem != SC_CLOSE) && GetMenuItemInfoW(Menu, DefItem, FALSE, &mii) &&
|
||||
(mii.fState & (MFS_GRAYED | MFS_DISABLED)))
|
||||
{
|
||||
DefItem = SC_CLOSE;
|
||||
|
@ -3353,7 +3353,7 @@ MenuTrackMenu(HMENU Menu, UINT Flags, INT x, INT y,
|
|||
Mt.TrackFlags &= ~TF_SKIPREMOVE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NtUserSetGUIThreadHandle(MSQ_STATE_MENUOWNER, NULL);
|
||||
SetCapture(NULL); /* release the capture */
|
||||
|
||||
|
@ -3453,7 +3453,7 @@ AppendMenuA(HMENU hMenu,
|
|||
UINT_PTR uIDNewItem,
|
||||
LPCSTR lpNewItem)
|
||||
{
|
||||
return(InsertMenuA(hMenu, -1, uFlags | MF_BYPOSITION, uIDNewItem,
|
||||
return(InsertMenuA(hMenu, -1, uFlags | MF_BYPOSITION, uIDNewItem,
|
||||
lpNewItem));
|
||||
}
|
||||
|
||||
|
@ -3467,7 +3467,7 @@ AppendMenuW(HMENU hMenu,
|
|||
UINT_PTR uIDNewItem,
|
||||
LPCWSTR lpNewItem)
|
||||
{
|
||||
return(InsertMenuW(hMenu, -1, uFlags | MF_BYPOSITION, uIDNewItem,
|
||||
return(InsertMenuW(hMenu, -1, uFlags | MF_BYPOSITION, uIDNewItem,
|
||||
lpNewItem));
|
||||
}
|
||||
|
||||
|
@ -3611,7 +3611,7 @@ GetMenuBarInfo(HWND hwnd,
|
|||
LONG STDCALL
|
||||
GetMenuCheckMarkDimensions(VOID)
|
||||
{
|
||||
return(MAKELONG(GetSystemMetrics(SM_CXMENUCHECK),
|
||||
return(MAKELONG(GetSystemMetrics(SM_CXMENUCHECK),
|
||||
GetSystemMetrics(SM_CYMENUCHECK)));
|
||||
}
|
||||
|
||||
|
@ -3637,16 +3637,16 @@ GetMenuInfo(HMENU hmenu,
|
|||
{
|
||||
ROSMENUINFO mi;
|
||||
BOOL res = FALSE;
|
||||
|
||||
|
||||
if(!lpcmi || (lpcmi->cbSize != sizeof(MENUINFO)))
|
||||
return FALSE;
|
||||
|
||||
|
||||
RtlZeroMemory(&mi, sizeof(MENUINFO));
|
||||
mi.cbSize = sizeof(MENUINFO);
|
||||
mi.fMask = lpcmi->fMask;
|
||||
|
||||
|
||||
res = NtUserMenuInfo(hmenu, &mi, FALSE);
|
||||
|
||||
|
||||
memcpy(lpcmi, &mi, sizeof(MENUINFO));
|
||||
return res;
|
||||
}
|
||||
|
@ -3672,15 +3672,15 @@ GetMenuItemID(HMENU hMenu,
|
|||
int nPos)
|
||||
{
|
||||
ROSMENUITEMINFO mii;
|
||||
|
||||
|
||||
mii.cbSize = sizeof(MENUITEMINFOW);
|
||||
mii.fMask = MIIM_ID | MIIM_SUBMENU;
|
||||
|
||||
|
||||
if (! NtUserMenuItemInfo(hMenu, nPos, MF_BYPOSITION, &mii, FALSE))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (NULL != mii.hSubMenu)
|
||||
{
|
||||
return -1;
|
||||
|
@ -3689,7 +3689,7 @@ GetMenuItemID(HMENU hMenu,
|
|||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return mii.wID;
|
||||
}
|
||||
|
||||
|
@ -3730,7 +3730,7 @@ GetMenuItemInfoA(
|
|||
if (miiW.dwTypeData == NULL)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (!NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO)&miiW, FALSE))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, miiW.dwTypeData);
|
||||
|
@ -3798,7 +3798,7 @@ GetMenuState(
|
|||
mii.cbSize = sizeof(MENUITEMINFOW);
|
||||
mii.fMask = MIIM_STATE | MIIM_TYPE | MIIM_SUBMENU;
|
||||
mii.dwTypeData = NULL;
|
||||
|
||||
|
||||
SetLastError(0);
|
||||
if(NtUserMenuItemInfo(hMenu, uId, uFlags, &mii, FALSE))
|
||||
{
|
||||
|
@ -3810,18 +3810,18 @@ GetMenuState(
|
|||
return (UINT) -1;
|
||||
}
|
||||
nSubItems = MenuInfo.MenuItemCount;
|
||||
|
||||
|
||||
/* FIXME - ported from wine, does that work (0xff)? */
|
||||
if(GetLastError() != ERROR_INVALID_MENU_HANDLE)
|
||||
return (nSubItems << 8) | ((mii.fState | mii.fType) & 0xff);
|
||||
|
||||
return (UINT)-1; /* Invalid submenu */
|
||||
}
|
||||
|
||||
|
||||
/* FIXME - ported from wine, does that work? */
|
||||
return (mii.fType | mii.fState);
|
||||
}
|
||||
|
||||
|
||||
return (UINT)-1;
|
||||
}
|
||||
|
||||
|
@ -3931,7 +3931,7 @@ InsertMenuA(
|
|||
mii.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_STATE;
|
||||
mii.fType = 0;
|
||||
mii.fState = MFS_ENABLED;
|
||||
|
||||
|
||||
if(uFlags & MF_BITMAP)
|
||||
{
|
||||
mii.fType |= MFT_BITMAP;
|
||||
|
@ -3950,7 +3950,7 @@ InsertMenuA(
|
|||
mii.dwTypeData = (LPSTR)lpNewItem;
|
||||
mii.cch = (NULL == lpNewItem ? 0 : strlen(lpNewItem));
|
||||
}
|
||||
|
||||
|
||||
if(uFlags & MF_RIGHTJUSTIFY)
|
||||
{
|
||||
mii.fType |= MFT_RIGHTJUSTIFY;
|
||||
|
@ -3971,7 +3971,7 @@ InsertMenuA(
|
|||
{
|
||||
mii.fState |= MFS_GRAYED;
|
||||
}
|
||||
|
||||
|
||||
if(uFlags & MF_POPUP)
|
||||
{
|
||||
mii.fType |= MF_POPUP;
|
||||
|
@ -4004,13 +4004,13 @@ InsertMenuItemA(
|
|||
BOOL CleanHeap = FALSE;
|
||||
NTSTATUS Status;
|
||||
|
||||
if((lpmii->cbSize == sizeof(MENUITEMINFOA)) ||
|
||||
if((lpmii->cbSize == sizeof(MENUITEMINFOA)) ||
|
||||
(lpmii->cbSize == sizeof(MENUITEMINFOA) - sizeof(HBITMAP)))
|
||||
{
|
||||
RtlMoveMemory ( &mi, lpmii, lpmii->cbSize );
|
||||
|
||||
/* copy the text string */
|
||||
if((mi.fMask & (MIIM_TYPE | MIIM_STRING)) &&
|
||||
if((mi.fMask & (MIIM_TYPE | MIIM_STRING)) &&
|
||||
(MENU_ITEM_TYPE(mi.fType) == MF_STRING) && mi.dwTypeData)
|
||||
{
|
||||
Status = RtlCreateUnicodeStringFromAsciiz(&MenuText, (LPSTR)mi.dwTypeData);
|
||||
|
@ -4052,13 +4052,13 @@ InsertMenuItemW(
|
|||
if a bad user passes bad data, we crash his process instead of the
|
||||
entire kernel */
|
||||
|
||||
if((lpmii->cbSize == sizeof(MENUITEMINFOW)) ||
|
||||
if((lpmii->cbSize == sizeof(MENUITEMINFOW)) ||
|
||||
(lpmii->cbSize == sizeof(MENUITEMINFOW) - sizeof(HBITMAP)))
|
||||
{
|
||||
memcpy(&mi, lpmii, lpmii->cbSize);
|
||||
|
||||
|
||||
/* copy the text string */
|
||||
if((mi.fMask & (MIIM_TYPE | MIIM_STRING)) &&
|
||||
if((mi.fMask & (MIIM_TYPE | MIIM_STRING)) &&
|
||||
(MENU_ITEM_TYPE(mi.fType) == MF_STRING) &&
|
||||
mi.dwTypeData != NULL)
|
||||
{
|
||||
|
@ -4066,7 +4066,7 @@ InsertMenuItemW(
|
|||
mi.dwTypeData = MenuText.Buffer;
|
||||
mi.cch = MenuText.Length / sizeof(WCHAR);
|
||||
};
|
||||
|
||||
|
||||
res = NtUserInsertMenuItem(hMenu, uItem, fByPosition, &mi);
|
||||
}
|
||||
return res;
|
||||
|
@ -4109,7 +4109,7 @@ InsertMenuW(
|
|||
mii.dwTypeData = (LPWSTR)lpNewItem;
|
||||
mii.cch = (NULL == lpNewItem ? 0 : wcslen(lpNewItem));
|
||||
}
|
||||
|
||||
|
||||
if(uFlags & MF_RIGHTJUSTIFY)
|
||||
{
|
||||
mii.fType |= MFT_RIGHTJUSTIFY;
|
||||
|
@ -4130,7 +4130,7 @@ InsertMenuW(
|
|||
{
|
||||
mii.fState |= MFS_GRAYED;
|
||||
}
|
||||
|
||||
|
||||
if(uFlags & MF_POPUP)
|
||||
{
|
||||
mii.fType |= MF_POPUP;
|
||||
|
@ -4344,7 +4344,7 @@ SetMenuInfo(
|
|||
BOOL res = FALSE;
|
||||
if(lpcmi->cbSize != sizeof(MENUINFO))
|
||||
return res;
|
||||
|
||||
|
||||
memcpy(&mi, lpcmi, sizeof(MENUINFO));
|
||||
return NtUserMenuInfo(hmenu, &mi, TRUE);
|
||||
}
|
||||
|
@ -4436,7 +4436,7 @@ SetMenuItemInfoW(
|
|||
BOOL
|
||||
STDCALL
|
||||
SetSystemMenu (
|
||||
HWND hwnd,
|
||||
HWND hwnd,
|
||||
HMENU hMenu)
|
||||
{
|
||||
if(!hwnd)
|
||||
|
@ -4528,7 +4528,7 @@ GetMenuContextHelpId(HMENU hmenu)
|
|||
ROSMENUINFO mi;
|
||||
mi.cbSize = sizeof(ROSMENUINFO);
|
||||
mi.fMask = MIM_HELPID;
|
||||
|
||||
|
||||
if(NtUserMenuInfo(hmenu, &mi, FALSE))
|
||||
{
|
||||
return mi.dwContextHelpID;
|
||||
|
@ -4590,7 +4590,7 @@ ChangeMenuW(
|
|||
{
|
||||
case MF_APPEND :
|
||||
return AppendMenuW(hMenu, flags &~ MF_APPEND, cmdInsert, lpszNewItem);
|
||||
|
||||
|
||||
case MF_DELETE :
|
||||
return DeleteMenu(hMenu, cmd, flags &~ MF_DELETE);
|
||||
|
||||
|
@ -4628,7 +4628,7 @@ ChangeMenuA(
|
|||
{
|
||||
case MF_APPEND :
|
||||
return AppendMenuA(hMenu, flags &~ MF_APPEND, cmdInsert, lpszNewItem);
|
||||
|
||||
|
||||
case MF_DELETE :
|
||||
return DeleteMenu(hMenu, cmd, flags &~ MF_DELETE);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <message.h>
|
||||
|
||||
/* DDE message exchange
|
||||
*
|
||||
*
|
||||
* - Session initialization
|
||||
* Client sends a WM_DDE_INITIATE message, usually a broadcast message. lParam of
|
||||
* this message contains a pair of global atoms, the Application and Topic atoms.
|
||||
|
@ -91,7 +91,7 @@ DdeAddPair(HGLOBAL ClientMem, HGLOBAL ServerMem)
|
|||
}
|
||||
else
|
||||
{
|
||||
New = HeapAlloc(GetProcessHeap(), 0,
|
||||
New = HeapAlloc(GetProcessHeap(), 0,
|
||||
(DdeNumAlloc + GROWBY) * sizeof(DDEPAIR));
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ MsgiUMToKMMessage(PMSG UMMsg, PMSG KMMsg, BOOL Posted)
|
|||
SIZE_T Size;
|
||||
PKMDDEEXECUTEDATA KMDdeExecuteData;
|
||||
PVOID Data;
|
||||
|
||||
|
||||
Size = GlobalSize((HGLOBAL) UMMsg->lParam);
|
||||
Data = GlobalLock((HGLOBAL) UMMsg->lParam);
|
||||
if (NULL == Data)
|
||||
|
@ -235,7 +235,7 @@ MsgiUMToKMMessage(PMSG UMMsg, PMSG KMMsg, BOOL Posted)
|
|||
pKMCopyData->cbData = pUMCopyData->cbData;
|
||||
pKMCopyData->lpData = pKMCopyData + 1;
|
||||
|
||||
RtlCopyMemory(pKMCopyData + 1, pUMCopyData->lpData,
|
||||
RtlCopyMemory(pKMCopyData + 1, pUMCopyData->lpData,
|
||||
pUMCopyData->cbData);
|
||||
|
||||
KMMsg->lParam = (LPARAM)pKMCopyData;
|
||||
|
@ -759,7 +759,7 @@ MsgConversionAdd(PMSGCONVERSION Conversion)
|
|||
}
|
||||
else
|
||||
{
|
||||
New = HeapAlloc(GetProcessHeap(), 0,
|
||||
New = HeapAlloc(GetProcessHeap(), 0,
|
||||
(MsgConversionNumAlloc + GROWBY) * sizeof(MSGCONVERSION));
|
||||
}
|
||||
|
||||
|
@ -1631,7 +1631,7 @@ SendMessageTimeoutW(
|
|||
LRESULT Result;
|
||||
|
||||
Info.Ansi = FALSE;
|
||||
Result = NtUserSendMessageTimeout(hWnd, Msg, wParam, lParam, fuFlags, uTimeout,
|
||||
Result = NtUserSendMessageTimeout(hWnd, Msg, wParam, lParam, fuFlags, uTimeout,
|
||||
lpdwResult, &Info);
|
||||
if (! Info.HandledByKernel)
|
||||
{
|
||||
|
@ -1779,7 +1779,7 @@ STDCALL
|
|||
RealGetQueueStatus(UINT flags)
|
||||
{
|
||||
DWORD ret;
|
||||
WORD changed_bits, wake_bits;
|
||||
WORD changed_bits, wake_bits;
|
||||
|
||||
#if 0 /* wine stuff. don't know what it does... */
|
||||
|
||||
|
@ -1805,7 +1805,7 @@ BOOL STDCALL GetInputState(VOID)
|
|||
DWORD ret;
|
||||
WORD wake_bits;
|
||||
|
||||
#if 0 /* wine stuff. don't know what it does... */
|
||||
#if 0 /* wine stuff. don't know what it does... */
|
||||
|
||||
/* check for pending X events */
|
||||
if (USER_Driver.pMsgWaitForMultipleObjectsEx)
|
||||
|
@ -1813,7 +1813,7 @@ BOOL STDCALL GetInputState(VOID)
|
|||
#endif
|
||||
|
||||
ret = NtUserGetQueueStatus(FALSE /*ClearChanges*/);
|
||||
|
||||
|
||||
wake_bits = HIWORD(ret);
|
||||
|
||||
return wake_bits & (QS_KEY | QS_MOUSEBUTTON);
|
||||
|
@ -1922,7 +1922,7 @@ BOOL WINAPI IsInsideMessagePumpHook()
|
|||
{
|
||||
if(!gfMessagePumpHook)
|
||||
return FALSE;
|
||||
|
||||
|
||||
/* This code checks if we're inside SendMessage. */
|
||||
#if 0
|
||||
/* Since our TEB doesnt match that of real windows, testing this value is useless until we know what it does
|
||||
|
|
|
@ -103,7 +103,7 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
PMSGBOXINFO mbi;
|
||||
HELPINFO hi;
|
||||
HWND owner;
|
||||
|
||||
|
||||
switch(message) {
|
||||
case WM_INITDIALOG:
|
||||
mbi = (PMSGBOXINFO)lParam;
|
||||
|
@ -113,7 +113,7 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
if(mbi->Icon)
|
||||
SendDlgItemMessageW(hwnd, MSGBOX_IDICON, STM_SETICON, (WPARAM)mbi->Icon, 0);
|
||||
SetWindowContextHelpId(hwnd, mbi->ContextHelpId);
|
||||
|
||||
|
||||
/* set control fonts */
|
||||
SendDlgItemMessageW(hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)mbi->Font, 0);
|
||||
for(i = 0; i < mbi->nButtons; i++)
|
||||
|
@ -132,7 +132,7 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
SetTimer(hwnd, 0, mbi->Timeout, NULL);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
|
@ -159,7 +159,7 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
return 0;
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
case WM_HELP:
|
||||
mbi = (PMSGBOXINFO)GetPropW(hwnd, L"ROS_MSGBOX");
|
||||
if(!mbi)
|
||||
|
@ -176,7 +176,7 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
SendMessageW(GetWindow(hwnd, GW_OWNER), WM_HELP, 0, (LPARAM)&hi);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
case WM_CLOSE:
|
||||
mbi = (PMSGBOXINFO)GetPropW(hwnd, L"ROS_MSGBOX");
|
||||
if(!mbi)
|
||||
|
@ -189,7 +189,7 @@ static INT_PTR CALLBACK MessageBoxProc( HWND hwnd, UINT message,
|
|||
}
|
||||
EndDialog(hwnd, IDCANCEL);
|
||||
return 1;
|
||||
|
||||
|
||||
case WM_TIMER:
|
||||
if(wParam == 0)
|
||||
{
|
||||
|
@ -224,9 +224,9 @@ MessageBoxTimeoutIndirectW(
|
|||
MSGBOXINFO mbi;
|
||||
BOOL defbtn = FALSE;
|
||||
DWORD units = GetDialogBaseUnits();
|
||||
|
||||
|
||||
hUser32 = GetModuleHandleW(L"USER32");
|
||||
|
||||
|
||||
if(!lpMsgBoxParams->lpszCaption || !HIWORD((LPWSTR)lpMsgBoxParams->lpszCaption))
|
||||
{
|
||||
LoadStringW(hUser32, IDS_ERROR, &capbuf[0], 32);
|
||||
|
@ -234,15 +234,15 @@ MessageBoxTimeoutIndirectW(
|
|||
}
|
||||
else
|
||||
caption = (LPWSTR)lpMsgBoxParams->lpszCaption;
|
||||
|
||||
|
||||
if(!lpMsgBoxParams->lpszText || !HIWORD(lpMsgBoxParams->lpszText))
|
||||
text = L"";
|
||||
else
|
||||
text = lpMsgBoxParams->lpszText;
|
||||
|
||||
|
||||
caplen = strlenW(caption);
|
||||
textlen = strlenW(text);
|
||||
|
||||
|
||||
/* Create selected buttons */
|
||||
switch(lpMsgBoxParams->dwStyle & MB_TYPEMASK)
|
||||
{
|
||||
|
@ -289,7 +289,7 @@ MessageBoxTimeoutIndirectW(
|
|||
/* Create Help button */
|
||||
if(lpMsgBoxParams->dwStyle & MB_HELP)
|
||||
Buttons[nButtons++] = IDHELP;
|
||||
|
||||
|
||||
switch(lpMsgBoxParams->dwStyle & MB_ICONMASK)
|
||||
{
|
||||
case MB_ICONEXCLAMATION:
|
||||
|
@ -322,7 +322,7 @@ MessageBoxTimeoutIndirectW(
|
|||
}
|
||||
|
||||
/* Basic space */
|
||||
bufsize = sizeof(DLGTEMPLATE) +
|
||||
bufsize = sizeof(DLGTEMPLATE) +
|
||||
2 * sizeof(WORD) + /* menu and class */
|
||||
(caplen + 1) * sizeof(WCHAR); /* title */
|
||||
|
||||
|
@ -341,7 +341,7 @@ MessageBoxTimeoutIndirectW(
|
|||
3 * sizeof(WORD) +
|
||||
(textlen + 1) * sizeof(WCHAR);
|
||||
|
||||
|
||||
|
||||
for(i = 0; i < nButtons; i++)
|
||||
{
|
||||
switch(Buttons[i])
|
||||
|
@ -387,22 +387,22 @@ MessageBoxTimeoutIndirectW(
|
|||
3 * sizeof(WORD) +
|
||||
(wcslen(ButtonText[i]) + 1) * sizeof(WCHAR);
|
||||
}
|
||||
|
||||
|
||||
buf = RtlAllocateHeap(GetProcessHeap(), 0, bufsize);
|
||||
if(!buf)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
iico = itxt = NULL;
|
||||
|
||||
|
||||
hDC = CreateCompatibleDC(0);
|
||||
|
||||
|
||||
nclm.cbSize = sizeof(nclm);
|
||||
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, sizeof(nclm), &nclm, 0);
|
||||
hFont = CreateFontIndirectW (&nclm.lfMessageFont);
|
||||
|
||||
|
||||
tpl = (DLGTEMPLATE *)buf;
|
||||
|
||||
|
||||
tpl->style = WS_CAPTION | WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_SYSMENU | DS_CENTER | DS_MODALFRAME | DS_NOIDLEMSG;
|
||||
tpl->dwExtendedStyle = WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE | WS_EX_CONTROLPARENT;
|
||||
if(lpMsgBoxParams->dwStyle & MB_TOPMOST)
|
||||
|
@ -412,9 +412,9 @@ MessageBoxTimeoutIndirectW(
|
|||
tpl->x = 100;
|
||||
tpl->y = 100;
|
||||
tpl->cdit = nButtons + ((Icon != (HICON)0) ? 1 : 0) + 1;
|
||||
|
||||
|
||||
dest = (BYTE *)(tpl + 1);
|
||||
|
||||
|
||||
*(WORD*)dest = 0; /* no menu */
|
||||
*(((WORD*)dest) + 1) = 0; /* use default window class */
|
||||
dest += 2 * sizeof(WORD);
|
||||
|
@ -422,7 +422,7 @@ MessageBoxTimeoutIndirectW(
|
|||
dest += caplen * sizeof(WCHAR);
|
||||
*(WCHAR*)dest = L'\0';
|
||||
dest += sizeof(WCHAR);
|
||||
|
||||
|
||||
/* Create icon */
|
||||
if(Icon)
|
||||
{
|
||||
|
@ -431,7 +431,7 @@ MessageBoxTimeoutIndirectW(
|
|||
iico->style = WS_CHILD | WS_VISIBLE | SS_ICON;
|
||||
iico->dwExtendedStyle = 0;
|
||||
iico->id = MSGBOX_IDICON;
|
||||
|
||||
|
||||
dest += sizeof(DLGITEMTEMPLATE);
|
||||
*(WORD*)dest = 0xFFFF;
|
||||
dest += sizeof(WORD);
|
||||
|
@ -444,7 +444,7 @@ MessageBoxTimeoutIndirectW(
|
|||
*(WORD*)dest = 0;
|
||||
dest += sizeof(WORD);
|
||||
}
|
||||
|
||||
|
||||
/* create static for text */
|
||||
dest = (BYTE*)(((DWORD)dest + 3) & ~3);
|
||||
itxt = (DLGITEMTEMPLATE *)dest;
|
||||
|
@ -466,7 +466,7 @@ MessageBoxTimeoutIndirectW(
|
|||
dest += sizeof(WCHAR);
|
||||
*(WORD*)dest = 0;
|
||||
dest += sizeof(WORD);
|
||||
|
||||
|
||||
/* create buttons */
|
||||
btnsize.cx = BTN_CX;
|
||||
btnsize.cy = BTN_CY;
|
||||
|
@ -503,7 +503,7 @@ MessageBoxTimeoutIndirectW(
|
|||
btnsize.cx = max(btnsize.cx, btnrect.right);
|
||||
btnsize.cy = max(btnsize.cy, btnrect.bottom);
|
||||
}
|
||||
|
||||
|
||||
/* make first button the default button if no other is */
|
||||
if(!defbtn)
|
||||
{
|
||||
|
@ -511,7 +511,7 @@ MessageBoxTimeoutIndirectW(
|
|||
ibtn[0]->style |= BS_DEFPUSHBUTTON;
|
||||
mbi.DefBtn = Buttons[0];
|
||||
}
|
||||
|
||||
|
||||
/* calculate position and size of controls */
|
||||
txtrect.right = GetSystemMetrics(SM_CXSCREEN) / 5 * 4;
|
||||
if(Icon)
|
||||
|
@ -520,11 +520,11 @@ MessageBoxTimeoutIndirectW(
|
|||
SelectObject(hDC, hFont);
|
||||
DrawTextW(hDC, text, textlen, &txtrect, DT_LEFT | DT_NOPREFIX | DT_WORDBREAK | DT_CALCRECT);
|
||||
txtrect.right++;
|
||||
|
||||
|
||||
/* calculate position and size of the icon */
|
||||
rc.left = rc.bottom = rc.right = 0;
|
||||
btntop = 0;
|
||||
|
||||
|
||||
if(iico)
|
||||
{
|
||||
rc.right = GetSystemMetrics(SM_CXICON);
|
||||
|
@ -591,7 +591,7 @@ MessageBoxTimeoutIndirectW(
|
|||
btnleft += btnsize.cx + MSGBOXEX_BUTTONSPACING;
|
||||
}
|
||||
/* calculate size and position of the messagebox window */
|
||||
btnleft = max(btnleft - MSGBOXEX_BUTTONSPACING, rc.left + txtrect.right);
|
||||
btnleft = max(btnleft - MSGBOXEX_BUTTONSPACING, rc.left + txtrect.right);
|
||||
btnleft += MSGBOXEX_MARGIN;
|
||||
btntop += btnsize.cy + MSGBOXEX_MARGIN;
|
||||
/* set size and position of the message static */
|
||||
|
@ -602,7 +602,7 @@ MessageBoxTimeoutIndirectW(
|
|||
/* set size of the window */
|
||||
tpl->cx = (btnleft * 4) / LOWORD(units);
|
||||
tpl->cy = (btntop * 8) / HIWORD(units);
|
||||
|
||||
|
||||
/* finally show the messagebox */
|
||||
mbi.Icon = Icon;
|
||||
mbi.Font = hFont;
|
||||
|
@ -612,16 +612,16 @@ MessageBoxTimeoutIndirectW(
|
|||
mbi.nButtons = nButtons;
|
||||
mbi.Btns = &Buttons[0];
|
||||
mbi.Timeout = Timeout;
|
||||
|
||||
|
||||
if(hDC)
|
||||
DeleteDC(hDC);
|
||||
|
||||
|
||||
ret = DialogBoxIndirectParamW(lpMsgBoxParams->hInstance, tpl, lpMsgBoxParams->hwndOwner,
|
||||
MessageBoxProc, (LPARAM)&mbi);
|
||||
|
||||
if(hFont)
|
||||
DeleteObject(hFont);
|
||||
|
||||
|
||||
RtlFreeHeap(GetProcessHeap(), 0, buf);
|
||||
return ret;
|
||||
}
|
||||
|
@ -914,7 +914,7 @@ MessageBeep(UINT uType)
|
|||
if(waveOutGetNumDevs() == 0)
|
||||
return Beep(500, 100); // Beep through speaker
|
||||
/* fall through */
|
||||
case MB_OK:
|
||||
case MB_OK:
|
||||
EventName = L"SystemDefault";
|
||||
break;
|
||||
case MB_ICONASTERISK:
|
||||
|
|
|
@ -94,7 +94,7 @@ IntIsScrollBarVisible(HWND hWnd, INT hBar)
|
|||
sbi.cbSize = sizeof(SCROLLBARINFO);
|
||||
if(!NtUserGetScrollBarInfo(hWnd, hBar, &sbi))
|
||||
return FALSE;
|
||||
|
||||
|
||||
return !(sbi.rgstate[0] & STATE_SYSTEM_OFFSCREEN);
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ UserHasWindowEdge(DWORD Style, DWORD ExStyle)
|
|||
return TRUE;
|
||||
Style &= WS_CAPTION;
|
||||
if (Style == WS_DLGFRAME || Style == WS_CAPTION)
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ UserHasMenu(HWND hWnd, ULONG Style)
|
|||
return (!(Style & WS_CHILD) && GetMenu(hWnd) != 0);
|
||||
}
|
||||
|
||||
HICON
|
||||
HICON
|
||||
UserGetWindowIcon(HWND hwnd)
|
||||
{
|
||||
HICON hIcon = 0;
|
||||
|
@ -170,7 +170,7 @@ BOOL
|
|||
UserDrawSysMenuButton(HWND hWnd, HDC hDC, LPRECT Rect, BOOL Down)
|
||||
{
|
||||
HICON WindowIcon;
|
||||
|
||||
|
||||
if ((WindowIcon = UserGetWindowIcon(hWnd)))
|
||||
{
|
||||
return DrawIconEx(hDC, Rect->left + 2, Rect->top + 2, WindowIcon,
|
||||
|
@ -216,7 +216,7 @@ UserDrawCaptionButton(LPRECT Rect, DWORD Style, DWORD ExStyle, HDC hDC, BOOL bDo
|
|||
TempRect.right -= 1;
|
||||
|
||||
DrawFrameControl(hDC, &TempRect, DFC_CAPTION,
|
||||
((Style & WS_MINIMIZE) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMIN) |
|
||||
((Style & WS_MINIMIZE) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMIN) |
|
||||
(bDown ? DFCS_PUSHED : 0) |
|
||||
((Style & WS_MINIMIZEBOX) ? 0 : DFCS_INACTIVE));
|
||||
break;
|
||||
|
@ -246,7 +246,7 @@ UserDrawCaptionButton(LPRECT Rect, DWORD Style, DWORD ExStyle, HDC hDC, BOOL bDo
|
|||
if (ExStyle & WS_EX_TOOLWINDOW)
|
||||
{
|
||||
TempRect.left = TempRect.right - GetSystemMetrics(SM_CXSMSIZE);
|
||||
TempRect.bottom = TempRect.top + GetSystemMetrics(SM_CYSMSIZE) - 2;
|
||||
TempRect.bottom = TempRect.top + GetSystemMetrics(SM_CYSMSIZE) - 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -305,7 +305,7 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Parent = GetParent(hWnd);
|
||||
ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
||||
if (Active == -1)
|
||||
|
@ -341,7 +341,7 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active)
|
|||
SelectObject(hDC, GetSysColorBrush(COLOR_BTNSHADOW));
|
||||
PatBlt(hDC, CurrentRect.left, CurrentRect.top, CurrentRect.right - CurrentRect.left, 1, PATCOPY);
|
||||
PatBlt(hDC, CurrentRect.left, CurrentRect.top, 1, CurrentRect.bottom - CurrentRect.top, PATCOPY);
|
||||
|
||||
|
||||
SelectObject(hDC, GetSysColorBrush(COLOR_BTNHIGHLIGHT));
|
||||
PatBlt(hDC, CurrentRect.left, CurrentRect.bottom - 1, CurrentRect.right - CurrentRect.left, 1, PATCOPY);
|
||||
PatBlt(hDC, CurrentRect.right - 1, CurrentRect.top, 1, CurrentRect.bottom - CurrentRect.top, PATCOPY);
|
||||
|
@ -349,7 +349,7 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active)
|
|||
InflateRect(&CurrentRect, -1, -1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Firstly the "thick" frame */
|
||||
if ((Style & WS_THICKFRAME) && !(Style & WS_MINIMIZE))
|
||||
{
|
||||
|
@ -382,7 +382,7 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active)
|
|||
{
|
||||
DWORD Width = GetSystemMetrics(SM_CXBORDER);
|
||||
DWORD Height = GetSystemMetrics(SM_CYBORDER);
|
||||
|
||||
|
||||
SelectObject(hDC, GetSysColorBrush(
|
||||
(ExStyle & (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE)) ? COLOR_3DFACE :
|
||||
(ExStyle & WS_EX_STATICEDGE) ? COLOR_WINDOWFRAME :
|
||||
|
@ -409,7 +409,7 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active)
|
|||
DWORD CaptionFlags = DC_ICON | DC_TEXT | DC_BUTTONS;
|
||||
HPEN PreviousPen;
|
||||
BOOL Gradient = FALSE;
|
||||
|
||||
|
||||
if(SystemParametersInfoW(SPI_GETGRADIENTCAPTIONS, 0, &Gradient, 0) && Gradient)
|
||||
{
|
||||
CaptionFlags |= DC_GRADIENT;
|
||||
|
@ -433,7 +433,7 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active)
|
|||
TempRect.bottom = TempRect.top + GetSystemMetrics(SM_CYCAPTION) - 1;
|
||||
CurrentRect.top += GetSystemMetrics(SM_CYCAPTION);
|
||||
}
|
||||
|
||||
|
||||
DrawCaption(hWnd, hDC, &TempRect, CaptionFlags);
|
||||
|
||||
/* Draw buttons */
|
||||
|
@ -458,7 +458,7 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active)
|
|||
SelectObject(hDC, PreviousPen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!(Style & WS_MINIMIZE))
|
||||
{
|
||||
HMENU menu = GetMenu(hWnd);
|
||||
|
@ -469,18 +469,18 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active)
|
|||
TempRect.bottom = TempRect.top + (UINT)NtUserSetMenuBarHeight(menu, 0);
|
||||
CurrentRect.top += MenuDrawMenuBar(hDC, &TempRect, hWnd, FALSE);
|
||||
}
|
||||
|
||||
|
||||
if (ExStyle & WS_EX_CLIENTEDGE)
|
||||
{
|
||||
DrawEdge(hDC, &CurrentRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
||||
}
|
||||
|
||||
|
||||
/* Draw the scrollbars */
|
||||
if ((Style & WS_VSCROLL) && (Style & WS_HSCROLL) &&
|
||||
IntIsScrollBarVisible(hWnd, OBJID_VSCROLL) && IntIsScrollBarVisible(hWnd, OBJID_HSCROLL))
|
||||
{
|
||||
RECT ParentClientRect;
|
||||
|
||||
|
||||
TempRect = CurrentRect;
|
||||
if (ExStyle & WS_EX_LEFTSCROLLBAR)
|
||||
TempRect.right = TempRect.left + GetSystemMetrics(SM_CXVSCROLL);
|
||||
|
@ -533,14 +533,14 @@ DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect)
|
|||
}
|
||||
Result |= WVR_VALIDRECTS;
|
||||
}
|
||||
|
||||
|
||||
Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||
ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
||||
|
||||
|
||||
if (!(Style & WS_MINIMIZE))
|
||||
{
|
||||
HMENU menu = GetMenu(hWnd);
|
||||
|
||||
|
||||
if (UserHasWindowEdge(Style, ExStyle))
|
||||
{
|
||||
UserGetWindowBorders(Style, ExStyle, &WindowBorders, FALSE);
|
||||
|
@ -579,18 +579,18 @@ DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect)
|
|||
InflateRect(Rect, -2 * GetSystemMetrics(SM_CXBORDER),
|
||||
-2 * GetSystemMetrics(SM_CYBORDER));
|
||||
}
|
||||
|
||||
|
||||
if(Style & (WS_VSCROLL | WS_HSCROLL))
|
||||
{
|
||||
SCROLLBARINFO sbi;
|
||||
SETSCROLLBARINFO ssbi;
|
||||
|
||||
|
||||
sbi.cbSize = sizeof(SCROLLBARINFO);
|
||||
if((Style & WS_VSCROLL) && NtUserGetScrollBarInfo(hWnd, OBJID_VSCROLL, &sbi))
|
||||
{
|
||||
int i;
|
||||
LONG sx = Rect->right;
|
||||
|
||||
|
||||
sx -= GetSystemMetrics(SM_CXVSCROLL);
|
||||
for(i = 0; i <= CCHILDREN_SCROLLBAR; i++)
|
||||
ssbi.rgstate[i] = sbi.rgstate[i];
|
||||
|
@ -604,12 +604,12 @@ DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect)
|
|||
}
|
||||
else
|
||||
Style &= ~WS_VSCROLL;
|
||||
|
||||
|
||||
if((Style & WS_HSCROLL) && NtUserGetScrollBarInfo(hWnd, OBJID_HSCROLL, &sbi))
|
||||
{
|
||||
int i;
|
||||
LONG sy = Rect->bottom;
|
||||
|
||||
|
||||
sy -= GetSystemMetrics(SM_CYHSCROLL);
|
||||
for(i = 0; i <= CCHILDREN_SCROLLBAR; i++)
|
||||
ssbi.rgstate[i] = sbi.rgstate[i];
|
||||
|
@ -655,7 +655,7 @@ DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect)
|
|||
Rect->right = Rect->left;
|
||||
Rect->bottom = Rect->top;
|
||||
}
|
||||
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
@ -681,14 +681,14 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
|||
|
||||
GetWindowRect(hWnd, &WindowRect);
|
||||
if (!PtInRect(&WindowRect, Point))
|
||||
{
|
||||
{
|
||||
return HTNOWHERE;
|
||||
}
|
||||
OrigWndRect = WindowRect;
|
||||
|
||||
|
||||
if (UserHasWindowEdge(Style, ExStyle))
|
||||
{
|
||||
LONG XSize, YSize;
|
||||
LONG XSize, YSize;
|
||||
|
||||
UserGetWindowBorders(Style, ExStyle, &WindowBorders, FALSE);
|
||||
InflateRect(&WindowRect, -WindowBorders.cx, -WindowBorders.cy);
|
||||
|
@ -697,7 +697,7 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
|||
if (!PtInRect(&WindowRect, Point))
|
||||
{
|
||||
BOOL ThickFrame;
|
||||
|
||||
|
||||
ThickFrame = (Style & WS_THICKFRAME);
|
||||
if (Point.y < WindowRect.top)
|
||||
{
|
||||
|
@ -794,20 +794,20 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
|||
return HTCAPTION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!(Style & WS_MINIMIZE))
|
||||
{
|
||||
HMENU menu;
|
||||
|
||||
|
||||
ClientPoint = Point;
|
||||
ScreenToClient(hWnd, &ClientPoint);
|
||||
GetClientRect(hWnd, &ClientRect);
|
||||
|
||||
|
||||
if (PtInRect(&ClientRect, ClientPoint))
|
||||
{
|
||||
return HTCLIENT;
|
||||
}
|
||||
|
||||
|
||||
if ((menu = GetMenu(hWnd)) && !(Style & WS_CHILD))
|
||||
{
|
||||
if (Point.x > 0 && Point.x < WindowRect.right && ClientPoint.y < 0)
|
||||
|
@ -846,7 +846,7 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
|||
TempRect.bottom = TempRect2.bottom;
|
||||
if(Parent)
|
||||
GetClientRect(Parent, &ParentRect);
|
||||
if (PtInRect(&TempRect, Point) && HASSIZEGRIP(Style, ExStyle,
|
||||
if (PtInRect(&TempRect, Point) && HASSIZEGRIP(Style, ExStyle,
|
||||
GetWindowLongW(Parent, GWL_STYLE), OrigWndRect, ParentRect))
|
||||
{
|
||||
if ((ExStyle & WS_EX_LEFTSCROLLBAR) != 0)
|
||||
|
@ -877,7 +877,7 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return HTNOWHERE;
|
||||
}
|
||||
|
||||
|
@ -889,7 +889,7 @@ DefWndDoButton(HWND hWnd, WPARAM wParam)
|
|||
BOOL Pressed = TRUE, OldState;
|
||||
WPARAM SCMsg;
|
||||
ULONG ButtonType, Style;
|
||||
|
||||
|
||||
Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||
switch (wParam)
|
||||
{
|
||||
|
@ -916,7 +916,7 @@ DefWndDoButton(HWND hWnd, WPARAM wParam)
|
|||
ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* FIXME: Not sure where to do this, but we must flush the pending
|
||||
* window updates when someone clicks on the close button and at
|
||||
|
@ -929,12 +929,12 @@ DefWndDoButton(HWND hWnd, WPARAM wParam)
|
|||
UserDrawCaptionButtonWnd(hWnd, WindowDC, TRUE, ButtonType);
|
||||
|
||||
SetCapture(hWnd);
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (GetMessageW(&Msg, 0, WM_MOUSEFIRST, WM_MOUSELAST) <= 0)
|
||||
break;
|
||||
|
||||
|
||||
if (Msg.message == WM_LBUTTONUP)
|
||||
break;
|
||||
|
||||
|
@ -946,7 +946,7 @@ DefWndDoButton(HWND hWnd, WPARAM wParam)
|
|||
if (Pressed != OldState)
|
||||
UserDrawCaptionButtonWnd(hWnd, WindowDC, Pressed, ButtonType);
|
||||
}
|
||||
|
||||
|
||||
if (Pressed)
|
||||
UserDrawCaptionButtonWnd(hWnd, WindowDC, FALSE, ButtonType);
|
||||
ReleaseCapture();
|
||||
|
@ -1022,7 +1022,7 @@ LRESULT
|
|||
DefWndNCLButtonDblClk(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
ULONG Style;
|
||||
|
||||
|
||||
Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||
switch(wParam)
|
||||
{
|
||||
|
@ -1073,13 +1073,13 @@ DefWndTrackScrollBar(HWND hWnd, WPARAM wParam, POINT Point)
|
|||
* @implemented
|
||||
*/
|
||||
BOOL STDCALL
|
||||
AdjustWindowRectEx(LPRECT lpRect,
|
||||
DWORD dwStyle,
|
||||
BOOL bMenu,
|
||||
AdjustWindowRectEx(LPRECT lpRect,
|
||||
DWORD dwStyle,
|
||||
BOOL bMenu,
|
||||
DWORD dwExStyle)
|
||||
{
|
||||
SIZE BorderSize;
|
||||
|
||||
|
||||
if (bMenu)
|
||||
{
|
||||
lpRect->top -= GetSystemMetrics(SM_CYMENU);
|
||||
|
@ -1150,7 +1150,7 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
|
|||
#endif
|
||||
|
||||
Style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||
|
||||
|
||||
/* Windows behaves like this */
|
||||
Height = GetSystemMetrics(SM_CYCAPTION) - 1;
|
||||
|
||||
|
@ -1177,13 +1177,13 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
|
|||
TRIVERTEX vert[2];
|
||||
COLORREF Colors[2];
|
||||
LONG xx;
|
||||
|
||||
|
||||
r.right = (lprc->right - lprc->left);
|
||||
if (uFlags & DC_SMALLCAP)
|
||||
ButtonWidth = GetSystemMetrics(SM_CXSMSIZE) - 2;
|
||||
else
|
||||
ButtonWidth = GetSystemMetrics(SM_CXSIZE) - 2;
|
||||
|
||||
|
||||
if (Style & WS_SYSMENU)
|
||||
{
|
||||
r.right -= 3 + ButtonWidth;
|
||||
|
@ -1196,10 +1196,10 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
|
|||
r.right -= 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Colors[0] = GetSysColor((uFlags & DC_ACTIVE) ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION);
|
||||
Colors[1] = GetSysColor((uFlags & DC_ACTIVE) ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION);
|
||||
|
||||
|
||||
if ((uFlags & DC_ICON) && (Style & WS_SYSMENU) && !(uFlags & DC_SMALLCAP))
|
||||
{
|
||||
OldBrush = SelectObject(MemDC, GetSysColorBrush(uFlags & DC_ACTIVE ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION));
|
||||
|
@ -1213,23 +1213,23 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
|
|||
r.left += xx;
|
||||
r.top ++;
|
||||
}
|
||||
|
||||
|
||||
vert[0].x = r.left;
|
||||
vert[0].y = 0;
|
||||
vert[0].Red = GetRValue(Colors[0]) << 8;
|
||||
vert[0].Green = GetGValue(Colors[0]) << 8;
|
||||
vert[0].Blue = GetBValue(Colors[0]) << 8;
|
||||
vert[0].Alpha = 0;
|
||||
|
||||
|
||||
vert[1].x = r.right;
|
||||
vert[1].y = lprc->bottom - lprc->top;
|
||||
vert[1].Red = GetRValue(Colors[1]) << 8;
|
||||
vert[1].Green = GetGValue(Colors[1]) << 8;
|
||||
vert[1].Blue = GetBValue(Colors[1]) << 8;
|
||||
vert[1].Alpha = 0;
|
||||
|
||||
|
||||
GdiGradientFill(MemDC, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_H);
|
||||
|
||||
|
||||
if(OldBrush)
|
||||
{
|
||||
SelectObject(MemDC, OldBrush);
|
||||
|
@ -1250,7 +1250,7 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
|
|||
if (! PatBlt(MemDC, 0, 0, lprc->right - lprc->left, lprc->bottom - lprc->top, PATCOPY )) goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((uFlags & DC_ICON) && !(uFlags & DC_GRADIENT) && (Style & WS_SYSMENU) && !(uFlags & DC_SMALLCAP))
|
||||
{
|
||||
/* For some reason the icon isn't centered correctly... */
|
||||
|
@ -1301,14 +1301,14 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
|
|||
|
||||
hOldFont = SelectObject(MemDC, hFont);
|
||||
if (! hOldFont) goto cleanup;
|
||||
|
||||
|
||||
if (uFlags & DC_INBUTTON)
|
||||
OldTextColor = SetTextColor(MemDC, GetSysColor(uFlags & DC_ACTIVE ? COLOR_BTNTEXT : COLOR_GRAYTEXT));
|
||||
else
|
||||
OldTextColor = SetTextColor(MemDC, GetSysColor(uFlags & DC_ACTIVE ? COLOR_CAPTIONTEXT : COLOR_INACTIVECAPTIONTEXT));
|
||||
|
||||
DrawTextW(MemDC, buffer, wcslen(buffer), &r, DT_VCENTER | DT_END_ELLIPSIS);
|
||||
|
||||
|
||||
SetTextColor(MemDC, OldTextColor);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ BOOL STDCALL PolyPatBlt(HDC,DWORD,PPATRECT,INT,ULONG);
|
|||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
VOID
|
||||
VOID
|
||||
CreateFrameBrushes(VOID)
|
||||
{
|
||||
FrameBrushes[0] = CreateSolidBrush(RGB(0,0,0));
|
||||
|
@ -60,7 +60,7 @@ CreateFrameBrushes(VOID)
|
|||
FrameBrushes[12] = CreatePatternBrush(hHatch);
|
||||
}
|
||||
|
||||
VOID
|
||||
VOID
|
||||
DeleteFrameBrushes(VOID)
|
||||
{
|
||||
unsigned Brush;
|
||||
|
|
|
@ -52,13 +52,13 @@ EnumPropsA(HWND hWnd, PROPENUMPROCA lpEnumFunc)
|
|||
NTSTATUS Status;
|
||||
DWORD Count;
|
||||
int ret = -1;
|
||||
|
||||
|
||||
if(!lpEnumFunc)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Status = NtUserBuildPropList(hWnd, NULL, 0, &Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -68,11 +68,11 @@ EnumPropsA(HWND hWnd, PROPENUMPROCA lpEnumFunc)
|
|||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
if(Count > 0)
|
||||
{
|
||||
pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
|
||||
|
||||
|
||||
Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -83,23 +83,23 @@ EnumPropsA(HWND hWnd, PROPENUMPROCA lpEnumFunc)
|
|||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
i = pli;
|
||||
for(; Count > 0; Count--, i++)
|
||||
{
|
||||
char str[ATOM_BUFFER_SIZE];
|
||||
|
||||
|
||||
if(!GlobalGetAtomNameA(i->Atom, str, ATOM_BUFFER_SIZE))
|
||||
continue;
|
||||
|
||||
|
||||
ret = lpEnumFunc(hWnd, str, i->Data);
|
||||
if(!ret)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -114,13 +114,13 @@ EnumPropsExA(HWND hWnd, PROPENUMPROCEXA lpEnumFunc, LPARAM lParam)
|
|||
NTSTATUS Status;
|
||||
DWORD Count;
|
||||
int ret = -1;
|
||||
|
||||
|
||||
if(!lpEnumFunc)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Status = NtUserBuildPropList(hWnd, NULL, 0, &Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -130,11 +130,11 @@ EnumPropsExA(HWND hWnd, PROPENUMPROCEXA lpEnumFunc, LPARAM lParam)
|
|||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
if(Count > 0)
|
||||
{
|
||||
pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
|
||||
|
||||
|
||||
Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -145,23 +145,23 @@ EnumPropsExA(HWND hWnd, PROPENUMPROCEXA lpEnumFunc, LPARAM lParam)
|
|||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
i = pli;
|
||||
for(; Count > 0; Count--, i++)
|
||||
{
|
||||
char str[ATOM_BUFFER_SIZE];
|
||||
|
||||
|
||||
if(!GlobalGetAtomNameA(i->Atom, str, ATOM_BUFFER_SIZE))
|
||||
continue;
|
||||
|
||||
|
||||
ret = lpEnumFunc(hWnd, str, i->Data, lParam);
|
||||
if(!ret)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -176,13 +176,13 @@ EnumPropsExW(HWND hWnd, PROPENUMPROCEXW lpEnumFunc, LPARAM lParam)
|
|||
NTSTATUS Status;
|
||||
DWORD Count;
|
||||
int ret = -1;
|
||||
|
||||
|
||||
if(!lpEnumFunc)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Status = NtUserBuildPropList(hWnd, NULL, 0, &Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -192,11 +192,11 @@ EnumPropsExW(HWND hWnd, PROPENUMPROCEXW lpEnumFunc, LPARAM lParam)
|
|||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
if(Count > 0)
|
||||
{
|
||||
pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
|
||||
|
||||
|
||||
Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -207,23 +207,23 @@ EnumPropsExW(HWND hWnd, PROPENUMPROCEXW lpEnumFunc, LPARAM lParam)
|
|||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
i = pli;
|
||||
for(; Count > 0; Count--, i++)
|
||||
{
|
||||
WCHAR str[ATOM_BUFFER_SIZE];
|
||||
|
||||
|
||||
if(!GlobalGetAtomNameW(i->Atom, str, ATOM_BUFFER_SIZE))
|
||||
continue;
|
||||
|
||||
|
||||
ret = lpEnumFunc(hWnd, str, i->Data, lParam);
|
||||
if(!ret)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -238,13 +238,13 @@ EnumPropsW(HWND hWnd, PROPENUMPROCW lpEnumFunc)
|
|||
NTSTATUS Status;
|
||||
DWORD Count;
|
||||
int ret = -1;
|
||||
|
||||
|
||||
if(!lpEnumFunc)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Status = NtUserBuildPropList(hWnd, NULL, 0, &Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -254,11 +254,11 @@ EnumPropsW(HWND hWnd, PROPENUMPROCW lpEnumFunc)
|
|||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
if(Count > 0)
|
||||
{
|
||||
pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
|
||||
|
||||
|
||||
Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
|
||||
if(!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -269,23 +269,23 @@ EnumPropsW(HWND hWnd, PROPENUMPROCW lpEnumFunc)
|
|||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
i = pli;
|
||||
for(; Count > 0; Count--, i++)
|
||||
{
|
||||
WCHAR str[ATOM_BUFFER_SIZE];
|
||||
|
||||
|
||||
if(!GlobalGetAtomNameW(i->Atom, str, ATOM_BUFFER_SIZE))
|
||||
continue;
|
||||
|
||||
|
||||
ret = lpEnumFunc(hWnd, str, i->Data);
|
||||
if(!ret)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,7 @@ GetPropA(HWND hWnd, LPCSTR lpString)
|
|||
else
|
||||
{
|
||||
Ret = GetPropW(hWnd, (LPWSTR)lpString);
|
||||
}
|
||||
}
|
||||
return(Ret);
|
||||
}
|
||||
|
||||
|
@ -395,7 +395,7 @@ SetPropA(HWND hWnd, LPCSTR lpString, HANDLE hData)
|
|||
PWSTR lpWString;
|
||||
UNICODE_STRING UString;
|
||||
BOOL Ret;
|
||||
|
||||
|
||||
if (HIWORD(lpString))
|
||||
{
|
||||
RtlCreateUnicodeStringFromAsciiz(&UString, (LPSTR)lpString);
|
||||
|
@ -430,6 +430,6 @@ SetPropW(HWND hWnd, LPCWSTR lpString, HANDLE hData)
|
|||
{
|
||||
Atom = LOWORD((DWORD)lpString);
|
||||
}
|
||||
|
||||
|
||||
return(NtUserSetProp(hWnd, Atom, hData));
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ CopyRect(LPRECT lprcDst, CONST RECT *lprcSrc)
|
|||
{
|
||||
if(lprcDst == NULL || lprcSrc == NULL)
|
||||
return(FALSE);
|
||||
|
||||
|
||||
*lprcDst = *lprcSrc;
|
||||
return(TRUE);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ EqualRect(
|
|||
{
|
||||
if (lprc1 == NULL || lprc2 == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
return (lprc1->left == lprc2->left) && (lprc1->top == lprc2->top) &&
|
||||
(lprc1->right == lprc2->right) && (lprc1->bottom == lprc2->bottom);
|
||||
}
|
||||
|
@ -86,9 +86,9 @@ IntersectRect(LPRECT lprcDst,
|
|||
CONST RECT *lprcSrc2)
|
||||
{
|
||||
if (IsRectEmpty(lprcSrc1) || IsRectEmpty(lprcSrc2) ||
|
||||
lprcSrc1->left >= lprcSrc2->right ||
|
||||
lprcSrc1->left >= lprcSrc2->right ||
|
||||
lprcSrc2->left >= lprcSrc1->right ||
|
||||
lprcSrc1->top >= lprcSrc2->bottom ||
|
||||
lprcSrc1->top >= lprcSrc2->bottom ||
|
||||
lprcSrc2->top >= lprcSrc1->bottom)
|
||||
{
|
||||
SetRectEmpty(lprcDst);
|
||||
|
@ -120,12 +120,12 @@ OffsetRect(LPRECT rect, int dx, int dy)
|
|||
{
|
||||
if(rect == NULL)
|
||||
return(FALSE);
|
||||
|
||||
|
||||
rect->left += dx;
|
||||
rect->top += dy;
|
||||
rect->right += dx;
|
||||
rect->bottom += dy;
|
||||
return(TRUE);
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -168,15 +168,15 @@ BOOL STDCALL
|
|||
SubtractRect(LPRECT lprcDst, CONST RECT *lprcSrc1, CONST RECT *lprcSrc2)
|
||||
{
|
||||
RECT tempRect;
|
||||
|
||||
|
||||
if(lprcDst == NULL || lprcSrc1 == NULL || lprcSrc2 == NULL)
|
||||
return(FALSE);
|
||||
|
||||
|
||||
CopyRect(lprcDst, lprcSrc1);
|
||||
|
||||
|
||||
if(!IntersectRect(&tempRect, lprcSrc1, lprcSrc2))
|
||||
return(TRUE);
|
||||
|
||||
|
||||
if (EqualRect(&tempRect, lprcDst))
|
||||
{
|
||||
SetRectEmpty(lprcDst);
|
||||
|
@ -196,7 +196,7 @@ SubtractRect(LPRECT lprcDst, CONST RECT *lprcSrc1, CONST RECT *lprcSrc2)
|
|||
else if(lprcDst->right == tempRect.right)
|
||||
lprcDst->right = tempRect.left;
|
||||
}
|
||||
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
|
|
@ -87,11 +87,11 @@ BeginDeferWindowPos(int nNumWindows)
|
|||
BOOL STDCALL
|
||||
BringWindowToTop(HWND hWnd)
|
||||
{
|
||||
return NtUserSetWindowPos( hWnd,
|
||||
HWND_TOP,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
return NtUserSetWindowPos( hWnd,
|
||||
HWND_TOP,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
SWP_NOSIZE | SWP_NOMOVE );
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ CreateWindowExA(DWORD dwExStyle,
|
|||
SetLastError(ERROR_OUTOFMEMORY);
|
||||
return (HWND)0;
|
||||
}
|
||||
|
||||
|
||||
if(!hMenu && (dwStyle & (WS_OVERLAPPEDWINDOW | WS_POPUP)))
|
||||
{
|
||||
wce.cbSize = sizeof(WNDCLASSEXA);
|
||||
|
@ -248,11 +248,11 @@ CreateWindowExA(DWORD dwExStyle,
|
|||
|
||||
RtlFreeUnicodeString(&WindowName);
|
||||
|
||||
if (!IS_ATOM(lpClassName))
|
||||
if (!IS_ATOM(lpClassName))
|
||||
{
|
||||
RtlFreeUnicodeString(&ClassName);
|
||||
}
|
||||
|
||||
|
||||
return Handle;
|
||||
}
|
||||
|
||||
|
@ -289,12 +289,12 @@ CreateWindowExW(DWORD dwExStyle,
|
|||
return CreateMDIWindowW(lpClassName, lpWindowName, dwStyle, x, y,
|
||||
nWidth, nHeight, hWndParent, hInstance, (LPARAM)lpParam);
|
||||
|
||||
if (IS_ATOM(lpClassName))
|
||||
if (IS_ATOM(lpClassName))
|
||||
{
|
||||
RtlInitUnicodeString(&ClassName, NULL);
|
||||
ClassName.Buffer = (LPWSTR)lpClassName;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlInitUnicodeString(&ClassName, lpClassName);
|
||||
}
|
||||
|
@ -542,12 +542,12 @@ FindWindowExA(HWND hwndParent,
|
|||
ucClassName.Buffer = NULL;
|
||||
ucClassName.Length = 0;
|
||||
}
|
||||
else if (IS_ATOM(lpszClass))
|
||||
else if (IS_ATOM(lpszClass))
|
||||
{
|
||||
ucClassName.Buffer = (LPWSTR)lpszClass;
|
||||
ucClassName.Length = 0;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlCreateUnicodeStringFromAsciiz(&ucClassName, (LPSTR)lpszClass);
|
||||
}
|
||||
|
@ -557,7 +557,7 @@ FindWindowExA(HWND hwndParent,
|
|||
Result = NtUserFindWindowEx(hwndParent, hwndChildAfter, &ucClassName,
|
||||
&ucWindowName);
|
||||
|
||||
if (!IS_ATOM(lpszClass))
|
||||
if (!IS_ATOM(lpszClass))
|
||||
RtlFreeUnicodeString(&ucClassName);
|
||||
RtlFreeUnicodeString(&ucWindowName);
|
||||
|
||||
|
@ -582,16 +582,16 @@ FindWindowExW(HWND hwndParent,
|
|||
ucClassName.Buffer = NULL;
|
||||
ucClassName.Length = 0;
|
||||
}
|
||||
else if (IS_ATOM(lpszClass))
|
||||
else if (IS_ATOM(lpszClass))
|
||||
{
|
||||
RtlInitUnicodeString(&ucClassName, NULL);
|
||||
ucClassName.Buffer = (LPWSTR)lpszClass;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlInitUnicodeString(&ucClassName, lpszClass);
|
||||
}
|
||||
|
||||
|
||||
RtlInitUnicodeString(&ucWindowName, lpszWindow);
|
||||
|
||||
return NtUserFindWindowEx(hwndParent, hwndChildAfter, &ucClassName, &ucWindowName);
|
||||
|
@ -616,14 +616,14 @@ FindWindowA(LPCSTR lpClassName, LPCSTR lpWindowName)
|
|||
HWND STDCALL
|
||||
FindWindowW(LPCWSTR lpClassName, LPCWSTR lpWindowName)
|
||||
{
|
||||
/*
|
||||
|
||||
/*
|
||||
|
||||
There was a FIXME here earlier, but I think it is just a documentation unclarity.
|
||||
|
||||
FindWindow only searches top level windows. What they mean is that child
|
||||
windows of other windows than the desktop can be searched.
|
||||
FindWindow only searches top level windows. What they mean is that child
|
||||
windows of other windows than the desktop can be searched.
|
||||
FindWindowExW never does a recursive search.
|
||||
|
||||
|
||||
/ Joakim
|
||||
*/
|
||||
|
||||
|
@ -778,12 +778,12 @@ GetWindowModuleFileNameA(HWND hwnd,
|
|||
UINT cchFileNameMax)
|
||||
{
|
||||
HINSTANCE hWndInst;
|
||||
|
||||
|
||||
if(!(hWndInst = NtUserGetWindowInstance(hwnd)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return GetModuleFileNameA(hWndInst, lpszFileName, cchFileNameMax);
|
||||
}
|
||||
|
||||
|
@ -797,12 +797,12 @@ GetWindowModuleFileNameW(HWND hwnd,
|
|||
UINT cchFileNameMax)
|
||||
{
|
||||
HINSTANCE hWndInst;
|
||||
|
||||
|
||||
if(!(hWndInst = NtUserGetWindowInstance(hwnd)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return GetModuleFileNameW(hWndInst, lpszFileName, cchFileNameMax);
|
||||
}
|
||||
|
||||
|
@ -840,13 +840,13 @@ GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if(ProcessId != GetCurrentProcessId())
|
||||
{
|
||||
/* do not send WM_GETTEXT messages to other processes */
|
||||
LPWSTR Buffer;
|
||||
INT Length;
|
||||
|
||||
|
||||
if (nMaxCount > 1)
|
||||
{
|
||||
*((PWSTR)lpString) = '\0';
|
||||
|
@ -861,12 +861,12 @@ GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
|
|||
{
|
||||
lpString[0] = '\0';
|
||||
}
|
||||
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, Buffer);
|
||||
|
||||
|
||||
return (LRESULT)Length;
|
||||
}
|
||||
|
||||
|
||||
return(SendMessageA(hWnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString));
|
||||
}
|
||||
|
||||
|
@ -882,12 +882,12 @@ GetWindowTextLengthA(HWND hWnd)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if(ProcessId == GetCurrentProcessId())
|
||||
{
|
||||
return(SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0));
|
||||
}
|
||||
|
||||
|
||||
/* do not send WM_GETTEXT messages to other processes */
|
||||
return (LRESULT)NtUserInternalGetWindowText(hWnd, NULL, 0);
|
||||
}
|
||||
|
@ -904,12 +904,12 @@ GetWindowTextLengthW(HWND hWnd)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if(ProcessId == GetCurrentProcessId())
|
||||
{
|
||||
return(SendMessageW(hWnd, WM_GETTEXTLENGTH, 0, 0));
|
||||
}
|
||||
|
||||
|
||||
/* do not send WM_GETTEXT messages to other processes */
|
||||
return (LRESULT)NtUserInternalGetWindowText(hWnd, NULL, 0);
|
||||
}
|
||||
|
@ -929,18 +929,18 @@ GetWindowTextW(
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if(ProcessId == GetCurrentProcessId())
|
||||
{
|
||||
return(SendMessageW(hWnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString));
|
||||
}
|
||||
|
||||
|
||||
/* do not send WM_GETTEXT messages to other processes */
|
||||
if (nMaxCount > 1)
|
||||
{
|
||||
*((PWSTR)lpString) = L'\0';
|
||||
}
|
||||
|
||||
|
||||
return (LRESULT)NtUserInternalGetWindowText(hWnd, (PWSTR)lpString, nMaxCount);
|
||||
}
|
||||
|
||||
|
@ -964,12 +964,12 @@ IsChild(HWND hWndParent,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
do
|
||||
do
|
||||
{
|
||||
hWnd = (HWND)NtUserGetWindowLong(hWnd, GWL_HWNDPARENT, FALSE);
|
||||
}
|
||||
while (hWnd != NULL && hWnd != hWndParent);
|
||||
|
||||
|
||||
return hWnd == hWndParent;
|
||||
}
|
||||
|
||||
|
@ -980,7 +980,7 @@ IsChild(HWND hWndParent,
|
|||
BOOL STDCALL
|
||||
IsIconic(HWND hWnd)
|
||||
{
|
||||
return (NtUserGetWindowLong( hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE) != 0;
|
||||
return (NtUserGetWindowLong( hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE) != 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1088,7 +1088,7 @@ AnimateWindow(HWND hwnd,
|
|||
/* If trying to show/hide and it's already *
|
||||
* shown/hidden or invalid window, fail with *
|
||||
* invalid parameter */
|
||||
|
||||
|
||||
BOOL visible;
|
||||
visible = IsWindowVisible(hwnd);
|
||||
// if(!IsWindow(hwnd) ||
|
||||
|
@ -1217,13 +1217,13 @@ SetWindowTextA(HWND hWnd,
|
|||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if(ProcessId != GetCurrentProcessId())
|
||||
{
|
||||
/* do not send WM_GETTEXT messages to other processes */
|
||||
ANSI_STRING AnsiString;
|
||||
UNICODE_STRING UnicodeString;
|
||||
|
||||
|
||||
if(lpString)
|
||||
{
|
||||
RtlInitAnsiString(&AnsiString, (LPSTR)lpString);
|
||||
|
@ -1233,14 +1233,14 @@ SetWindowTextA(HWND hWnd,
|
|||
}
|
||||
else
|
||||
NtUserDefSetText(hWnd, NULL);
|
||||
|
||||
|
||||
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
||||
{
|
||||
DefWndNCPaint(hWnd, (HRGN)1, -1);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
return SendMessageA(hWnd, WM_SETTEXT, 0, (LPARAM)lpString);
|
||||
}
|
||||
|
||||
|
@ -1257,24 +1257,24 @@ SetWindowTextW(HWND hWnd,
|
|||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if(ProcessId != GetCurrentProcessId())
|
||||
{
|
||||
/* do not send WM_GETTEXT messages to other processes */
|
||||
UNICODE_STRING UnicodeString;
|
||||
|
||||
|
||||
if(lpString)
|
||||
RtlInitUnicodeString(&UnicodeString, (LPWSTR)lpString);
|
||||
|
||||
|
||||
NtUserDefSetText(hWnd, (lpString ? &UnicodeString : NULL));
|
||||
|
||||
|
||||
if ((GetWindowLongW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
|
||||
{
|
||||
DefWndNCPaint(hWnd, (HRGN)1, -1);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
return SendMessageW(hWnd, WM_SETTEXT, 0, (LPARAM)lpString);
|
||||
}
|
||||
|
||||
|
@ -1356,7 +1356,7 @@ UpdateLayeredWindow(HWND hwnd,
|
|||
HWND STDCALL
|
||||
WindowFromPoint(POINT Point)
|
||||
{
|
||||
//TODO: Determine what the actual parameters to
|
||||
//TODO: Determine what the actual parameters to
|
||||
// NtUserWindowFromPoint are.
|
||||
return NtUserWindowFromPoint(Point.x, Point.y);
|
||||
}
|
||||
|
@ -1404,7 +1404,7 @@ MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints)
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
BOOL STDCALL
|
||||
BOOL STDCALL
|
||||
ScreenToClient(HWND hWnd, LPPOINT lpPoint)
|
||||
{
|
||||
return(MapWindowPoints(NULL, hWnd, lpPoint, 1) != 0);
|
||||
|
@ -1534,7 +1534,7 @@ BOOL STDCALL
|
|||
ScrollWindow(HWND hWnd, int dx, int dy, CONST RECT *lpRect,
|
||||
CONST RECT *prcClip)
|
||||
{
|
||||
return NtUserScrollWindowEx(hWnd, dx, dy, lpRect, prcClip, 0, NULL,
|
||||
return NtUserScrollWindowEx(hWnd, dx, dy, lpRect, prcClip, 0, NULL,
|
||||
(lpRect ? 0 : SW_SCROLLCHILDREN) | SW_INVALIDATE) != ERROR;
|
||||
}
|
||||
|
||||
|
@ -1574,11 +1574,11 @@ IsWindowInDestroy(HWND hWnd)
|
|||
* @implemented
|
||||
*/
|
||||
VOID
|
||||
STDCALL
|
||||
STDCALL
|
||||
DisableProcessWindowsGhosting(VOID)
|
||||
{
|
||||
NtUserEnableProcessWindowGhosting(FALSE);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ WinPosGetMinMaxInfo(HWND hWnd, POINT* MaxSize, POINT* MaxPos,
|
|||
POINT* MinTrack, POINT* MaxTrack)
|
||||
{
|
||||
MINMAXINFO MinMax;
|
||||
|
||||
|
||||
if(NtUserGetMinMaxInfo(hWnd, &MinMax, TRUE))
|
||||
{
|
||||
MinMax.ptMaxTrackSize.x = max(MinMax.ptMaxTrackSize.x,
|
||||
|
|
Loading…
Reference in a new issue