Implemented part of window properties support

Convert WM_GETTEXT messages when sending between windows
Added Steven's bitmaps to the user32 resources
Fixed some bugs when creating a DIB
Implemented LoadBitmap

svn path=/trunk/; revision=3455
This commit is contained in:
David Welch 2002-09-03 22:44:21 +00:00
parent 068a37b1cd
commit afe56d0970
20 changed files with 537 additions and 225 deletions

View file

@ -392,6 +392,7 @@ NtUserGetMessage 4
NtUserGetMouseMovePointsEx 5 NtUserGetMouseMovePointsEx 5
NtUserGetObjectInformation 5 NtUserGetObjectInformation 5
NtUserGetOpenClipboardWindow 0 NtUserGetOpenClipboardWindow 0
NtUserGetProp 2
NtUserGetPriorityClipboardFormat 2 NtUserGetPriorityClipboardFormat 2
NtUserGetProcessWindowStation 0 NtUserGetProcessWindowStation 0
NtUserGetScrollBarInfo 3 NtUserGetScrollBarInfo 3
@ -455,6 +456,7 @@ NtUserSBGetParms 4
NtUserScrollDC 7 NtUserScrollDC 7
NtUserScrollWindowEx 8 NtUserScrollWindowEx 8
NtUserSendInput 3 NtUserSendInput 3
NtUserSendMessage 4
NtUserSendMessageCallback 6 NtUserSendMessageCallback 6
NtUserSendNotifyMessage 4 NtUserSendNotifyMessage 4
NtUserSetActiveWindow 1 NtUserSetActiveWindow 1

View file

@ -11,6 +11,8 @@ INT STDCALL
NtUserReleaseDC(HWND hWnd, HDC hDc); NtUserReleaseDC(HWND hWnd, HDC hDc);
BOOL STDCALL BOOL STDCALL
NtUserGetWindowRect(HWND hWnd, LPRECT Rect); NtUserGetWindowRect(HWND hWnd, LPRECT Rect);
HANDLE STDCALL
NtUserGetProp(HWND hWnd, ATOM Atom);
NTSTATUS NTSTATUS
STDCALL STDCALL
@ -1125,11 +1127,8 @@ NtUserRemoveMenu(
DWORD Unknown1, DWORD Unknown1,
DWORD Unknown2); DWORD Unknown2);
DWORD HANDLE STDCALL
STDCALL NtUserRemoveProp(HWND hWnd, ATOM Atom);
NtUserRemoveProp(
DWORD Unknown0,
DWORD Unknown1);
DWORD DWORD
STDCALL STDCALL
@ -1356,12 +1355,8 @@ STDCALL
NtUserSetProcessWindowStation( NtUserSetProcessWindowStation(
HWINSTA hWindowStation); HWINSTA hWindowStation);
DWORD BOOL STDCALL
STDCALL NtUserSetProp(HWND hWnd, ATOM Atom, HANDLE Data);
NtUserSetProp(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2);
DWORD DWORD
STDCALL STDCALL

View file

@ -12,3 +12,9 @@ VOID
User32FreeHeap(PVOID Block); User32FreeHeap(PVOID Block);
PVOID PVOID
User32AllocHeap(ULONG Size); User32AllocHeap(ULONG Size);
VOID
User32ConvertUnicodeString(PWSTR SrcString, PSTR DestString, ULONG DestSize);
PWSTR
User32ConvertString(PCSTR String);
VOID
User32FreeString(PWSTR String);

View file

@ -37,6 +37,17 @@ User32ConvertString(PCSTR String)
return(OutString.Buffer); return(OutString.Buffer);
} }
VOID
User32ConvertUnicodeString(PWSTR SrcString, PSTR DestString, ULONG DestSize)
{
UNICODE_STRING InString;
ANSI_STRING OutString;
RtlInitUnicodeString(&InString, SrcString);
OutString.Buffer = DestString;
OutString.MaximumLength = DestSize;
RtlUnicodeStringToAnsiString(&OutString, &InString, FALSE);
}
VOID VOID
User32FreeString(PWSTR String) User32FreeString(PWSTR String)
{ {

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.11 2002/09/01 20:39:55 dwelch Exp $ /* $Id: stubs.c,v 1.12 2002/09/03 22:44:20 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
@ -262,31 +262,6 @@ IsWindowEnabled(
HANDLE
STDCALL
LoadImageA(
HINSTANCE hinst,
LPCSTR lpszName,
UINT uType,
int cxDesired,
int cyDesired,
UINT fuLoad)
{
return (HANDLE)0;
}
HANDLE
STDCALL
LoadImageW(
HINSTANCE hinst,
LPCWSTR lpszName,
UINT uType,
int cxDesired,
int cyDesired,
UINT fuLoad)
{
return (HANDLE)0;
}
int int
STDCALL STDCALL

View file

@ -36,6 +36,11 @@ BEGIN
END END
END END
OBM_CLOSE BITMAP "resources/obm_close.bmp"
OBM_REDUCE BITMAP "resources/obm_reduce.bmp"
OBM_ZOOM BITMAP "resources/obm_zoom.bmp"
OBM_RESTORE BITMAP "resources/obm_restore.bmp"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Dialog // Dialog
@ -56,3 +61,5 @@ BEGIN
PUSHBUTTON "&Yes", 6, 206, 26, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "&Yes", 6, 206, 26, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "&No", 7, 304, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "&No", 7, 304, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END END

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: bitmap.c,v 1.1 2002/06/13 20:36:40 dwelch Exp $ /* $Id: bitmap.c,v 1.2 2002/09/03 22:44:20 dwelch Exp $
* *
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c * FILE: lib/user32/windows/input.c
@ -34,20 +34,230 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
HBITMAP HANDLE STDCALL
STDCALL LoadImageA(HINSTANCE hinst,
LoadBitmapA( LPCSTR lpszName,
HINSTANCE hInstance, UINT uType,
LPCSTR lpBitmapName) int cxDesired,
int cyDesired,
UINT fuLoad)
{ {
return (HBITMAP)0; LPWSTR lpszWName;
HANDLE Handle;
if (HIWORD(lpszName))
{
lpszWName = User32ConvertString(lpszName);
Handle = LoadImageW(hinst, lpszWName, uType, cxDesired,
cyDesired, fuLoad);
User32FreeString(lpszWName);
}
else
{
Handle = LoadImageW(hinst, lpszWName, uType, cxDesired,
cyDesired, fuLoad);
}
return(Handle);
} }
HBITMAP HANDLE STATIC
STDCALL LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad)
LoadBitmapW(
HINSTANCE hInstance,
LPCWSTR lpBitmapName)
{ {
return (HBITMAP)0; HANDLE hResource;
HANDLE hFile;
HANDLE hSection;
BITMAPINFO* BitmapInfo;
BITMAPINFO* PrivateInfo;
HDC hScreenDc;
HANDLE hBitmap;
ULONG HeaderSize;
ULONG ColourCount;
PVOID Data;
if (!(fuLoad & LR_LOADFROMFILE))
{
if (hInstance == NULL)
{
hInstance = GetModuleHandle(L"USER32");
}
hResource = FindResourceW(hInstance, lpszName, RT_BITMAP);
if (hResource == NULL)
{
return(NULL);
}
hResource = LoadResource(hInstance, hResource);
if (hResource == NULL)
{
return(NULL);
}
BitmapInfo = LockResource(hResource);
if (BitmapInfo == NULL)
{
return(NULL);
}
}
else
{
hFile = CreateFile(lpszName,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
0,
NULL);
if (hFile == NULL)
{
return(NULL);
}
hSection = CreateFileMapping(hFile,
NULL,
PAGE_READONLY,
0,
0,
NULL);
CloseHandle(hFile);
if (hSection == NULL)
{
return(NULL);
}
BitmapInfo = MapViewOfFile(hSection,
FILE_MAP_READ,
0,
0,
0);
CloseHandle(hSection);
if (BitmapInfo == NULL)
{
return(NULL);
}
}
if (BitmapInfo->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
{
BITMAPCOREHEADER* Core = (BITMAPCOREHEADER*)BitmapInfo;
ColourCount = (Core->bcBitCount <= 8) ? (1 << Core->bcBitCount) : 0;
HeaderSize = sizeof(BITMAPCOREHEADER) + ColourCount * sizeof(RGBTRIPLE);
}
else
{
ColourCount = BitmapInfo->bmiHeader.biClrUsed;
if (ColourCount == 0 && BitmapInfo->bmiHeader.biBitCount <= 8)
{
ColourCount = 1 << BitmapInfo->bmiHeader.biBitCount;
}
HeaderSize = sizeof(BITMAPINFOHEADER) + ColourCount * sizeof(RGBQUAD);
}
Data = (PVOID)BitmapInfo + HeaderSize;
PrivateInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, HeaderSize);
if (PrivateInfo == NULL)
{
if (fuLoad & LR_LOADFROMFILE)
{
UnmapViewOfFile(BitmapInfo);
}
return(NULL);
}
memcpy(PrivateInfo, BitmapInfo, HeaderSize);
/* FIXME: Handle colour conversion and transparency. */
hScreenDc = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
if (hScreenDc == NULL)
{
if (fuLoad & LR_LOADFROMFILE)
{
UnmapViewOfFile(BitmapInfo);
}
return(NULL);
}
if (fuLoad & LR_CREATEDIBSECTION)
{
DIBSECTION Dib;
hBitmap = CreateDIBSection(hScreenDc, PrivateInfo, DIB_RGB_COLORS, NULL,
0, 0);
GetObjectA(hBitmap, sizeof(DIBSECTION), &Dib);
SetDIBits(hScreenDc, hBitmap, 0, Dib.dsBm.bmHeight, Data, BitmapInfo,
DIB_RGB_COLORS);
}
else
{
hBitmap = CreateDIBitmap(hScreenDc, &PrivateInfo->bmiHeader, CBM_INIT,
Data, PrivateInfo, DIB_RGB_COLORS);
}
RtlFreeHeap(RtlGetProcessHeap(), 0, PrivateInfo);
/*DeleteDC(hScreenDc);*/
if (fuLoad & LR_LOADFROMFILE)
{
UnmapViewOfFile(BitmapInfo);
}
return(hBitmap);
}
HANDLE STDCALL
LoadImageW(HINSTANCE hinst,
LPCWSTR lpszName,
UINT uType,
int cxDesired,
int cyDesired,
UINT fuLoad)
{
if (fuLoad & LR_DEFAULTSIZE)
{
if (uType == IMAGE_ICON)
{
if (cxDesired == 0)
{
cxDesired = GetSystemMetrics(SM_CXICON);
}
if (cyDesired == 0)
{
cyDesired = GetSystemMetrics(SM_CYICON);
}
}
else if (uType == IMAGE_CURSOR)
{
if (cxDesired == 0)
{
cxDesired = GetSystemMetrics(SM_CXCURSOR);
}
if (cyDesired == 0)
{
cyDesired = GetSystemMetrics(SM_CYCURSOR);
}
}
}
switch (uType)
{
case IMAGE_BITMAP:
{
return(LoadBitmapImage(hinst, lpszName, fuLoad));
}
case IMAGE_CURSOR:
{
DbgPrint("FIXME: Need support for loading cursors.\n");
return(NULL);
}
default:
DbgBreakPoint();
break;
}
return(NULL);
}
HBITMAP STDCALL
LoadBitmapA(HINSTANCE hInstance, LPCSTR lpBitmapName)
{
return(LoadImageA(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0, 0));
}
HBITMAP STDCALL
LoadBitmapW(HINSTANCE hInstance, LPCWSTR lpBitmapName)
{
return(LoadImageW(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0, 0));
} }

View file

@ -1,4 +1,4 @@
/* $Id: defwnd.c,v 1.6 2002/09/01 20:39:55 dwelch Exp $ /* $Id: defwnd.c,v 1.7 2002/09/03 22:44:20 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
@ -243,10 +243,7 @@ static void UserDrawCaptionNC( HDC hdc, RECT *rect, HWND hwnd,
if (!hbitmapClose) if (!hbitmapClose)
{ {
if (!(hbitmapClose = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_CLOSE) ))) hbitmapClose = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_CLOSE));
{
return;
}
hbitmapMinimize = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_REDUCE) ); hbitmapMinimize = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_REDUCE) );
hbitmapMinimizeD = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_REDUCED) ); hbitmapMinimizeD = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_REDUCED) );
hbitmapMaximize = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_ZOOM) ); hbitmapMaximize = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_ZOOM) );
@ -1074,7 +1071,7 @@ DefWindowProcA(HWND hWnd,
} }
return(0); return(0);
} }
strncpy((PWSTR)lParam, WindowText, wParam); strncpy(lParam, WindowText, wParam);
return(min(wParam, wcslen(WindowText))); return(min(wParam, wcslen(WindowText)));
} }

View file

@ -1,4 +1,4 @@
/* $Id: message.c,v 1.7 2002/06/18 21:51:09 dwelch Exp $ /* $Id: message.c,v 1.8 2002/09/03 22:44:20 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
@ -66,6 +66,23 @@ User32FreeAsciiConvertedMessage(UINT Msg, WPARAM wParam, LPARAM lParam)
{ {
switch(Msg) switch(Msg)
{ {
case WM_GETTEXT:
{
ANSI_STRING AnsiString;
UNICODE_STRING UnicodeString;
LPSTR TempString;
LPSTR InString;
InString = (LPSTR)lParam;
TempString = RtlAllocateHeap(RtlGetProcessHeap(), 0, strlen(lParam));
strcpy(TempString, InString);
RtlInitAnsiString(&AnsiString, TempString);
UnicodeString.Length = wParam;
UnicodeString.MaximumLength = wParam;
UnicodeString.Buffer = (PWSTR)lParam;
RtlAnsiStringToUnicodeString(&UnicodeString, &AnsiString, FALSE);
RtlFreeHeap(RtlGetProcessHeap(), 0, TempString);
break;
}
case WM_NCCREATE: case WM_NCCREATE:
{ {
CREATESTRUCTA* Cs; CREATESTRUCTA* Cs;
@ -73,6 +90,7 @@ User32FreeAsciiConvertedMessage(UINT Msg, WPARAM wParam, LPARAM lParam)
Cs = (CREATESTRUCTA*)lParam; Cs = (CREATESTRUCTA*)lParam;
RtlFreeHeap(RtlGetProcessHeap(), 0, (LPSTR)Cs->lpszName); RtlFreeHeap(RtlGetProcessHeap(), 0, (LPSTR)Cs->lpszName);
RtlFreeHeap(RtlGetProcessHeap(), 0, (LPSTR)Cs->lpszClass); RtlFreeHeap(RtlGetProcessHeap(), 0, (LPSTR)Cs->lpszClass);
RtlFreeHeap(RtlGetProcessHeap(), 0, Cs);
break; break;
} }
} }
@ -90,9 +108,9 @@ User32ConvertToAsciiMessage(UINT* Msg, WPARAM* wParam, LPARAM* lParam)
UNICODE_STRING UString; UNICODE_STRING UString;
ANSI_STRING AString; ANSI_STRING AString;
CsW = (CREATESTRUCTW*)lParam; CsW = (CREATESTRUCTW*)(*lParam);
CsA = User32AllocHeap(sizeof(CREATESTRUCTA)); CsA = User32AllocHeap(sizeof(CREATESTRUCTA));
memcpy(CsW, CsA, sizeof(CREATESTRUCTW)); memcpy(CsA, CsW, sizeof(CREATESTRUCTW));
RtlInitUnicodeString(&UString, CsW->lpszName); RtlInitUnicodeString(&UString, CsW->lpszName);
RtlUnicodeStringToAnsiString(&AString, &UString, TRUE); RtlUnicodeStringToAnsiString(&AString, &UString, TRUE);
@ -162,34 +180,59 @@ CallWindowProcW(WNDPROC lpPrevWndFunc,
} }
LPMSG BOOL
MsgiAnsiToUnicodeMessage( MsgiAnsiToUnicodeMessage(LPMSG UnicodeMsg, LPMSG AnsiMsg)
LPMSG AnsiMsg,
LPMSG UnicodeMsg)
{ {
/* FIXME: Convert */ *UnicodeMsg = *AnsiMsg;
RtlMoveMemory(UnicodeMsg, AnsiMsg, sizeof(MSG)); switch (AnsiMsg->message)
{
case WM_GETTEXT:
{
UnicodeMsg->wParam = UnicodeMsg->wParam / 2;
break;
}
}
return(TRUE);
}
return UnicodeMsg; BOOL
MsgiAnsiToUnicodeReply(LPMSG UnicodeMsg, LPMSG AnsiMsg, LRESULT Result)
{
switch (AnsiMsg->message)
{
case WM_GETTEXT:
{
ANSI_STRING AnsiString;
UNICODE_STRING UnicodeString;
LPWSTR TempString;
LPWSTR InString;
InString = (LPWSTR)UnicodeMsg->lParam;
TempString = RtlAllocateHeap(RtlGetProcessHeap(), 0,
wcslen(InString) * sizeof(WCHAR));
wcscpy(TempString, InString);
RtlInitUnicodeString(&UnicodeString, TempString);
AnsiString.Length = AnsiMsg->wParam;
AnsiString.MaximumLength = AnsiMsg->wParam;
AnsiString.Buffer = (PSTR)AnsiMsg->lParam;
RtlUnicodeStringToAnsiString(&AnsiString, &UnicodeString, FALSE);
RtlFreeHeap(RtlGetProcessHeap(), 0, TempString);
break;
}
}
return(TRUE);
} }
LRESULT LRESULT STDCALL
STDCALL DispatchMessageA(CONST MSG *lpmsg)
DispatchMessageA(
CONST MSG *lpmsg)
{ {
MSG Msg; return(NtUserDispatchMessage(lpmsg));
return NtUserDispatchMessage(MsgiAnsiToUnicodeMessage((LPMSG)lpmsg, &Msg));
} }
LRESULT LRESULT STDCALL
STDCALL DispatchMessageW(CONST MSG *lpmsg)
DispatchMessageW(
CONST MSG *lpmsg)
{ {
return NtUserDispatchMessage((LPMSG)lpmsg); return(NtUserDispatchMessage((LPMSG)lpmsg));
} }
WINBOOL WINBOOL
@ -289,15 +332,38 @@ PostThreadMessageW(
return NtUserPostThreadMessage(idThread, Msg, wParam, lParam); return NtUserPostThreadMessage(idThread, Msg, wParam, lParam);
} }
LRESULT LRESULT STDCALL
STDCALL SendMessageW(HWND hWnd,
SendMessageA(
HWND hWnd,
UINT Msg, UINT Msg,
WPARAM wParam, WPARAM wParam,
LPARAM lParam) LPARAM lParam)
{ {
return (LRESULT)0; return(NtUserSendMessage(hWnd, Msg, wParam, lParam));
}
LRESULT STDCALL
SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
MSG AnsiMsg;
MSG UcMsg;
LRESULT Result;
AnsiMsg.hwnd = hWnd;
AnsiMsg.message = Msg;
AnsiMsg.wParam = wParam;
AnsiMsg.lParam = lParam;
if (!MsgiAnsiToUnicodeMessage(&UcMsg, &AnsiMsg))
{
return(FALSE);
}
Result = SendMessageW(UcMsg.hwnd, UcMsg.message, UcMsg.wParam, UcMsg.lParam);
if (!MsgiAnsiToUnicodeReply(&UcMsg, &AnsiMsg, Result))
{
return(FALSE);
}
return(Result);
} }
WINBOOL WINBOOL
@ -367,16 +433,6 @@ SendMessageTimeoutW(
} }
LRESULT
STDCALL
SendMessageW(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam)
{
return (LRESULT)0;
}
WINBOOL WINBOOL
STDCALL STDCALL

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#if 0
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/
#include <windows.h> #include <windows.h>
@ -475,3 +475,4 @@ LONG NC_HandleNCPaint(HWND hwnd , HRGN clip)
} }
return 0; return 0;
} }
#endif

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: prop.c,v 1.1 2002/06/13 20:36:40 dwelch Exp $ /* $Id: prop.c,v 1.2 2002/09/03 22:44:20 dwelch Exp $
* *
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c * FILE: lib/user32/windows/input.c
@ -32,95 +32,144 @@
#include <user32.h> #include <user32.h>
#include <debug.h> #include <debug.h>
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
int int STDCALL
STDCALL EnumPropsA(HWND hWnd, PROPENUMPROC lpEnumFunc)
EnumPropsA(
HWND hWnd,
PROPENUMPROC lpEnumFunc)
{ {
return 0; return 0;
} }
int int STDCALL
STDCALL EnumPropsExA(HWND hWnd, PROPENUMPROCEX lpEnumFunc, LPARAM lParam)
EnumPropsExA(
HWND hWnd,
PROPENUMPROCEX lpEnumFunc,
LPARAM lParam)
{ {
return 0; return 0;
} }
int int STDCALL
STDCALL EnumPropsExW(HWND hWnd, PROPENUMPROCEX lpEnumFunc, LPARAM lParam)
EnumPropsExW(
HWND hWnd,
PROPENUMPROCEX lpEnumFunc,
LPARAM lParam)
{ {
return 0; return 0;
} }
int int STDCALL
STDCALL EnumPropsW(HWND hWnd, PROPENUMPROC lpEnumFunc)
EnumPropsW(
HWND hWnd,
PROPENUMPROC lpEnumFunc)
{ {
return 0; return 0;
} }
HANDLE
STDCALL HANDLE STDCALL
GetPropA( GetPropA(HWND hWnd, LPCSTR lpString)
HWND hWnd,
LPCSTR lpString)
{ {
return (HANDLE)0; PWSTR lpWString;
HANDLE Ret;
if (HIWORD(lpString))
{
lpWString = User32ConvertString(lpString);
if (lpWString == NULL)
{
return(FALSE);
}
Ret = GetPropW(hWnd, lpWString);
User32FreeString(lpWString);
}
else
{
Ret = GetPropW(hWnd, lpString);
}
return(Ret);
} }
HANDLE HANDLE STDCALL
STDCALL GetPropW(HWND hWnd, LPCWSTR lpString)
GetPropW( {
HWND hWnd, ATOM Atom;
if (HIWORD(lpString))
{
Atom = GlobalFindAtomW(lpString);
}
else
{
Atom = LOWORD(lpString);
}
return(NtUserGetProp(hWnd, Atom));
}
HANDLE STDCALL
RemovePropA(HWND hWnd, LPCSTR lpString)
{
PWSTR lpWString;
HANDLE Ret;
if (HIWORD(lpString))
{
lpWString = User32ConvertString(lpString);
if (lpWString == NULL)
{
return(FALSE);
}
Ret = RemovePropW(hWnd, lpWString);
User32FreeString(lpWString);
}
else
{
Ret = RemovePropW(hWnd, lpWString);
}
return(Ret);
}
HANDLE STDCALL
RemovePropW(HWND hWnd,
LPCWSTR lpString) LPCWSTR lpString)
{ {
return (HANDLE)0; ATOM Atom;
} if (HIWORD(lpString))
HANDLE
STDCALL
RemovePropA(
HWND hWnd,
LPCSTR lpString)
{ {
return (HANDLE)0; Atom = GlobalFindAtomW(lpString);
}
else
{
Atom = LOWORD(lpString);
}
return(NtUserRemoveProp(hWnd, Atom));
} }
HANDLE WINBOOL STDCALL
STDCALL SetPropA(HWND hWnd, LPCSTR lpString, HANDLE hData)
RemovePropW(
HWND hWnd,
LPCWSTR lpString)
{ {
return (HANDLE)0; PWSTR lpWString;
BOOL Ret;
if (HIWORD(lpString))
{
lpWString = User32ConvertString(lpString);
if (lpWString == NULL)
{
return(FALSE);
} }
WINBOOL Ret = SetPropW(hWnd, lpWString, hData);
STDCALL User32FreeString(lpWString);
SetPropA( }
HWND hWnd, else
LPCSTR lpString,
HANDLE hData)
{ {
return FALSE; Ret = SetPropW(hWnd, lpString, hData);
}
return(Ret);
} }
WINBOOL WINBOOL STDCALL
STDCALL SetPropW(HWND hWnd, LPCWSTR lpString, HANDLE hData)
SetPropW(
HWND hWnd,
LPCWSTR lpString,
HANDLE hData)
{ {
return FALSE; ATOM Atom;
if (HIWORD(lpString))
{
Atom = GlobalFindAtomW(lpString);
}
else
{
Atom = LOWORD(lpString);
}
return(NtUserSetProp(hWnd, Atom, hData));
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: rect.c,v 1.6 2002/09/01 20:39:55 dwelch Exp $ /* $Id: rect.c,v 1.7 2002/09/03 22:44:20 dwelch Exp $
* *
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c * FILE: lib/user32/windows/input.c
@ -61,15 +61,24 @@ InflateRect(LPRECT rect, int dx, int dy)
return(TRUE); return(TRUE);
} }
WINBOOL WINBOOL STDCALL
STDCALL IntersectRect(LPRECT lprcDst,
IntersectRect(
LPRECT lprcDst,
CONST RECT *lprcSrc1, CONST RECT *lprcSrc1,
CONST RECT *lprcSrc2) CONST RECT *lprcSrc2)
{ {
UNIMPLEMENTED; if (IsRectEmpty(lprcSrc1) || IsRectEmpty(lprcSrc2) ||
return FALSE; lprcSrc1->left >= lprcSrc2->right ||
lprcSrc2->left >= lprcSrc1->right ||
lprcSrc1->top >= lprcSrc2->bottom ||
lprcSrc2->top >= lprcSrc1->bottom)
{
SetRectEmpty(lprcDst);
return(FALSE);
}
lprcDst->left = max(lprcSrc1->left, lprcSrc2->left);
lprcDst->right = min(lprcSrc1->right, lprcSrc2->right);
lprcDst->top = max(lprcSrc1->top, lprcSrc2->top);
lprcDst->bottom = min(lprcSrc1->bottom, lprcSrc2->bottom);
} }
WINBOOL STDCALL WINBOOL STDCALL

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.10 2002/08/31 23:18:46 dwelch Exp $ /* $Id: window.c,v 1.11 2002/09/03 22:44:20 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
@ -691,17 +691,15 @@ GetWindowRect(HWND hWnd,
} }
int STDCALL int STDCALL
GetWindowTextA(HWND hWnd, GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
LPSTR lpString,
int nMaxCount)
{ {
return 0; return(SendMessageA(hWnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString));
} }
int STDCALL int STDCALL
GetWindowTextLengthA(HWND hWnd) GetWindowTextLengthA(HWND hWnd)
{ {
return 0; return(SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0));
} }
int STDCALL int STDCALL

View file

@ -8,6 +8,13 @@
#include <include/winsta.h> #include <include/winsta.h>
#include <include/dce.h> #include <include/dce.h>
typedef struct _PROPERTY
{
LIST_ENTRY PropListEntry;
HANDLE Data;
ATOM Atom;
} PROPERTY, *PPROPERTY;
typedef struct _INTERNALPOS typedef struct _INTERNALPOS
{ {
RECT NormalRect; RECT NormalRect;
@ -75,6 +82,8 @@ typedef struct _WINDOW_OBJECT
struct _WINDOW_OBJECT* Parent; struct _WINDOW_OBJECT* Parent;
/* DC Entries (DCE) */ /* DC Entries (DCE) */
PDCE Dce; PDCE Dce;
/* Property list head.*/
LIST_ENTRY PropListHead;
} WINDOW_OBJECT, *PWINDOW_OBJECT; } WINDOW_OBJECT, *PWINDOW_OBJECT;
/* Window flags. */ /* Window flags. */

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.48 2002/08/31 23:18:46 dwelch Exp $ # $Id: makefile,v 1.49 2002/09/03 22:44:20 dwelch Exp $
PATH_TO_TOP = ../.. PATH_TO_TOP = ../..
@ -31,7 +31,7 @@ NTUSER_OBJECTS = ntuser/class.o ntuser/guicheck.o ntuser/hook.o \
ntuser/userobj.o ntuser/window.o ntuser/winsta.o \ ntuser/userobj.o ntuser/window.o ntuser/winsta.o \
ntuser/input.o ntuser/keyboard.o ntuser/callback.o \ ntuser/input.o ntuser/keyboard.o ntuser/callback.o \
ntuser/winpos.o ntuser/painting.o ntuser/metric.o \ ntuser/winpos.o ntuser/painting.o ntuser/metric.o \
ntuser/windc.o ntuser/windc.o ntuser/prop.o
OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o \ OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o \
objects/color.o objects/coord.o objects/dc.o \ objects/color.o objects/coord.o objects/dc.o \
objects/fillshap.o objects/gdiobj.o objects/icm.o \ objects/fillshap.o objects/gdiobj.o objects/icm.o \

View file

@ -1,4 +1,4 @@
/* $Id: metric.c,v 1.3 2002/09/01 20:39:56 dwelch Exp $ /* $Id: metric.c,v 1.4 2002/09/03 22:44:21 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -55,6 +55,9 @@ NtUserGetSystemMetrics(ULONG Index)
return(17); return(17);
case SM_CYCAPTION: case SM_CYCAPTION:
return(20); return(20);
case SM_CXSIZE:
case SM_CYSIZE:
return(18);
default: default:
return(0xFFFFFFFF); return(0xFFFFFFFF);
} }

View file

@ -92,18 +92,6 @@ NtUserBuildNameList(
return 0; return 0;
} }
DWORD
STDCALL
NtUserBuildPropList(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3)
{
UNIMPLEMENTED
return 0;
}
DWORD DWORD
STDCALL STDCALL
@ -1369,16 +1357,6 @@ NtUserRemoveMenu(
return 0; return 0;
} }
DWORD
STDCALL
NtUserRemoveProp(
DWORD Unknown0,
DWORD Unknown1)
{
UNIMPLEMENTED
return 0;
}
DWORD DWORD
STDCALL STDCALL
@ -1600,18 +1578,6 @@ NtUserSetParent(
return 0; return 0;
} }
DWORD
STDCALL
NtUserSetProp(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2)
{
UNIMPLEMENTED
return 0;
}
DWORD DWORD
STDCALL STDCALL
NtUserSetRipFlags( NtUserSetRipFlags(

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.14 2002/09/01 20:39:56 dwelch Exp $ /* $Id: window.c,v 1.15 2002/09/03 22:44:21 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -424,6 +424,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
InsertHeadList(&ParentWindow->ChildrenListHead, InsertHeadList(&ParentWindow->ChildrenListHead,
&WindowObject->SiblingListEntry); &WindowObject->SiblingListEntry);
InitializeListHead(&WindowObject->ChildrenListHead); InitializeListHead(&WindowObject->ChildrenListHead);
InitializeListHead(&WindowObject->PropListHead);
RtlInitUnicodeString(&WindowObject->WindowName, WindowName.Buffer); RtlInitUnicodeString(&WindowObject->WindowName, WindowName.Buffer);
RtlFreeUnicodeString(&WindowName); RtlFreeUnicodeString(&WindowName);

View file

@ -32,6 +32,12 @@ BOOL STDCALL W32kBitBlt(HDC hDCDest,
PXLATEOBJ XlateObj = NULL; PXLATEOBJ XlateObj = NULL;
HPALETTE SourcePalette, DestPalette; HPALETTE SourcePalette, DestPalette;
/* Offset the destination and source by the origin of their DCs. */
XDest += DCDest->w.DCOrgX;
YDest += DCDest->w.DCOrgY;
XSrc += DCSrc->w.DCOrgX;
YSrc += DCSrc->w.DCOrgY;
DestRect.left = XDest; DestRect.left = XDest;
DestRect.top = YDest; DestRect.top = YDest;
DestRect.right = XDest+Width; DestRect.right = XDest+Width;

View file

@ -76,7 +76,7 @@ INT STDCALL W32kSetDIBits(HDC hDC,
PPALGDI hDCPalette; PPALGDI hDCPalette;
RGBQUAD *lpRGB; RGBQUAD *lpRGB;
HPALETTE DDB_Palette, DIB_Palette; HPALETTE DDB_Palette, DIB_Palette;
USHORT DDB_Palette_Type, DIB_Palette_Type; ULONG DDB_Palette_Type, DIB_Palette_Type;
// Check parameters // Check parameters
@ -691,6 +691,7 @@ RGBQUAD *DIB_MapPaletteColors(PDC dc, LPBITMAPINFO lpbmi)
HPALETTE BuildDIBPalette(BITMAPINFO *bmi, PINT paletteType) HPALETTE BuildDIBPalette(BITMAPINFO *bmi, PINT paletteType)
{ {
BYTE bits; BYTE bits;
ULONG ColourCount;
// Determine Bits Per Pixel // Determine Bits Per Pixel
bits = bmi->bmiHeader.biBitCount; bits = bmi->bmiHeader.biBitCount;
@ -707,5 +708,15 @@ HPALETTE BuildDIBPalette(BITMAPINFO *bmi, PINT paletteType)
*paletteType = PAL_RGB; // FIXME: This could be BGR, must still check *paletteType = PAL_RGB; // FIXME: This could be BGR, must still check
} }
return EngCreatePalette(*paletteType, bmi->bmiHeader.biClrUsed, bmi->bmiColors, 0, 0, 0); if (bmi->bmiHeader.biClrUsed == 0 &&
bmi->bmiHeader.biBitCount <= 8)
{
ColourCount = 1 << bmi->bmiHeader.biBitCount;
}
else
{
ColourCount = bmi->bmiHeader.biClrUsed;
}
return EngCreatePalette(*paletteType, ColourCount, bmi->bmiColors, 0, 0, 0);
} }