mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 21:56:06 +00:00
- Update user32_winetest to Wine-23052006. Update includes changes in the following subtests: edit, winstation. Evereything else is just compilation
svn path=/trunk/; revision=21991
This commit is contained in:
parent
9eda943d76
commit
f2725683f8
4 changed files with 6 additions and 148 deletions
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <assert.h>
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
#include "wine/test.h"
|
||||
|
@ -277,9 +278,7 @@ static void ET2_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
|
|||
static LRESULT CALLBACK ET2_WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (iMsg) {
|
||||
case WM_COMMAND:
|
||||
ET2_OnCommand(hwnd, LOWORD(wParam), (HWND)lParam, HIWORD(wParam));
|
||||
break;
|
||||
HANDLE_MSG(hwnd, WM_COMMAND, ET2_OnCommand);
|
||||
}
|
||||
return DefWindowProc(hwnd, iMsg, wParam, lParam);
|
||||
}
|
||||
|
@ -760,106 +759,8 @@ static void test_margins(void)
|
|||
ok(new_rect.right == old_rect.right, "The right border of the rectangle has changed\n");
|
||||
ok(new_rect.top == old_rect.top, "The top border of the rectangle has changed\n");
|
||||
ok(new_rect.bottom == old_rect.bottom, "The bottom border of the rectangle has changed\n");
|
||||
|
||||
DestroyWindow (hwEdit);
|
||||
}
|
||||
|
||||
static INT CALLBACK find_font_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void test_margins_font_change(void)
|
||||
{
|
||||
HWND hwEdit;
|
||||
DWORD margins, font_margins;
|
||||
LOGFONT lf;
|
||||
HFONT hfont, hfont2;
|
||||
HDC hdc = GetDC(0);
|
||||
|
||||
if(EnumFontFamiliesA(hdc, "Arial", find_font_proc, 0))
|
||||
{
|
||||
trace("Arial not found - skipping font change margin tests\n");
|
||||
ReleaseDC(0, hdc);
|
||||
return;
|
||||
}
|
||||
ReleaseDC(0, hdc);
|
||||
|
||||
hwEdit = create_child_editcontrol(0, 0);
|
||||
|
||||
SetWindowPos(hwEdit, NULL, 10, 10, 1000, 100, SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
|
||||
memset(&lf, 0, sizeof(lf));
|
||||
strcpy(lf.lfFaceName, "Arial");
|
||||
lf.lfHeight = 16;
|
||||
lf.lfCharSet = DEFAULT_CHARSET;
|
||||
hfont = CreateFontIndirectA(&lf);
|
||||
lf.lfHeight = 30;
|
||||
hfont2 = CreateFontIndirectA(&lf);
|
||||
|
||||
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
|
||||
font_margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
|
||||
ok(LOWORD(font_margins) != 0, "got %d\n", LOWORD(font_margins));
|
||||
ok(HIWORD(font_margins) != 0, "got %d\n", HIWORD(font_margins));
|
||||
|
||||
/* With 'small' edit controls, test that the margin doesn't get set */
|
||||
SetWindowPos(hwEdit, NULL, 10, 10, 16, 100, SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0,0));
|
||||
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
|
||||
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
|
||||
ok(LOWORD(margins) == 0, "got %d\n", LOWORD(margins));
|
||||
ok(HIWORD(margins) == 0, "got %d\n", HIWORD(margins));
|
||||
|
||||
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,0));
|
||||
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
|
||||
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
|
||||
ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins));
|
||||
ok(HIWORD(margins) == 0, "got %d\n", HIWORD(margins));
|
||||
|
||||
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,1));
|
||||
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
|
||||
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
|
||||
ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins));
|
||||
ok(HIWORD(margins) == 1, "got %d\n", HIWORD(margins));
|
||||
|
||||
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO,EC_USEFONTINFO));
|
||||
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
|
||||
ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins));
|
||||
ok(HIWORD(margins) == 1, "got %d\n", HIWORD(margins));
|
||||
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont2, 0);
|
||||
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
|
||||
ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins));
|
||||
ok(HIWORD(margins) == 1, "got %d\n", HIWORD(margins));
|
||||
|
||||
/* Above a certain size threshold then the margin is updated */
|
||||
SetWindowPos(hwEdit, NULL, 10, 10, 1000, 100, SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,0));
|
||||
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
|
||||
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
|
||||
ok(LOWORD(margins) == LOWORD(font_margins), "got %d\n", LOWORD(margins));
|
||||
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
|
||||
|
||||
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,1));
|
||||
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
|
||||
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
|
||||
ok(LOWORD(margins) == LOWORD(font_margins), "got %d\n", LOWORD(margins));
|
||||
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
|
||||
|
||||
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO,EC_USEFONTINFO));
|
||||
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
|
||||
ok(LOWORD(margins) == LOWORD(font_margins), "got %d\n", LOWORD(margins));
|
||||
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
|
||||
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont2, 0);
|
||||
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
|
||||
ok(LOWORD(margins) != LOWORD(font_margins), "got %d\n", LOWORD(margins));
|
||||
ok(HIWORD(margins) != HIWORD(font_margins), "got %d\n", HIWORD(margins));
|
||||
|
||||
SendMessageA(hwEdit, WM_SETFONT, 0, 0);
|
||||
|
||||
DeleteObject(hfont2);
|
||||
DeleteObject(hfont);
|
||||
destroy_child_editcontrol(hwEdit);
|
||||
|
||||
DestroyWindow (hwEdit);
|
||||
}
|
||||
|
||||
#define edit_pos_ok(exp, got, txt) \
|
||||
|
@ -1066,8 +967,7 @@ START_TEST(edit)
|
|||
test_edit_control_4();
|
||||
test_edit_control_5();
|
||||
test_margins();
|
||||
test_margins_font_change();
|
||||
test_text_position();
|
||||
|
||||
|
||||
UnregisterWindowClasses();
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "windows.h"
|
||||
#include "windef.h"
|
||||
|
||||
#include "wine/test.h"
|
||||
|
||||
|
|
|
@ -2316,7 +2316,6 @@ static void test_keyboard_input(HWND hwnd)
|
|||
|
||||
ShowWindow(hwnd, SW_SHOW);
|
||||
UpdateWindow(hwnd);
|
||||
flush_events();
|
||||
|
||||
ok(GetActiveWindow() == hwnd, "wrong active window %p\n", GetActiveWindow());
|
||||
|
||||
|
|
|
@ -42,29 +42,12 @@ static void print_object( HANDLE obj )
|
|||
trace( "obj %p type '%s'\n", obj, buffer );
|
||||
}
|
||||
|
||||
static void register_class(void)
|
||||
{
|
||||
WNDCLASSA cls;
|
||||
|
||||
cls.style = CS_DBLCLKS;
|
||||
cls.lpfnWndProc = DefWindowProcA;
|
||||
cls.cbClsExtra = 0;
|
||||
cls.cbWndExtra = 0;
|
||||
cls.hInstance = GetModuleHandleA(0);
|
||||
cls.hIcon = 0;
|
||||
cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
|
||||
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
|
||||
cls.lpszMenuName = NULL;
|
||||
cls.lpszClassName = "WinStationClass";
|
||||
RegisterClassA(&cls);
|
||||
}
|
||||
|
||||
static HDESK initial_desktop;
|
||||
|
||||
static DWORD CALLBACK thread( LPVOID arg )
|
||||
{
|
||||
HDESK d1, d2;
|
||||
HWND hwnd = CreateWindowExA(0,"WinStationClass","test",WS_POPUP,0,0,100,100,GetDesktopWindow(),0,0,0);
|
||||
HWND hwnd = CreateWindowExA(0,"BUTTON","test",WS_POPUP,0,0,100,100,GetDesktopWindow(),0,0,0);
|
||||
ok( hwnd != 0, "CreateWindow failed\n" );
|
||||
d1 = GetThreadDesktop(GetCurrentThreadId());
|
||||
trace( "thread %p desktop: %p\n", arg, d1 );
|
||||
|
@ -106,8 +89,6 @@ static void test_handles(void)
|
|||
HDESK d1, d2, d3;
|
||||
HANDLE hthread;
|
||||
DWORD id, flags;
|
||||
ATOM atom;
|
||||
char buffer[20];
|
||||
|
||||
/* win stations */
|
||||
|
||||
|
@ -163,28 +144,6 @@ static void test_handles(void)
|
|||
w3 = OpenWindowStation("foobar", TRUE, WINSTA_ALL_ACCESS );
|
||||
ok( !w3, "open foobar station succeeded\n" );
|
||||
|
||||
w2 = CreateWindowStation("foobar1", 0, WINSTA_ALL_ACCESS, NULL );
|
||||
ok( w2 != 0, "create foobar station failed\n" );
|
||||
w3 = CreateWindowStation("foobar2", 0, WINSTA_ALL_ACCESS, NULL );
|
||||
ok( w3 != 0, "create foobar station failed\n" );
|
||||
ok( GetHandleInformation( w2, &flags ), "GetHandleInformation failed\n" );
|
||||
ok( GetHandleInformation( w3, &flags ), "GetHandleInformation failed\n" );
|
||||
|
||||
SetProcessWindowStation( w2 );
|
||||
register_class();
|
||||
atom = GlobalAddAtomA("foo");
|
||||
ok( GlobalGetAtomNameA( atom, buffer, sizeof(buffer) ) == 3, "GlobalGetAtomName failed\n" );
|
||||
ok( !lstrcmpiA( buffer, "foo" ), "bad atom value %s\n", buffer );
|
||||
|
||||
ok( !CloseWindowStation( w2 ), "CloseWindowStation succeeded\n" );
|
||||
ok( GetHandleInformation( w2, &flags ), "GetHandleInformation failed\n" );
|
||||
|
||||
SetProcessWindowStation( w3 );
|
||||
ok( GetHandleInformation( w2, &flags ), "GetHandleInformation failed\n" );
|
||||
ok( CloseWindowStation( w2 ), "CloseWindowStation failed\n" );
|
||||
ok( GlobalGetAtomNameA( atom, buffer, sizeof(buffer) ) == 3, "GlobalGetAtomName failed\n" );
|
||||
ok( !lstrcmpiA( buffer, "foo" ), "bad atom value %s\n", buffer );
|
||||
|
||||
/* desktops */
|
||||
d1 = GetThreadDesktop(GetCurrentThreadId());
|
||||
initial_desktop = d1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue