Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
196ec596
Commit
196ec596
authored
Sep 02, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Implement Get/SetProcessDefaultLayout.
parent
942866f9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
48 deletions
+74
-48
misc.c
dlls/user32/misc.c
+0
-48
win.c
dlls/user32/tests/win.c
+41
-0
win.c
dlls/user32/win.c
+33
-0
No files found.
dlls/user32/misc.c
View file @
196ec596
...
...
@@ -199,54 +199,6 @@ VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
}
/******************************************************************************
* GetProcessDefaultLayout [USER32.@]
*
* Gets the default layout for parentless windows.
* Right now, just returns 0 (left-to-right).
*
* RETURNS
* Success: Nonzero
* Failure: Zero
*
* BUGS
* No RTL
*/
BOOL
WINAPI
GetProcessDefaultLayout
(
DWORD
*
pdwDefaultLayout
)
{
if
(
!
pdwDefaultLayout
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
FIXME
(
"( %p ): No BiDi
\n
"
,
pdwDefaultLayout
);
*
pdwDefaultLayout
=
0
;
return
TRUE
;
}
/******************************************************************************
* SetProcessDefaultLayout [USER32.@]
*
* Sets the default layout for parentless windows.
* Right now, only accepts 0 (left-to-right).
*
* RETURNS
* Success: Nonzero
* Failure: Zero
*
* BUGS
* No RTL
*/
BOOL
WINAPI
SetProcessDefaultLayout
(
DWORD
dwDefaultLayout
)
{
if
(
dwDefaultLayout
==
0
)
return
TRUE
;
FIXME
(
"( %08x ): No BiDi
\n
"
,
dwDefaultLayout
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
}
/***********************************************************************
* SetWindowStationUser (USER32.@)
*/
...
...
dlls/user32/tests/win.c
View file @
196ec596
...
...
@@ -53,6 +53,8 @@ static BOOL (WINAPI *pGetMonitorInfoA)(HMONITOR,LPMONITORINFO);
static
HMONITOR
(
WINAPI
*
pMonitorFromPoint
)(
POINT
,
DWORD
);
static
int
(
WINAPI
*
pGetWindowRgnBox
)(
HWND
,
LPRECT
);
static
BOOL
(
WINAPI
*
pGetGUIThreadInfo
)(
DWORD
,
GUITHREADINFO
*
);
static
BOOL
(
WINAPI
*
pGetProcessDefaultLayout
)(
DWORD
*
layout
);
static
BOOL
(
WINAPI
*
pSetProcessDefaultLayout
)(
DWORD
layout
);
static
DWORD
(
WINAPI
*
pSetLayout
)(
HDC
hdc
,
DWORD
layout
);
static
DWORD
(
WINAPI
*
pGetLayout
)(
HDC
hdc
);
...
...
@@ -4853,6 +4855,43 @@ static void test_CreateWindow(void)
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
0
);
DestroyWindow
(
hwnd
);
if
(
pGetProcessDefaultLayout
&&
pSetProcessDefaultLayout
)
{
DWORD
layout
;
SetLastError
(
0xdeadbeef
);
ok
(
!
pGetProcessDefaultLayout
(
NULL
),
"GetProcessDefaultLayout succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_NOACCESS
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ok
(
pGetProcessDefaultLayout
(
&
layout
),
"GetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
layout
==
0
,
"GetProcessDefaultLayout wrong layout %x
\n
"
,
layout
);
SetLastError
(
0xdeadbeef
);
ok
(
pSetProcessDefaultLayout
(
7
),
"SetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
pGetProcessDefaultLayout
(
&
layout
),
"GetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
layout
==
7
,
"GetProcessDefaultLayout wrong layout %x
\n
"
,
layout
);
SetLastError
(
0xdeadbeef
);
ok
(
pSetProcessDefaultLayout
(
LAYOUT_RTL
),
"SetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
pGetProcessDefaultLayout
(
&
layout
),
"GetProcessDefaultLayout failed err %u
\n
"
,
GetLastError
());
ok
(
layout
==
LAYOUT_RTL
,
"GetProcessDefaultLayout wrong layout %x
\n
"
,
layout
);
hwnd
=
CreateWindowEx
(
WS_EX_APPWINDOW
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
WS_EX_APPWINDOW
|
WS_EX_LAYOUTRTL
);
DestroyWindow
(
hwnd
);
hwnd
=
CreateWindowEx
(
WS_EX_APPWINDOW
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
parent
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
expect_ex_style
(
hwnd
,
WS_EX_APPWINDOW
);
DestroyWindow
(
hwnd
);
pSetProcessDefaultLayout
(
0
);
}
else
win_skip
(
"SetProcessDefaultLayout not supported
\n
"
);
}
else
win_skip
(
"SetLayout not supported
\n
"
);
}
...
...
@@ -6086,6 +6125,8 @@ START_TEST(win)
pMonitorFromPoint
=
(
void
*
)
GetProcAddress
(
user32
,
"MonitorFromPoint"
);
pGetWindowRgnBox
=
(
void
*
)
GetProcAddress
(
user32
,
"GetWindowRgnBox"
);
pGetGUIThreadInfo
=
(
void
*
)
GetProcAddress
(
user32
,
"GetGUIThreadInfo"
);
pGetProcessDefaultLayout
=
(
void
*
)
GetProcAddress
(
user32
,
"GetProcessDefaultLayout"
);
pSetProcessDefaultLayout
=
(
void
*
)
GetProcAddress
(
user32
,
"SetProcessDefaultLayout"
);
pGetLayout
=
(
void
*
)
GetProcAddress
(
gdi32
,
"GetLayout"
);
pSetLayout
=
(
void
*
)
GetProcAddress
(
gdi32
,
"SetLayout"
);
...
...
dlls/user32/win.c
View file @
196ec596
...
...
@@ -40,6 +40,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(win);
#define NB_USER_HANDLES ((LAST_USER_HANDLE - FIRST_USER_HANDLE + 1) >> 1)
#define USER_HANDLE_TO_INDEX(hwnd) ((LOWORD(hwnd) - FIRST_USER_HANDLE) >> 1)
static
DWORD
process_layout
;
/**********************************************************************/
/* helper for Get/SetWindowLong */
...
...
@@ -1199,6 +1201,7 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
if
(
className
!=
(
LPCWSTR
)
DESKTOP_CLASS_ATOM
&&
(
IS_INTRESOURCE
(
className
)
||
strcmpiW
(
className
,
messageW
)))
parent
=
GetDesktopWindow
();
if
(
process_layout
&
LAYOUT_RTL
)
cs
->
dwExStyle
|=
WS_EX_LAYOUTRTL
;
}
WIN_FixCoordinates
(
cs
,
&
sw
);
/* fix default coordinates */
...
...
@@ -3484,6 +3487,36 @@ BOOL WINAPI UpdateLayeredWindow( HWND hwnd, HDC hdcDst, POINT *pptDst, SIZE *psi
return
UpdateLayeredWindowIndirect
(
hwnd
,
&
info
);
}
/******************************************************************************
* GetProcessDefaultLayout [USER32.@]
*
* Gets the default layout for parentless windows.
*/
BOOL
WINAPI
GetProcessDefaultLayout
(
DWORD
*
layout
)
{
if
(
!
layout
)
{
SetLastError
(
ERROR_NOACCESS
);
return
FALSE
;
}
*
layout
=
process_layout
;
return
TRUE
;
}
/******************************************************************************
* SetProcessDefaultLayout [USER32.@]
*
* Sets the default layout for parentless windows.
*/
BOOL
WINAPI
SetProcessDefaultLayout
(
DWORD
layout
)
{
process_layout
=
layout
;
return
TRUE
;
}
/* 64bit versions */
#ifdef GetWindowLongPtrW
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment