ReactOS 0.4.16-dev-329-g9223134
winpos.c File Reference
#include <user32.h>
Include dependency graph for winpos.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
void mirror_rect (const RECT *window_rect, RECT *rect)
 
HWND WINAPI GetActiveWindow (VOID)
 
UINT WINAPI ArrangeIconicWindows (HWND hWnd)
 
HWND WINAPI WindowFromPoint (POINT Point)
 
int WINAPI MapWindowPoints (HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints)
 
BOOL WINAPI ScreenToClient (HWND hWnd, LPPOINT lpPoint)
 
BOOL WINAPI ClientToScreen (HWND hWnd, LPPOINT lpPoint)
 

Function Documentation

◆ ArrangeIconicWindows()

UINT WINAPI ArrangeIconicWindows ( HWND  hWnd)

Definition at line 148 of file winpos.c.

149{
151}
HWND hWnd
Definition: settings.c:17
EXTINLINE UINT NtUserxArrangeIconicWindows(HWND hWnd)
Definition: ntwrapper.h:768

◆ ClientToScreen()

BOOL WINAPI ClientToScreen ( HWND  hWnd,
LPPOINT  lpPoint 
)

Definition at line 263 of file winpos.c.

264{
265 PWND Wnd;
266 /* Note: Desktop Top and Left is always 0! */
267 Wnd = ValidateHwnd(hWnd);
268 if (!Wnd)
269 return FALSE;
270
271 if ( hWnd != GetDesktopWindow()) // Wnd->fnid != FNID_DESKTOP )
272 {
273 if (Wnd->ExStyle & WS_EX_LAYOUTRTL)
274 lpPoint->x = Wnd->rcClient.right - lpPoint->x;
275 else
276 lpPoint->x += Wnd->rcClient.left;
277 lpPoint->y += Wnd->rcClient.top;
278 }
279 return TRUE;
280}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
Definition: ntuser.h:694
DWORD ExStyle
Definition: ntuser.h:704
RECT rcClient
Definition: ntuser.h:717
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628

◆ GetActiveWindow()

◆ MapWindowPoints()

int WINAPI MapWindowPoints ( HWND  hWndFrom,
HWND  hWndTo,
LPPOINT  lpPoints,
UINT  cPoints 
)

Definition at line 168 of file winpos.c.

169{
170 PWND FromWnd = NULL, ToWnd = NULL;
171 BOOL mirror_from, mirror_to;
172 POINT Delta;
173 UINT i;
174 int Change = 1;
175
176 if (hWndFrom)
177 {
178 FromWnd = ValidateHwnd(hWndFrom);
179 if (!FromWnd)
180 return 0;
181 }
182 if (hWndTo)
183 {
184 ToWnd = ValidateHwnd(hWndTo);
185 if (!ToWnd)
186 return 0;
187 }
188
189 /* Note: Desktop Top and Left is always 0! */
190 Delta.x = Delta.y = 0;
191 mirror_from = mirror_to = FALSE;
192
193 if (FromWnd && hWndFrom != GetDesktopWindow()) // FromWnd->fnid != FNID_DESKTOP)
194 {
195 if (FromWnd->ExStyle & WS_EX_LAYOUTRTL)
196 {
197 mirror_from = TRUE;
198 Change = -Change;
199 Delta.x = -FromWnd->rcClient.right;
200 }
201 else
202 Delta.x = FromWnd->rcClient.left;
203 Delta.y = FromWnd->rcClient.top;
204 }
205
206 if (ToWnd && hWndTo != GetDesktopWindow()) // ToWnd->fnid != FNID_DESKTOP)
207 {
208 if (ToWnd->ExStyle & WS_EX_LAYOUTRTL)
209 {
210 mirror_to = TRUE;
211 Change = -Change;
212 Delta.x += Change * ToWnd->rcClient.right;
213 }
214 else
215 Delta.x -= Change * ToWnd->rcClient.left;
216 Delta.y -= ToWnd->rcClient.top;
217 }
218
219 for (i = 0; i != cPoints; i++)
220 {
221 lpPoints[i].x += Delta.x;
222 lpPoints[i].x *= Change;
223 lpPoints[i].y += Delta.y;
224 }
225
226 if ((mirror_from || mirror_to) && cPoints == 2) /* special case for rectangle */
227 {
228 int tmp = min(lpPoints[0].x, lpPoints[1].x);
229 lpPoints[1].x = max(lpPoints[0].x, lpPoints[1].x);
230 lpPoints[0].x = tmp;
231 }
232
233 return MAKELONG(LOWORD(Delta.x), LOWORD(Delta.y));
234}
#define NULL
Definition: types.h:112
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define max(a, b)
Definition: svc.c:63
#define MAKELONG(a, b)
Definition: typedefs.h:249
static ULONG Delta
Definition: xboxvideo.c:33

◆ mirror_rect()

void mirror_rect ( const RECT window_rect,
RECT rect 
)

Definition at line 15 of file winpos.c.

16{
17 int width = window_rect->right - window_rect->left;
18 int tmp = rect->left;
19 rect->left = width - rect->right;
20 rect->right = width - tmp;
21}
GLint GLint GLsizei width
Definition: gl.h:1546
& rect
Definition: startmenu.cpp:1413

◆ ScreenToClient()

BOOL WINAPI ScreenToClient ( HWND  hWnd,
LPPOINT  lpPoint 
)

Definition at line 240 of file winpos.c.

241{
242 PWND Wnd;
243 /* Note: Desktop Top and Left is always 0! */
244 Wnd = ValidateHwnd(hWnd);
245 if (!Wnd)
246 return FALSE;
247
248 if (hWnd != GetDesktopWindow()) // Wnd->fnid != FNID_DESKTOP )
249 {
250 if (Wnd->ExStyle & WS_EX_LAYOUTRTL)
251 lpPoint->x = Wnd->rcClient.right - lpPoint->x;
252 else
253 lpPoint->x -= Wnd->rcClient.left;
254 lpPoint->y -= Wnd->rcClient.top;
255 }
256 return TRUE;
257}

◆ WindowFromPoint()

HWND WINAPI WindowFromPoint ( POINT  Point)

Definition at line 157 of file winpos.c.

158{
159 //TODO: Determine what the actual parameters to
160 // NtUserWindowFromPoint are.
162}
HWND NTAPI NtUserWindowFromPoint(LONG X, LONG Y)
Definition: winpos.c:3847

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )