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
NtUserGetObjectInformation 5
NtUserGetOpenClipboardWindow 0
NtUserGetProp 2
NtUserGetPriorityClipboardFormat 2
NtUserGetProcessWindowStation 0
NtUserGetScrollBarInfo 3
@ -455,6 +456,7 @@ NtUserSBGetParms 4
NtUserScrollDC 7
NtUserScrollWindowEx 8
NtUserSendInput 3
NtUserSendMessage 4
NtUserSendMessageCallback 6
NtUserSendNotifyMessage 4
NtUserSetActiveWindow 1

View file

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

View file

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

View file

@ -32,11 +32,22 @@ User32ConvertString(PCSTR String)
{
ANSI_STRING InString;
UNICODE_STRING OutString;
RtlInitAnsiString(&InString, String);
RtlInitAnsiString(&InString, String);
RtlAnsiStringToUnicodeString(&OutString, &InString, TRUE);
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
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
* 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
STDCALL

View file

@ -36,6 +36,11 @@ BEGIN
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
@ -56,3 +61,5 @@ BEGIN
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
END

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* 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
* FILE: lib/user32/windows/input.c
@ -34,20 +34,230 @@
/* FUNCTIONS *****************************************************************/
HBITMAP
STDCALL
LoadBitmapA(
HINSTANCE hInstance,
LPCSTR lpBitmapName)
HANDLE STDCALL
LoadImageA(HINSTANCE hinst,
LPCSTR lpszName,
UINT uType,
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
STDCALL
LoadBitmapW(
HINSTANCE hInstance,
LPCWSTR lpBitmapName)
HANDLE STATIC
LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad)
{
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
* PROJECT: ReactOS user32.dll
@ -242,17 +242,14 @@ static void UserDrawCaptionNC( HDC hdc, RECT *rect, HWND hwnd,
char buffer[256];
if (!hbitmapClose)
{
if (!(hbitmapClose = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_CLOSE) )))
{
return;
}
hbitmapMinimize = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_REDUCE) );
hbitmapMinimizeD = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_REDUCED) );
hbitmapMaximize = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_ZOOM) );
hbitmapMaximizeD = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_ZOOMD) );
hbitmapRestore = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_RESTORE) );
hbitmapRestoreD = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_RESTORED) );
{
hbitmapClose = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_CLOSE));
hbitmapMinimize = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_REDUCE) );
hbitmapMinimizeD = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_REDUCED) );
hbitmapMaximize = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_ZOOM) );
hbitmapMaximizeD = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_ZOOMD) );
hbitmapRestore = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_RESTORE) );
hbitmapRestoreD = LoadBitmapW( 0, MAKEINTRESOURCE(OBM_RESTORED) );
}
if (GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_DLGMODALFRAME)
@ -1074,7 +1071,7 @@ DefWindowProcA(HWND hWnd,
}
return(0);
}
strncpy((PWSTR)lParam, WindowText, wParam);
strncpy(lParam, WindowText, wParam);
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
* PROJECT: ReactOS user32.dll
@ -66,6 +66,23 @@ User32FreeAsciiConvertedMessage(UINT Msg, WPARAM wParam, LPARAM lParam)
{
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:
{
CREATESTRUCTA* Cs;
@ -73,6 +90,7 @@ User32FreeAsciiConvertedMessage(UINT Msg, WPARAM wParam, LPARAM lParam)
Cs = (CREATESTRUCTA*)lParam;
RtlFreeHeap(RtlGetProcessHeap(), 0, (LPSTR)Cs->lpszName);
RtlFreeHeap(RtlGetProcessHeap(), 0, (LPSTR)Cs->lpszClass);
RtlFreeHeap(RtlGetProcessHeap(), 0, Cs);
break;
}
}
@ -90,9 +108,9 @@ User32ConvertToAsciiMessage(UINT* Msg, WPARAM* wParam, LPARAM* lParam)
UNICODE_STRING UString;
ANSI_STRING AString;
CsW = (CREATESTRUCTW*)lParam;
CsW = (CREATESTRUCTW*)(*lParam);
CsA = User32AllocHeap(sizeof(CREATESTRUCTA));
memcpy(CsW, CsA, sizeof(CREATESTRUCTW));
memcpy(CsA, CsW, sizeof(CREATESTRUCTW));
RtlInitUnicodeString(&UString, CsW->lpszName);
RtlUnicodeStringToAnsiString(&AString, &UString, TRUE);
@ -162,34 +180,59 @@ CallWindowProcW(WNDPROC lpPrevWndFunc,
}
LPMSG
MsgiAnsiToUnicodeMessage(
LPMSG AnsiMsg,
LPMSG UnicodeMsg)
BOOL
MsgiAnsiToUnicodeMessage(LPMSG UnicodeMsg, LPMSG AnsiMsg)
{
/* FIXME: Convert */
RtlMoveMemory(UnicodeMsg, AnsiMsg, sizeof(MSG));
*UnicodeMsg = *AnsiMsg;
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
STDCALL
DispatchMessageA(
CONST MSG *lpmsg)
LRESULT STDCALL
DispatchMessageA(CONST MSG *lpmsg)
{
MSG Msg;
return NtUserDispatchMessage(MsgiAnsiToUnicodeMessage((LPMSG)lpmsg, &Msg));
return(NtUserDispatchMessage(lpmsg));
}
LRESULT
STDCALL
DispatchMessageW(
CONST MSG *lpmsg)
LRESULT STDCALL
DispatchMessageW(CONST MSG *lpmsg)
{
return NtUserDispatchMessage((LPMSG)lpmsg);
return(NtUserDispatchMessage((LPMSG)lpmsg));
}
WINBOOL
@ -289,15 +332,38 @@ PostThreadMessageW(
return NtUserPostThreadMessage(idThread, Msg, wParam, lParam);
}
LRESULT
STDCALL
SendMessageA(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam)
LRESULT STDCALL
SendMessageW(HWND hWnd,
UINT Msg,
WPARAM wParam,
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
@ -367,16 +433,6 @@ SendMessageTimeoutW(
}
LRESULT
STDCALL
SendMessageW(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam)
{
return (LRESULT)0;
}
WINBOOL
STDCALL

View file

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

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* 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
* FILE: lib/user32/windows/input.c
@ -32,95 +32,144 @@
#include <user32.h>
#include <debug.h>
/* FUNCTIONS *****************************************************************/
int
STDCALL
EnumPropsA(
HWND hWnd,
PROPENUMPROC lpEnumFunc)
int STDCALL
EnumPropsA(HWND hWnd, PROPENUMPROC lpEnumFunc)
{
return 0;
}
int
STDCALL
EnumPropsExA(
HWND hWnd,
PROPENUMPROCEX lpEnumFunc,
LPARAM lParam)
int STDCALL
EnumPropsExA(HWND hWnd, PROPENUMPROCEX lpEnumFunc, LPARAM lParam)
{
return 0;
}
int
STDCALL
EnumPropsExW(
HWND hWnd,
PROPENUMPROCEX lpEnumFunc,
LPARAM lParam)
int STDCALL
EnumPropsExW(HWND hWnd, PROPENUMPROCEX lpEnumFunc, LPARAM lParam)
{
return 0;
}
int
STDCALL
EnumPropsW(
HWND hWnd,
PROPENUMPROC lpEnumFunc)
int STDCALL
EnumPropsW(HWND hWnd, PROPENUMPROC lpEnumFunc)
{
return 0;
}
HANDLE
STDCALL
GetPropA(
HWND hWnd,
LPCSTR lpString)
HANDLE STDCALL
GetPropA(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
STDCALL
GetPropW(
HWND hWnd,
LPCWSTR lpString)
HANDLE STDCALL
GetPropW(HWND hWnd, LPCWSTR lpString)
{
return (HANDLE)0;
}
HANDLE
STDCALL
RemovePropA(
HWND hWnd,
LPCSTR lpString)
{
return (HANDLE)0;
ATOM Atom;
if (HIWORD(lpString))
{
Atom = GlobalFindAtomW(lpString);
}
else
{
Atom = LOWORD(lpString);
}
return(NtUserGetProp(hWnd, Atom));
}
HANDLE
STDCALL
RemovePropW(
HWND hWnd,
LPCWSTR lpString)
HANDLE STDCALL
RemovePropA(HWND hWnd, LPCSTR lpString)
{
return (HANDLE)0;
}
WINBOOL
STDCALL
SetPropA(
HWND hWnd,
LPCSTR lpString,
HANDLE hData)
{
return FALSE;
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);
}
WINBOOL
STDCALL
SetPropW(
HWND hWnd,
LPCWSTR lpString,
HANDLE hData)
HANDLE STDCALL
RemovePropW(HWND hWnd,
LPCWSTR lpString)
{
return FALSE;
ATOM Atom;
if (HIWORD(lpString))
{
Atom = GlobalFindAtomW(lpString);
}
else
{
Atom = LOWORD(lpString);
}
return(NtUserRemoveProp(hWnd, Atom));
}
WINBOOL STDCALL
SetPropA(HWND hWnd, LPCSTR lpString, HANDLE hData)
{
PWSTR lpWString;
BOOL Ret;
if (HIWORD(lpString))
{
lpWString = User32ConvertString(lpString);
if (lpWString == NULL)
{
return(FALSE);
}
Ret = SetPropW(hWnd, lpWString, hData);
User32FreeString(lpWString);
}
else
{
Ret = SetPropW(hWnd, lpString, hData);
}
return(Ret);
}
WINBOOL STDCALL
SetPropW(HWND hWnd, LPCWSTR lpString, HANDLE hData)
{
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
* 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
* FILE: lib/user32/windows/input.c
@ -61,15 +61,24 @@ InflateRect(LPRECT rect, int dx, int dy)
return(TRUE);
}
WINBOOL
STDCALL
IntersectRect(
LPRECT lprcDst,
CONST RECT *lprcSrc1,
CONST RECT *lprcSrc2)
WINBOOL STDCALL
IntersectRect(LPRECT lprcDst,
CONST RECT *lprcSrc1,
CONST RECT *lprcSrc2)
{
UNIMPLEMENTED;
return FALSE;
if (IsRectEmpty(lprcSrc1) || IsRectEmpty(lprcSrc2) ||
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

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
* PROJECT: ReactOS user32.dll
@ -691,17 +691,15 @@ GetWindowRect(HWND hWnd,
}
int STDCALL
GetWindowTextA(HWND hWnd,
LPSTR lpString,
int nMaxCount)
GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
{
return 0;
return(SendMessageA(hWnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString));
}
int STDCALL
GetWindowTextLengthA(HWND hWnd)
{
return 0;
return(SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0));
}
int STDCALL

View file

@ -8,6 +8,13 @@
#include <include/winsta.h>
#include <include/dce.h>
typedef struct _PROPERTY
{
LIST_ENTRY PropListEntry;
HANDLE Data;
ATOM Atom;
} PROPERTY, *PPROPERTY;
typedef struct _INTERNALPOS
{
RECT NormalRect;
@ -75,6 +82,8 @@ typedef struct _WINDOW_OBJECT
struct _WINDOW_OBJECT* Parent;
/* DC Entries (DCE) */
PDCE Dce;
/* Property list head.*/
LIST_ENTRY PropListHead;
} WINDOW_OBJECT, *PWINDOW_OBJECT;
/* 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 = ../..
@ -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/input.o ntuser/keyboard.o ntuser/callback.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/color.o objects/coord.o objects/dc.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
* PROJECT: ReactOS kernel
@ -55,6 +55,9 @@ NtUserGetSystemMetrics(ULONG Index)
return(17);
case SM_CYCAPTION:
return(20);
case SM_CXSIZE:
case SM_CYSIZE:
return(18);
default:
return(0xFFFFFFFF);
}

View file

@ -92,18 +92,6 @@ NtUserBuildNameList(
return 0;
}
DWORD
STDCALL
NtUserBuildPropList(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3)
{
UNIMPLEMENTED
return 0;
}
DWORD
STDCALL
@ -1369,16 +1357,6 @@ NtUserRemoveMenu(
return 0;
}
DWORD
STDCALL
NtUserRemoveProp(
DWORD Unknown0,
DWORD Unknown1)
{
UNIMPLEMENTED
return 0;
}
DWORD
STDCALL
@ -1600,18 +1578,6 @@ NtUserSetParent(
return 0;
}
DWORD
STDCALL
NtUserSetProp(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2)
{
UNIMPLEMENTED
return 0;
}
DWORD
STDCALL
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
* PROJECT: ReactOS kernel
@ -424,6 +424,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
InsertHeadList(&ParentWindow->ChildrenListHead,
&WindowObject->SiblingListEntry);
InitializeListHead(&WindowObject->ChildrenListHead);
InitializeListHead(&WindowObject->PropListHead);
RtlInitUnicodeString(&WindowObject->WindowName, WindowName.Buffer);
RtlFreeUnicodeString(&WindowName);

View file

@ -32,6 +32,12 @@ BOOL STDCALL W32kBitBlt(HDC hDCDest,
PXLATEOBJ XlateObj = NULL;
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.top = YDest;
DestRect.right = XDest+Width;

View file

@ -76,7 +76,7 @@ INT STDCALL W32kSetDIBits(HDC hDC,
PPALGDI hDCPalette;
RGBQUAD *lpRGB;
HPALETTE DDB_Palette, DIB_Palette;
USHORT DDB_Palette_Type, DIB_Palette_Type;
ULONG DDB_Palette_Type, DIB_Palette_Type;
// Check parameters
@ -691,6 +691,7 @@ RGBQUAD *DIB_MapPaletteColors(PDC dc, LPBITMAPINFO lpbmi)
HPALETTE BuildDIBPalette(BITMAPINFO *bmi, PINT paletteType)
{
BYTE bits;
ULONG ColourCount;
// Determine Bits Per Pixel
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
}
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);
}