Implemented InternalGetWindowText() partially

svn path=/trunk/; revision=5550
This commit is contained in:
Thomas Bluemel 2003-08-12 22:27:55 +00:00
parent 2a4b68c022
commit a6e48e9704
3 changed files with 69 additions and 11 deletions

View file

@ -914,9 +914,9 @@ NtUserInitTask(
DWORD
STDCALL
NtUserInternalGetWindowText(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2);
HWND hWnd,
LPWSTR lpString,
int nMaxCount);
DWORD
STDCALL

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.56 2003/08/11 19:09:53 gdalsnes Exp $
/* $Id: window.c,v 1.57 2003/08/12 22:27:55 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -14,6 +14,7 @@
#include <windows.h>
#include <user32.h>
#include <window.h>
#include <string.h>
#include <user32/callback.h>
#include <user32/regcontrol.h>
@ -1584,4 +1585,36 @@ GetWindowContextHelpId(HWND hwnd)
return(0);
}
/*
* @implemented
*/
DWORD
STDCALL
InternalGetWindowText(HWND hWnd, LPWSTR lpString, int nMaxCount)
{
DWORD res = 0;
LPWSTR lps = NULL;
if(lpString && (nMaxCount > 0))
{
lps = RtlAllocateHeap(RtlGetProcessHeap(), 0, nMaxCount * sizeof(WCHAR));
if(!lps)
{
SetLastError(ERROR_OUTOFMEMORY);
return 0;
}
}
res = NtUserInternalGetWindowText(hWnd, lps, nMaxCount);
if(lps)
{
RtlCopyMemory(lpString, lps, res * sizeof(WCHAR));
lpString[res] = (WCHAR)"\0"; /* null-terminate the string */
RtlFreeHeap(RtlGetProcessHeap(), 0, lps);
}
return res;
}
/* EOF */

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: window.c,v 1.87 2003/08/11 21:10:49 royce Exp $
/* $Id: window.c,v 1.88 2003/08/12 22:27:55 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -1483,13 +1483,38 @@ NtUserGetWindowPlacement(DWORD Unknown0,
}
DWORD STDCALL
NtUserInternalGetWindowText(DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2)
NtUserInternalGetWindowText(HWND hWnd,
LPWSTR lpString,
int nMaxCount)
{
UNIMPLEMENTED
return 0;
DWORD res = 0;
PWINDOW_OBJECT WindowObject;
HANDLE Atom;
W32kAcquireWinLockShared(); /* ??? */
WindowObject = W32kGetWindowObject(hWnd);
if(!WindowObject)
{
W32kReleaseWinLock(); /* ??? */
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return 0;
}
if(lpString)
{
/* FIXME - Window text is currently stored
in the Atom 'USER32!WindowTextAtomA' */
}
else
{
/* FIXME - return length of window text */
}
W32kReleaseWindowObject(WindowObject);
W32kReleaseWinLock(); /* ??? */
return res;
}
DWORD STDCALL