Basic implementation of CopyImage and FindWidowExA.

svn path=/trunk/; revision=6903
This commit is contained in:
Filip Navara 2003-12-07 18:54:15 +00:00
parent 11eed94164
commit 62acb5b575
3 changed files with 62 additions and 22 deletions

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.53 2003/11/19 13:19:39 weiden Exp $
/* $Id: stubs.c,v 1.54 2003/12/07 18:54:15 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -94,23 +94,6 @@ BroadcastSystemMessageW(
}
/*
* @unimplemented
*/
HANDLE
STDCALL
CopyImage(
HANDLE hImage,
UINT uType,
int cxDesired,
int cyDesired,
UINT fuFlags)
{
UNIMPLEMENTED;
return (HANDLE)0;
}
/*
* @unimplemented
*/

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.20 2003/11/18 19:59:50 weiden Exp $
/* $Id: bitmap.c,v 1.21 2003/12/07 18:54:15 navaraf Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c
@ -657,3 +657,38 @@ LoadBitmapW(HINSTANCE hInstance, LPCWSTR lpBitmapName)
{
return(LoadImageW(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0, 0));
}
/*
* @implemented
*/
HANDLE WINAPI
CopyImage(HANDLE hnd, UINT type, INT desiredx, INT desiredy, UINT flags)
{
switch (type)
{
case IMAGE_BITMAP:
{
HBITMAP res;
BITMAP bm;
if (!GetObjectW(hnd, sizeof(bm), &bm)) return 0;
bm.bmBits = NULL;
if ((res = CreateBitmapIndirect(&bm)))
{
char *buf = HeapAlloc(GetProcessHeap(), 0, bm.bmWidthBytes * bm.bmHeight);
GetBitmapBits(hnd, bm.bmWidthBytes * bm.bmHeight, buf);
SetBitmapBits(res, bm.bmWidthBytes * bm.bmHeight, buf);
HeapFree(GetProcessHeap(), 0, buf);
}
return (HICON)res;
}
case IMAGE_ICON:
DbgPrint("FIXME: CopyImage doesn't support IMAGE_ICON correctly!\n");
return CopyIcon(hnd);
case IMAGE_CURSOR:
DbgPrint("FIXME: CopyImage doesn't support IMAGE_CURSOR correctly!\n");
return CopyCursor(hnd);
}
return 0;
}

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.83 2003/11/30 20:03:47 navaraf Exp $
/* $Id: window.c,v 1.84 2003/12/07 18:54:15 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -843,8 +843,30 @@ FindWindowExA(HWND hwndParent,
LPCSTR lpszClass,
LPCSTR lpszWindow)
{
UNIMPLEMENTED;
return (HWND)0;
UNICODE_STRING ucClassName;
UNICODE_STRING ucWindowName;
HWND Result;
if (IS_ATOM(lpszClass))
{
ucClassName.Buffer = (LPWSTR)lpszClass;
ucClassName.Length = 0;
}
else
{
RtlCreateUnicodeStringFromAsciiz(&ucClassName, (LPSTR)lpszClass);
}
RtlCreateUnicodeStringFromAsciiz(&ucWindowName, (LPSTR)lpszWindow);
Result = NtUserFindWindowEx(hwndParent, hwndChildAfter, &ucClassName,
&ucWindowName);
if (!IS_ATOM(lpszClass))
RtlFreeUnicodeString(&ucClassName);
RtlFreeUnicodeString(&ucWindowName);
return Result;
}