* Ported listbox conrtol from WINE - it doesn't work properly yet, but registers and processes messages!

* Implemented IsChild and FreeConsole (latter is guesswork based on AllocConsole!)
* Started implementing OpenIcon (remains unfinished)
* Improved EnableWindow, IsWindowEnabled and IsZoomed
* Replaced some instances of GetWindowLong with NtUserGetWindowLong
* Added SIF_TRACKPOS to defines.h
* Added dwLocaleId to COMPAREITEMSTRUCT

svn path=/trunk/; revision=5625
This commit is contained in:
Andrew Greenwood 2003-08-17 22:45:40 +00:00
parent d9668b0a6a
commit 54a2b50917
7 changed files with 3227 additions and 66 deletions

View file

@ -1607,11 +1607,12 @@ extern "C" {
#define QS_TIMER (16)
/* GetScrollInfo, SetScrollInfo */
#define SIF_ALL (23)
#define SIF_PAGE (2)
#define SIF_POS (4)
#define SIF_RANGE (1)
#define SIF_DISABLENOSCROLL (8)
#define SIF_ALL 23
#define SIF_PAGE 2
#define SIF_POS 4
#define SIF_RANGE 1
#define SIF_DISABLENOSCROLL 8
#define SIF_TRACKPOS 16
/* GetStdHandle */
#define STD_INPUT_HANDLE (DWORD)(-10)

View file

@ -707,14 +707,16 @@ typedef struct _COMMTIMEOUTS {
} COMMTIMEOUTS,*LPCOMMTIMEOUTS;
typedef struct tagCOMPAREITEMSTRUCT {
UINT CtlType;
UINT CtlID;
HWND hwndItem;
UINT itemID1;
DWORD itemData1;
UINT itemID2;
DWORD itemData2;
} COMPAREITEMSTRUCT;
UINT CtlType;
UINT CtlID;
HWND hwndItem;
UINT itemID1;
DWORD itemData1;
UINT itemID2;
DWORD itemData2;
DWORD dwLocaleId;
} COMPAREITEMSTRUCT,*LPCOMPAREITEMSTRUCT;
typedef struct {
COLORREF crText;

View file

@ -1,4 +1,4 @@
/* $Id: console.c,v 1.65 2003/08/16 17:37:51 jimtabor Exp $
/* $Id: console.c,v 1.66 2003/08/17 22:45:40 silverblade Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -1261,12 +1261,27 @@ WINBOOL STDCALL AllocConsole(VOID)
/*--------------------------------------------------------------
* FreeConsole
*
* @unimplemented
* @implemented
*/
WINBOOL STDCALL FreeConsole(VOID)
{
DbgPrint("FreeConsole() is unimplemented\n");
return FALSE;
// AG: I'm not sure if this is correct (what happens to std handles?)
// but I just tried to reverse what AllocConsole() does...
CSRSS_API_REQUEST Request;
CSRSS_API_REPLY Reply;
NTSTATUS Status;
HANDLE hStdError;
Request.Type = CSRSS_FREE_CONSOLE;
Status = CsrClientCallServer( &Request, &Reply, sizeof( CSRSS_API_REQUEST ), sizeof( CSRSS_API_REPLY ) );
if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Reply.Status ) )
{
SetLastErrorByStatus ( Status );
return FALSE;
}
return TRUE;
}

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* $Id: regcontrol.c,v 1.10 2003/08/15 15:55:02 weiden Exp $
/* $Id: regcontrol.c,v 1.11 2003/08/17 22:45:40 silverblade Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS User32
@ -45,18 +45,18 @@ void ControlsInit(void)
{
DbgPrint("ControlsInit()\n");
RegisterBuiltinClass(&BUTTON_builtin_class);
RegisterBuiltinClass(&DIALOG_builtin_class);
RegisterBuiltinClass(&POPUPMENU_builtin_class);
#if 0
RegisterBuiltinClass(&COMBO_builtin_class);
RegisterBuiltinClass(&COMBOLBOX_builtin_class);
RegisterBuiltinClass(&DESKTOP_builtin_class);
RegisterBuiltinClass(&LISTBOX_builtin_class);
RegisterBuiltinClass(&MDICLIENT_builtin_class);
RegisterBuiltinClass(&MENU_builtin_class);
RegisterBuiltinClass(&SCROLL_builtin_class);
#endif
RegisterBuiltinClass(&BUTTON_builtin_class);
RegisterBuiltinClass(&LISTBOX_builtin_class);
RegisterBuiltinClass(&EDIT_builtin_class);
RegisterBuiltinClass(&COMBO_builtin_class);
RegisterBuiltinClass(&ICONTITLE_builtin_class);

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: input.c,v 1.12 2003/08/17 20:29:57 silverblade Exp $
/* $Id: input.c,v 1.13 2003/08/17 22:45:40 silverblade Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c
@ -78,9 +78,9 @@ WINBOOL STDCALL
EnableWindow(HWND hWnd,
WINBOOL bEnable)
{
LONG Style = GetWindowLongW(hWnd, GWL_STYLE);
LONG Style = NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE);
Style = bEnable ? Style & ~WS_DISABLED : Style | WS_DISABLED;
SetWindowLongW(hWnd, GWL_STYLE, Style);
NtUserSetWindowLong(hWnd, GWL_STYLE, Style, FALSE);
SendMessageA(hWnd, WM_ENABLE, (LPARAM) IsWindowEnabled(hWnd), 0);

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.62 2003/08/17 20:29:57 silverblade Exp $
/* $Id: window.c,v 1.63 2003/08/17 22:45:40 silverblade Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -1227,14 +1227,14 @@ GetWindowThreadProcessId(HWND hWnd,
/*
* @unimplemented
* @implemented
*/
WINBOOL STDCALL
IsChild(HWND hWndParent,
HWND hWnd)
{
UNIMPLEMENTED;
return FALSE;
// Untested
return ((HWND)NtUserGetWindowLong(hWnd, GWL_HWNDPARENT, FALSE)) == hWndParent;
}
@ -1275,15 +1275,15 @@ IsWindowUnicode(HWND hWnd)
WINBOOL STDCALL
IsWindowVisible(HWND hWnd)
{
while (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD)
while (NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_CHILD)
{
if (!(GetWindowLongW(hWnd, GWL_STYLE) & WS_VISIBLE))
if (!(NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_VISIBLE))
{
return(FALSE);
}
hWnd = GetAncestor(hWnd, GA_PARENT);
}
return(GetWindowLongW(hWnd, GWL_STYLE) & WS_VISIBLE);
return(NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_VISIBLE);
}
@ -1299,7 +1299,7 @@ IsWindowEnabled(
// disabled. I think they stop processing messages but stay appearing
// as enabled.
return (! (GetWindowLongW(hWnd, GWL_STYLE) & WS_DISABLED));
return (! (NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_DISABLED));
}
@ -1309,9 +1309,7 @@ IsWindowEnabled(
WINBOOL STDCALL
IsZoomed(HWND hWnd)
{
ULONG uStyle = GetWindowLongW(hWnd, GWL_STYLE);
return (uStyle & WS_MAXIMIZE);
return NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MAXIMIZE;
}
@ -1347,8 +1345,23 @@ MoveWindow(HWND hWnd,
WINBOOL STDCALL
OpenIcon(HWND hWnd)
{
UNIMPLEMENTED;
return FALSE;
if (! NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE)
{
// Not minimized - error?
return FALSE;
}
if (! SendMessageA(hWnd, WM_QUERYOPEN, 0, 0))
{
// Window doesn't want to be opened - error?
return FALSE;
}
// Now we need to do the actual opening of the window, which is something
// I'll leave to someone more capable :)
UNIMPLEMENTED;
return FALSE;
}