ReactOS 0.4.16-dev-816-g135a9a9
win.c File Reference
#include "ntstatus.h"
#include "user_private.h"
#include "controls.h"
#include "winver.h"
#include "wine/asm.h"
#include "wine/exception.h"
#include "wine/debug.h"
Include dependency graph for win.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define DUMPED_STYLES
 
#define DUMPED_EX_STYLES
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (win)
 
static LRESULT enum_callback_wrapper (WNDENUMPROC proc, HWND hwnd, LPARAM lparam)
 
static BOOL enum_windows (HDESK desktop, HWND hwnd, DWORD tid, BOOL children, WNDENUMPROC proc, LPARAM param)
 
BOOL is_desktop_window (HWND hwnd)
 
static BOOL is_broadcast (HWND hwnd)
 
HWND WIN_IsCurrentProcess (HWND hwnd)
 
HWND WIN_IsCurrentThread (HWND hwnd)
 
HWND WIN_GetFullHandle (HWND hwnd)
 
ULONG WIN_SetStyle (HWND hwnd, ULONG set_bits, ULONG clear_bits)
 
static void dump_window_styles (DWORD style, DWORD exstyle)
 
static BOOL is_default_coord (int x)
 
HWND WIN_CreateWindowEx (CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, BOOL unicode)
 
HWND WINAPI DECLSPEC_HOTPATCH CreateWindowExA (DWORD exStyle, LPCSTR className, LPCSTR windowName, DWORD style, INT x, INT y, INT width, INT height, HWND parent, HMENU menu, HINSTANCE instance, LPVOID data)
 
HWND WINAPI DECLSPEC_HOTPATCH CreateWindowExW (DWORD exStyle, LPCWSTR className, LPCWSTR windowName, DWORD style, INT x, INT y, INT width, INT height, HWND parent, HMENU menu, HINSTANCE instance, LPVOID data)
 
BOOL WINAPI CloseWindow (HWND hwnd)
 
BOOL WINAPI OpenIcon (HWND hwnd)
 
HWND WINAPI FindWindowExW (HWND parent, HWND child, const WCHAR *class, const WCHAR *title)
 
HWND WINAPI FindWindowA (LPCSTR className, LPCSTR title)
 
HWND WINAPI FindWindowExA (HWND parent, HWND child, LPCSTR className, LPCSTR title)
 
HWND WINAPI FindWindowW (LPCWSTR className, LPCWSTR title)
 
HWND WINAPI GetDesktopWindow (void)
 
BOOL WINAPI EnableWindow (HWND hwnd, BOOL enable)
 
BOOL WINAPI IsWindowEnabled (HWND hwnd)
 
BOOL WINAPI IsWindowUnicode (HWND hwnd)
 
DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext (HWND hwnd)
 
DPI_AWARENESS_CONTEXT WINAPI GetDpiAwarenessContextForProcess (HANDLE process)
 
DPI_HOSTING_BEHAVIOR WINAPI GetWindowDpiHostingBehavior (HWND hwnd)
 
static LONG_PTR get_window_long_ptr (HWND hwnd, int offset, LONG_PTR ret, BOOL ansi)
 
static LONG_PTR set_dialog_proc (HWND hwnd, LONG_PTR newval, BOOL ansi)
 
UINT WINAPI GetDpiForWindow (HWND hwnd)
 
void WINAPI SwitchToThisWindow (HWND hwnd, BOOL alt_tab)
 
BOOL WINAPI GetWindowRect (HWND hwnd, RECT *rect)
 
int WINAPI GetWindowRgn (HWND hwnd, HRGN hrgn)
 
int WINAPI GetWindowRgnBox (HWND hwnd, RECT *rect)
 
BOOL WINAPI GetClientRect (HWND hwnd, RECT *rect)
 
HWND WINAPI WindowFromPoint (POINT pt)
 
HWND WINAPI ChildWindowFromPoint (HWND parent, POINT pt)
 
HWND WINAPI RealChildWindowFromPoint (HWND parent, POINT pt)
 
HWND WINAPI ChildWindowFromPointEx (HWND parent, POINT pt, UINT flags)
 
INT WINAPI MapWindowPoints (HWND hwnd_from, HWND hwnd_to, POINT *points, UINT count)
 
BOOL WINAPI ClientToScreen (HWND hwnd, POINT *pt)
 
BOOL WINAPI ScreenToClient (HWND hwnd, POINT *pt)
 
BOOL WINAPI IsIconic (HWND hwnd)
 
BOOL WINAPI IsZoomed (HWND hwnd)
 
BOOL WINAPI AllowSetForegroundWindow (DWORD procid)
 
BOOL WINAPI LockSetForegroundWindow (UINT lockcode)
 
BOOL WINAPI BringWindowToTop (HWND hwnd)
 
BOOL WINAPI AnimateWindow (HWND hwnd, DWORD time, DWORD flags)
 
HDWP WINAPI BeginDeferWindowPos (INT count)
 
HDWP WINAPI DeferWindowPos (HDWP hdwp, HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags)
 
BOOL WINAPI EndDeferWindowPos (HDWP hdwp)
 
UINT WINAPI ArrangeIconicWindows (HWND parent)
 
WORD WINAPI GetWindowWord (HWND hwnd, INT offset)
 
LONG WINAPI DECLSPEC_HOTPATCH GetWindowLongA (HWND hwnd, INT offset)
 
LONG WINAPI GetWindowLongW (HWND hwnd, INT offset)
 
LONG WINAPI DECLSPEC_HOTPATCH SetWindowLongA (HWND hwnd, INT offset, LONG newval)
 
LONG WINAPI DECLSPEC_HOTPATCH SetWindowLongW (HWND hwnd, INT offset, LONG newval)
 
INT WINAPI GetWindowTextA (HWND hwnd, LPSTR lpString, INT nMaxCount)
 
INT WINAPI GetWindowTextW (HWND hwnd, LPWSTR lpString, INT nMaxCount)
 
BOOL WINAPI DECLSPEC_HOTPATCH SetWindowTextA (HWND hwnd, LPCSTR lpString)
 
BOOL WINAPI DECLSPEC_HOTPATCH SetWindowTextW (HWND hwnd, LPCWSTR lpString)
 
INT WINAPI GetWindowTextLengthA (HWND hwnd)
 
INT WINAPI GetWindowTextLengthW (HWND hwnd)
 
BOOL WINAPI IsWindow (HWND hwnd)
 
DWORD WINAPI GetWindowThreadProcessId (HWND hwnd, LPDWORD process)
 
HWND WINAPI GetParent (HWND hwnd)
 
BOOL WINAPI IsChild (HWND parent, HWND child)
 
BOOL WINAPI IsWindowVisible (HWND hwnd)
 
HWND WINAPI GetTopWindow (HWND hwnd)
 
HWND WINAPI GetWindow (HWND hwnd, UINT rel)
 
BOOL WINAPI ShowOwnedPopups (HWND owner, BOOL show)
 
HWND WINAPI GetLastActivePopup (HWND hwnd)
 
HWNDWIN_ListChildren (HWND hwnd)
 
BOOL WINAPI EnumWindows (WNDENUMPROC lpEnumFunc, LPARAM lParam)
 
BOOL WINAPI EnumThreadWindows (DWORD id, WNDENUMPROC func, LPARAM lParam)
 
BOOL WINAPI EnumDesktopWindows (HDESK desktop, WNDENUMPROC func, LPARAM lparam)
 
BOOL WINAPI EnumChildWindows (HWND parent, WNDENUMPROC func, LPARAM lParam)
 
BOOL WINAPI AnyPopup (void)
 
BOOL WINAPI FlashWindow (HWND hWnd, BOOL bInvert)
 
DWORD WINAPI GetWindowContextHelpId (HWND hwnd)
 
BOOL WINAPI SetWindowContextHelpId (HWND hwnd, DWORD id)
 
BOOL WINAPI DragDetect (HWND hwnd, POINT pt)
 
UINT WINAPI GetWindowModuleFileNameA (HWND hwnd, LPSTR module, UINT size)
 
UINT WINAPI GetWindowModuleFileNameW (HWND hwnd, LPWSTR module, UINT size)
 
BOOL WINAPI DECLSPEC_HOTPATCH GetWindowInfo (HWND hwnd, WINDOWINFO *info)
 
BOOL WINAPI UpdateLayeredWindowIndirect (HWND hwnd, const UPDATELAYEREDWINDOWINFO *info)
 
BOOL WINAPI UpdateLayeredWindow (HWND hwnd, HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD flags)
 
BOOL WINAPI GetProcessDefaultLayout (DWORD *layout)
 
BOOL WINAPI SetProcessDefaultLayout (DWORD layout)
 
BOOL WINAPI UpdateWindow (HWND hwnd)
 
BOOL WINAPI ValidateRgn (HWND hwnd, HRGN hrgn)
 
BOOL WINAPI ScrollWindow (HWND hwnd, INT dx, INT dy, const RECT *rect, const RECT *clip_rect)
 
BOOL WINAPI GetWindowDisplayAffinity (HWND hwnd, DWORD *affinity)
 
BOOL WINAPI SetWindowDisplayAffinity (HWND hwnd, DWORD affinity)
 
BOOL WINAPI SetWindowCompositionAttribute (HWND hwnd, void *data)
 

Macro Definition Documentation

◆ DUMPED_EX_STYLES

#define DUMPED_EX_STYLES
Value:
#define DWORD
Definition: nt_native.h:44
#define WS_EX_NOPARENTNOTIFY
Definition: pedump.c:646
#define WS_EX_ACCEPTFILES
Definition: pedump.c:648
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define WS_EX_TRANSPARENT
Definition: pedump.c:649
#define WS_EX_DRAGDETECT
Definition: undocuser.h:21
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
#define WS_EX_STATICEDGE
Definition: winuser.h:403
#define WS_EX_COMPOSITED
Definition: winuser.h:385
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
#define WS_EX_NOACTIVATE
Definition: winuser.h:395
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define WS_EX_MDICHILD
Definition: winuser.h:394
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define WS_EX_LAYERED
Definition: winuser.h:389
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define WS_EX_LEFTSCROLLBAR
Definition: winuser.h:392
#define WS_EX_CONTEXTHELP
Definition: winuser.h:386
#define WS_EX_RTLREADING
Definition: winuser.h:402
#define WS_EX_NOINHERITLAYOUT
Definition: winuser.h:396
#define WS_EX_RIGHT
Definition: winuser.h:400

◆ DUMPED_STYLES

#define DUMPED_STYLES
Value:
((DWORD)(WS_POPUP | \
#define WS_CHILD
Definition: pedump.c:617
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
#define WS_MAXIMIZE
Definition: pedump.c:623
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_SYSMENU
Definition: pedump.c:629
#define WS_BORDER
Definition: pedump.c:625
#define WS_POPUP
Definition: pedump.c:616
#define WS_GROUP
Definition: pedump.c:633
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_MINIMIZE
Definition: pedump.c:622
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_DISABLED
Definition: pedump.c:621
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_HSCROLL
Definition: pedump.c:628
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define WS_MINIMIZEBOX
Definition: pedump.c:631
#define WS_THICKFRAME
Definition: pedump.c:630

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 31 of file win.c.

Function Documentation

◆ AllowSetForegroundWindow()

BOOL WINAPI AllowSetForegroundWindow ( DWORD  procid)

Definition at line 831 of file win.c.

832{
833 /* FIXME: If Win98/2000 style SetForegroundWindow behavior is
834 * implemented, then fix this function. */
835 return TRUE;
836}
#define TRUE
Definition: types.h:120

◆ AnimateWindow()

BOOL WINAPI AnimateWindow ( HWND  hwnd,
DWORD  time,
DWORD  flags 
)

Definition at line 862 of file win.c.

863{
864 FIXME( "partial stub\n" );
865
866 /* If trying to show/hide and it's already shown/hidden or invalid window,
867 * fail with invalid parameter. */
868 if (!IsWindow( hwnd ) || (!(flags & AW_HIDE)) == IsWindowVisible( hwnd ))
869 {
871 return FALSE;
872 }
873
874 NtUserShowWindow( hwnd, (flags & AW_HIDE) ? SW_HIDE : ((flags & AW_ACTIVATE) ? SW_SHOW : SW_SHOWNA) );
875 return TRUE;
876}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
GLbitfield flags
Definition: glext.h:7161
BOOL NTAPI NtUserShowWindow(HWND hWnd, LONG nCmdShow)
Definition: winpos.c:3821
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define SW_HIDE
Definition: winuser.h:771
#define SW_SHOWNA
Definition: winuser.h:781
#define SW_SHOW
Definition: winuser.h:778
BOOL WINAPI IsWindowVisible(_In_ HWND)

◆ AnyPopup()

BOOL WINAPI AnyPopup ( void  )

Definition at line 1397 of file win.c.

1398{
1399 int i;
1400 BOOL retvalue;
1402
1403 if (!list) return FALSE;
1404 for (i = 0; list[i]; i++)
1405 {
1406 if (IsWindowVisible( list[i] ) && GetWindow( list[i], GW_OWNER )) break;
1407 }
1408 retvalue = (list[i] != 0);
1409 HeapFree( GetProcessHeap(), 0, list );
1410 return retvalue;
1411}
Definition: list.h:37
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
unsigned int BOOL
Definition: ntddk_ex.h:94
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
HWND * WIN_ListChildren(HWND hwnd)
Definition: win.c:1337
#define GW_OWNER
Definition: winuser.h:769
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)

◆ ArrangeIconicWindows()

UINT WINAPI ArrangeIconicWindows ( HWND  parent)

Definition at line 910 of file win.c.

911{
912 return NtUserArrangeIconicWindows( parent );
913}
r parent
Definition: btrfs.c:3010

◆ BeginDeferWindowPos()

HDWP WINAPI BeginDeferWindowPos ( INT  count)

Definition at line 882 of file win.c.

883{
884 return NtUserBeginDeferWindowPos( count );
885}
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ BringWindowToTop()

BOOL WINAPI BringWindowToTop ( HWND  hwnd)

Definition at line 853 of file win.c.

854{
855 return NtUserSetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
856}
BOOL NTAPI NtUserSetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags)
Definition: winpos.c:3533
#define SWP_NOMOVE
Definition: winuser.h:1247
#define SWP_NOSIZE
Definition: winuser.h:1248
#define HWND_TOP
Definition: winuser.h:1210

Referenced by SwitchToThisWindow().

◆ ChildWindowFromPoint()

HWND WINAPI ChildWindowFromPoint ( HWND  parent,
POINT  pt 
)

Definition at line 760 of file win.c.

761{
763}
#define pt(x, y)
Definition: drawing.c:79
HWND NTAPI NtUserChildWindowFromPointEx(HWND Parent, LONG x, LONG y, UINT Flags)
Definition: winpos.c:3252
#define CWP_ALL
Definition: winuser.h:207

◆ ChildWindowFromPointEx()

HWND WINAPI ChildWindowFromPointEx ( HWND  parent,
POINT  pt,
UINT  flags 
)

Definition at line 776 of file win.c.

777{
779}

◆ ClientToScreen()

BOOL WINAPI ClientToScreen ( HWND  hwnd,
POINT pt 
)

Definition at line 795 of file win.c.

796{
797 return NtUserClientToScreen( hwnd, pt );
798}

◆ CloseWindow()

BOOL WINAPI CloseWindow ( HWND  hwnd)

Definition at line 494 of file win.c.

495{
496 if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD) return FALSE;
498 return TRUE;
499}
#define SW_MINIMIZE
Definition: winuser.h:779
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define GWL_STYLE
Definition: winuser.h:855

◆ CreateWindowExA()

HWND WINAPI DECLSPEC_HOTPATCH CreateWindowExA ( DWORD  exStyle,
LPCSTR  className,
LPCSTR  windowName,
DWORD  style,
INT  x,
INT  y,
INT  width,
INT  height,
HWND  parent,
HMENU  menu,
HINSTANCE  instance,
LPVOID  data 
)

Definition at line 429 of file win.c.

434{
436
437 cs.lpCreateParams = data;
438 cs.hInstance = instance;
439 cs.hMenu = menu;
440 cs.hwndParent = parent;
441 cs.x = x;
442 cs.y = y;
443 cs.cx = width;
444 cs.cy = height;
445 cs.style = style;
446 cs.lpszName = windowName;
447 cs.lpszClass = className;
448 cs.dwExStyle = exStyle;
449
450 if (!IS_INTRESOURCE(className))
451 {
452 WCHAR bufferW[256];
453 if (!MultiByteToWideChar( CP_ACP, 0, className, -1, bufferW, ARRAY_SIZE( bufferW )))
454 return 0;
455 return wow_handlers.create_window( (CREATESTRUCTW *)&cs, bufferW, instance, FALSE );
456 }
457 /* Note: we rely on the fact that CREATESTRUCTA and */
458 /* CREATESTRUCTW have the same layout. */
459 return wow_handlers.create_window( (CREATESTRUCTW *)&cs, (LPCWSTR)className, instance, FALSE );
460}
Arabic default style
Definition: afstyles.h:94
#define ARRAY_SIZE(A)
Definition: main.h:20
static HINSTANCE instance
Definition: main.c:40
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
#define cs
Definition: i386-dis.c:442
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ CreateWindowExW()

HWND WINAPI DECLSPEC_HOTPATCH CreateWindowExW ( DWORD  exStyle,
LPCWSTR  className,
LPCWSTR  windowName,
DWORD  style,
INT  x,
INT  y,
INT  width,
INT  height,
HWND  parent,
HMENU  menu,
HINSTANCE  instance,
LPVOID  data 
)

Definition at line 466 of file win.c.

471{
473
474 cs.lpCreateParams = data;
475 cs.hInstance = instance;
476 cs.hMenu = menu;
477 cs.hwndParent = parent;
478 cs.x = x;
479 cs.y = y;
480 cs.cx = width;
481 cs.cy = height;
482 cs.style = style;
483 cs.lpszName = windowName;
484 cs.lpszClass = className;
485 cs.dwExStyle = exStyle;
486
487 return wow_handlers.create_window( &cs, className, instance, TRUE );
488}

◆ DeferWindowPos()

HDWP WINAPI DeferWindowPos ( HDWP  hdwp,
HWND  hwnd,
HWND  after,
INT  x,
INT  y,
INT  cx,
INT  cy,
UINT  flags 
)

Definition at line 891 of file win.c.

893{
894 return NtUserDeferWindowPosAndBand( hdwp, hwnd, after, x, y, cx, cy, flags, 0, 0 );
895}
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
__inline int after(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2395

◆ DragDetect()

BOOL WINAPI DragDetect ( HWND  hwnd,
POINT  pt 
)

Definition at line 1451 of file win.c.

1452{
1453 return NtUserDragDetect( hwnd, pt.x, pt.y );
1454}
BOOL NTAPI NtUserDragDetect(HWND hWnd, POINT pt)
Definition: message.c:2209

◆ dump_window_styles()

static void dump_window_styles ( DWORD  style,
DWORD  exstyle 
)
static

Definition at line 176 of file win.c.

177{
178 TRACE( "style:" );
179 if(style & WS_POPUP) TRACE(" WS_POPUP");
180 if(style & WS_CHILD) TRACE(" WS_CHILD");
181 if(style & WS_MINIMIZE) TRACE(" WS_MINIMIZE");
182 if(style & WS_VISIBLE) TRACE(" WS_VISIBLE");
183 if(style & WS_DISABLED) TRACE(" WS_DISABLED");
184 if(style & WS_CLIPSIBLINGS) TRACE(" WS_CLIPSIBLINGS");
185 if(style & WS_CLIPCHILDREN) TRACE(" WS_CLIPCHILDREN");
186 if(style & WS_MAXIMIZE) TRACE(" WS_MAXIMIZE");
187 if((style & WS_CAPTION) == WS_CAPTION) TRACE(" WS_CAPTION");
188 else
189 {
190 if(style & WS_BORDER) TRACE(" WS_BORDER");
191 if(style & WS_DLGFRAME) TRACE(" WS_DLGFRAME");
192 }
193 if(style & WS_VSCROLL) TRACE(" WS_VSCROLL");
194 if(style & WS_HSCROLL) TRACE(" WS_HSCROLL");
195 if(style & WS_SYSMENU) TRACE(" WS_SYSMENU");
196 if(style & WS_THICKFRAME) TRACE(" WS_THICKFRAME");
197 if (style & WS_CHILD)
198 {
199 if(style & WS_GROUP) TRACE(" WS_GROUP");
200 if(style & WS_TABSTOP) TRACE(" WS_TABSTOP");
201 }
202 else
203 {
204 if(style & WS_MINIMIZEBOX) TRACE(" WS_MINIMIZEBOX");
205 if(style & WS_MAXIMIZEBOX) TRACE(" WS_MAXIMIZEBOX");
206 }
207
208 /* FIXME: Add dumping of BS_/ES_/SBS_/LBS_/CBS_/DS_/etc. styles */
209#define DUMPED_STYLES \
210 ((DWORD)(WS_POPUP | \
211 WS_CHILD | \
212 WS_MINIMIZE | \
213 WS_VISIBLE | \
214 WS_DISABLED | \
215 WS_CLIPSIBLINGS | \
216 WS_CLIPCHILDREN | \
217 WS_MAXIMIZE | \
218 WS_BORDER | \
219 WS_DLGFRAME | \
220 WS_VSCROLL | \
221 WS_HSCROLL | \
222 WS_SYSMENU | \
223 WS_THICKFRAME | \
224 WS_GROUP | \
225 WS_TABSTOP | \
226 WS_MINIMIZEBOX | \
227 WS_MAXIMIZEBOX))
228
229 if(style & ~DUMPED_STYLES) TRACE(" %08lx", style & ~DUMPED_STYLES);
230 TRACE("\n");
231#undef DUMPED_STYLES
232
233 TRACE( "exstyle:" );
234 if(exstyle & WS_EX_DLGMODALFRAME) TRACE(" WS_EX_DLGMODALFRAME");
235 if(exstyle & WS_EX_DRAGDETECT) TRACE(" WS_EX_DRAGDETECT");
236 if(exstyle & WS_EX_NOPARENTNOTIFY) TRACE(" WS_EX_NOPARENTNOTIFY");
237 if(exstyle & WS_EX_TOPMOST) TRACE(" WS_EX_TOPMOST");
238 if(exstyle & WS_EX_ACCEPTFILES) TRACE(" WS_EX_ACCEPTFILES");
239 if(exstyle & WS_EX_TRANSPARENT) TRACE(" WS_EX_TRANSPARENT");
240 if(exstyle & WS_EX_MDICHILD) TRACE(" WS_EX_MDICHILD");
241 if(exstyle & WS_EX_TOOLWINDOW) TRACE(" WS_EX_TOOLWINDOW");
242 if(exstyle & WS_EX_WINDOWEDGE) TRACE(" WS_EX_WINDOWEDGE");
243 if(exstyle & WS_EX_CLIENTEDGE) TRACE(" WS_EX_CLIENTEDGE");
244 if(exstyle & WS_EX_CONTEXTHELP) TRACE(" WS_EX_CONTEXTHELP");
245 if(exstyle & WS_EX_RIGHT) TRACE(" WS_EX_RIGHT");
246 if(exstyle & WS_EX_RTLREADING) TRACE(" WS_EX_RTLREADING");
247 if(exstyle & WS_EX_LEFTSCROLLBAR) TRACE(" WS_EX_LEFTSCROLLBAR");
248 if(exstyle & WS_EX_CONTROLPARENT) TRACE(" WS_EX_CONTROLPARENT");
249 if(exstyle & WS_EX_STATICEDGE) TRACE(" WS_EX_STATICEDGE");
250 if(exstyle & WS_EX_APPWINDOW) TRACE(" WS_EX_APPWINDOW");
251 if(exstyle & WS_EX_LAYERED) TRACE(" WS_EX_LAYERED");
252 if(exstyle & WS_EX_NOINHERITLAYOUT) TRACE(" WS_EX_NOINHERITLAYOUT");
253 if(exstyle & WS_EX_LAYOUTRTL) TRACE(" WS_EX_LAYOUTRTL");
254 if(exstyle & WS_EX_COMPOSITED) TRACE(" WS_EX_COMPOSITED");
255 if(exstyle & WS_EX_NOACTIVATE) TRACE(" WS_EX_NOACTIVATE");
256
257#define DUMPED_EX_STYLES \
258 ((DWORD)(WS_EX_DLGMODALFRAME | \
259 WS_EX_DRAGDETECT | \
260 WS_EX_NOPARENTNOTIFY | \
261 WS_EX_TOPMOST | \
262 WS_EX_ACCEPTFILES | \
263 WS_EX_TRANSPARENT | \
264 WS_EX_MDICHILD | \
265 WS_EX_TOOLWINDOW | \
266 WS_EX_WINDOWEDGE | \
267 WS_EX_CLIENTEDGE | \
268 WS_EX_CONTEXTHELP | \
269 WS_EX_RIGHT | \
270 WS_EX_RTLREADING | \
271 WS_EX_LEFTSCROLLBAR | \
272 WS_EX_CONTROLPARENT | \
273 WS_EX_STATICEDGE | \
274 WS_EX_APPWINDOW | \
275 WS_EX_LAYERED | \
276 WS_EX_NOINHERITLAYOUT | \
277 WS_EX_LAYOUTRTL | \
278 WS_EX_COMPOSITED |\
279 WS_EX_NOACTIVATE))
280
281 if(exstyle & ~DUMPED_EX_STYLES) TRACE(" %08lx", exstyle & ~DUMPED_EX_STYLES);
282 TRACE("\n");
283#undef DUMPED_EX_STYLES
284}
#define WS_CAPTION
Definition: pedump.c:624
#define TRACE(s)
Definition: solgame.cpp:4
#define DUMPED_EX_STYLES
#define DUMPED_STYLES

Referenced by WIN_CreateWindowEx().

◆ EnableWindow()

BOOL WINAPI EnableWindow ( HWND  hwnd,
BOOL  enable 
)

Definition at line 604 of file win.c.

605{
606 return NtUserEnableWindow( hwnd, enable );
607}
GLboolean enable
Definition: glext.h:11120

◆ EndDeferWindowPos()

BOOL WINAPI EndDeferWindowPos ( HDWP  hdwp)

Definition at line 901 of file win.c.

902{
903 return NtUserEndDeferWindowPosEx( hdwp, FALSE );
904}
BOOL NTAPI NtUserEndDeferWindowPosEx(HDWP WinPosInfo, BOOL bAsync)
Definition: winpos.c:3273

◆ enum_callback_wrapper()

static LRESULT enum_callback_wrapper ( WNDENUMPROC  proc,
HWND  hwnd,
LPARAM  lparam 
)
inlinestatic

Definition at line 62 of file win.c.

63{
64 return proc( hwnd, lparam );
65}
@ lparam
Definition: SystemMenu.c:31
static HANDLE proc()
Definition: pdb.c:34

◆ enum_windows()

static BOOL enum_windows ( HDESK  desktop,
HWND  hwnd,
DWORD  tid,
BOOL  children,
WNDENUMPROC  proc,
LPARAM  param 
)
static

Definition at line 71 of file win.c.

73{
74 HWND *list;
75 ULONG i, size = 128;
76 BOOL ret = !children; /* EnumChildWindows returns FALSE on empty list, the others TRUE */
78
79 for (;;)
80 {
81 if (!(list = HeapAlloc( GetProcessHeap(), 0, size * sizeof(HWND) ))) return FALSE;
82 status = NtUserBuildHwndList( desktop, hwnd, children, TRUE, tid, size, list, &size );
83 if (!status) break;
86 }
87 for (i = 0; i < size && list[i] != HWND_BOTTOM; i++)
88 {
89 if (!IsWindow( list[i] )) continue;
90 if (!(ret = enum_callback_wrapper( proc, list[i], param ))) break;
91 }
93 return ret;
94}
LONG NTSTATUS
Definition: precomp.h:26
#define enum_callback_wrapper(callback, instance, ref)
Definition: dinput_main.c:455
#define HeapAlloc
Definition: compat.h:733
GLsizeiptr size
Definition: glext.h:5919
GLfloat param
Definition: glext.h:5796
NTSTATUS NTAPI NtUserBuildHwndList(HDESK hDesktop, HWND hwndParent, BOOLEAN bChildren, ULONG dwThreadId, ULONG cHwnd, HWND *phwndList, ULONG *pcHwndNeeded)
Definition: window.c:1521
static TfClientId tid
#define list
Definition: rosglue.h:35
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
Definition: ps.c:97
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define HWND_BOTTOM
Definition: winuser.h:1208

Referenced by EnumChildWindows(), EnumDesktopWindows(), EnumThreadWindows(), and EnumWindows().

◆ EnumChildWindows()

BOOL WINAPI EnumChildWindows ( HWND  parent,
WNDENUMPROC  func,
LPARAM  lParam 
)

Definition at line 1388 of file win.c.

1389{
1390 return enum_windows( 0, parent, 0, TRUE, func, lParam );
1391}
LPARAM lParam
Definition: combotst.c:139
GLenum func
Definition: glext.h:6028
static BOOL enum_windows(HDESK desktop, HWND hwnd, DWORD tid, BOOL children, WNDENUMPROC proc, LPARAM param)
Definition: win.c:71

◆ EnumDesktopWindows()

BOOL WINAPI EnumDesktopWindows ( HDESK  desktop,
WNDENUMPROC  func,
LPARAM  lparam 
)

Definition at line 1379 of file win.c.

1380{
1381 return enum_windows( desktop, 0, 0, FALSE, func, lparam );
1382}

◆ EnumThreadWindows()

BOOL WINAPI EnumThreadWindows ( DWORD  id,
WNDENUMPROC  func,
LPARAM  lParam 
)

Definition at line 1370 of file win.c.

1371{
1372 return enum_windows( 0, 0, id, FALSE, func, lParam );
1373}

◆ EnumWindows()

BOOL WINAPI EnumWindows ( WNDENUMPROC  lpEnumFunc,
LPARAM  lParam 
)

Definition at line 1361 of file win.c.

1362{
1363 return enum_windows( 0, 0, 0, FALSE, lpEnumFunc, lParam );
1364}

◆ FindWindowA()

HWND WINAPI FindWindowA ( LPCSTR  className,
LPCSTR  title 
)

Definition at line 541 of file win.c.

542{
543 HWND ret = FindWindowExA( 0, 0, className, title );
545 return ret;
546}
static char title[]
Definition: ps.c:92
#define ERROR_CANNOT_FIND_WND_CLASS
Definition: winerror.h:888
HWND WINAPI FindWindowExA(_In_opt_ HWND, _In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR)

◆ FindWindowExA()

HWND WINAPI FindWindowExA ( HWND  parent,
HWND  child,
LPCSTR  className,
LPCSTR  title 
)

Definition at line 552 of file win.c.

553{
555 HWND hwnd = 0;
556
557 if (title)
558 {
559 DWORD len = MultiByteToWideChar( CP_ACP, 0, title, -1, NULL, 0 );
560 if (!(titleW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return 0;
562 }
563
564 if (!IS_INTRESOURCE(className))
565 {
566 WCHAR classW[256];
567 if (MultiByteToWideChar( CP_ACP, 0, className, -1, classW, ARRAY_SIZE( classW )))
569 }
570 else
571 {
572 hwnd = FindWindowExW( parent, child, (LPCWSTR)className, titleW );
573 }
574
576 return hwnd;
577}
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
static const WCHAR titleW[]
Definition: htmlelem.c:1067
static HWND child
Definition: cursoricon.c:298
static const WCHAR classW[]
Definition: lex.c:40
HWND WINAPI FindWindowExW(HWND parent, HWND child, const WCHAR *class, const WCHAR *title)
Definition: win.c:516
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ FindWindowExW()

HWND WINAPI FindWindowExW ( HWND  parent,
HWND  child,
const WCHAR class,
const WCHAR title 
)

Definition at line 516 of file win.c.

517{
518 UNICODE_STRING class_str, title_str;
519
520 if (title) RtlInitUnicodeString( &title_str, title );
521
522 if (class)
523 {
524 if (IS_INTRESOURCE(class))
525 {
526 class_str.Buffer = (WCHAR *)class;
527 class_str.Length = class_str.MaximumLength = 0;
528 }
529 else RtlInitUnicodeString( &class_str, class );
530 }
531
532 return NtUserFindWindowEx( parent, child, class ? &class_str : NULL,
533 title ? &title_str : NULL, 0 );
534}
HWND NTAPI NtUserFindWindowEx(HWND hwndParent, HWND hwndChildAfter, PUNICODE_STRING ucClassName, PUNICODE_STRING ucWindowName, DWORD dwUnknown)
Definition: window.c:3146
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
USHORT MaximumLength
Definition: env_spec_w32.h:370

Referenced by FindWindowExA(), and FindWindowW().

◆ FindWindowW()

HWND WINAPI FindWindowW ( LPCWSTR  className,
LPCWSTR  title 
)

Definition at line 583 of file win.c.

584{
585 return FindWindowExW( 0, 0, className, title );
586}

◆ FlashWindow()

BOOL WINAPI FlashWindow ( HWND  hWnd,
BOOL  bInvert 
)

Definition at line 1417 of file win.c.

1418{
1419 FLASHWINFO finfo;
1420
1421 finfo.cbSize = sizeof(FLASHWINFO);
1422 finfo.dwFlags = bInvert ? FLASHW_ALL : FLASHW_STOP;
1423 finfo.uCount = 1;
1424 finfo.dwTimeout = 0;
1425 finfo.hwnd = hWnd;
1426 return NtUserFlashWindowEx( &finfo );
1427}
HWND hWnd
Definition: settings.c:17
BOOL NTAPI NtUserFlashWindowEx(IN PFLASHWINFO pfwi)
Definition: painting.c:1752
static BOOL bInvert
Definition: win.c:51

◆ get_window_long_ptr()

static LONG_PTR get_window_long_ptr ( HWND  hwnd,
int  offset,
LONG_PTR  ret,
BOOL  ansi 
)
static

Definition at line 653 of file win.c.

654{
655 if (offset == DWLP_DLGPROC && NtUserGetDialogInfo( hwnd ))
656 {
657 DLGPROC proc = NtUserGetDialogProc( (DLGPROC)ret, ansi );
658 if (proc && proc != WINPROC_PROC16) return (LONG_PTR)proc;
659 }
660 return ret;
661}
#define DLGPROC
Definition: maze.c:62
GLintptr offset
Definition: glext.h:5920
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static UINT WPARAM LPARAM BOOL ansi
Definition: misc.c:135
#define DWLP_DLGPROC
Definition: winuser.h:874

Referenced by GetWindowLongA(), and GetWindowLongW().

◆ GetClientRect()

BOOL WINAPI GetClientRect ( HWND  hwnd,
RECT rect 
)

Definition at line 741 of file win.c.

742{
743 UINT dpi = NTUSER_DPI_CONTEXT_GET_DPI( (UINT_PTR)GetThreadDpiAwarenessContext() );
744 return NtUserGetClientRect( hwnd, rect, dpi );
745}
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
& rect
Definition: startmenu.cpp:1413
#define dpi
Definition: sysparams.c:23

◆ GetDesktopWindow()

HWND WINAPI GetDesktopWindow ( void  )

Definition at line 592 of file win.c.

593{
594 struct ntuser_thread_info *thread_info = NtUserGetThreadInfo();
595
596 if (thread_info->top_window) return UlongToHandle( thread_info->top_window );
597 return NtUserGetDesktopWindow();
598}
#define UlongToHandle(ul)
Definition: basetsd.h:97

Referenced by _tWinMain(), AnyPopup(), Window::AppBar_SetSide(), BackupWindowsPosProc(), CDimmedWindow::Capture(), CascadeWindows(), CenterWindow(), ClientToScreen(), clipboard_thread(), CommDlgProc(), create_dde_server(), create_dde_window(), create_directdraw(), create_parent(), create_parent_window(), createParentWindow(), DATETIME_LButtonDown(), ddraw_attach_d3d_device(), ddraw_set_swapchain_window(), DIALOG_CreateIndirect(), DIALOG_FindMsgDestination(), DlgProc(), do_wait_idle_child(), doWinMain(), DSoundRender_create(), explorer_main(), get_hwnd(), GetClientRect(), GetTopWindow(), GetWindowRect(), GUIDisplayLockedNotice(), GUIDisplaySASNotice(), GUILockedSAS(), GUILoggedOnSAS(), GUILoggedOutSAS(), HandleShutdown(), IDirectInputDevice2WImpl_SetCooperativeLevel(), ImageList_DragEnter(), ImageList_DragLeave(), init_nscontainer(), IntBroadcastSystemMessage(), IntGetWindowLong(), IsDialogMessageW(), IShellBrowserImpl_GetWindow(), IsThereAnyEffectiveWindow(), MapWindowPoints(), MCIAVI_mciWhere(), MCICDA_Play(), MCIQTZ_mciWhere(), CTrayWindow::MinimizeAll(), CZipExtract::CExtractSettingsPage::OnSetActive(), OnTimer(), CNotifyToolbar::OnTooltipShow(), OnTrayInitDialog(), CMenuDeskBar::Popup(), queue_event(), Run(), running_on_visible_desktop(), ScreenToClient(), set_clipboard_thread(), shellbrowser_GetWindow(), ShowStatusMessageThread(), SlideWindow(), START_TEST(), StartupWindowThread(), SysMouseWImpl_Acquire(), test_bad_control_class(), test_buttons(), test_clipboard_viewers(), test_ClipboardOwner(), test_create_window(), test_CreateWindow(), test_CShellMenu_with_DeskBar(), test_custom_default_button(), test_data_handles(), test_deferwindowpos(), test_DeleteDC(), test_DestroyWindow(), test_dialog_parent(), test_disableowner(), test_dpi_mapping(), test_dpi_window(), test_fullscreen(), test_GetRandomRgn(), test_gettext(), test_GetWindowModuleFileName(), test_hwnd_message(), test_ImmThreads(), test_InternetErrorDlg(), test_IsWindowUnicode(), test_killfocus(), test_marshal_HWND(), test_mdi(), test_mdi_messages(), test_messages(), test_nopage(), Test_OneParamRoutine_MapDesktopObject(), Test_OneParamRoutine_WindowFromDC(), test_paint_messages(), test_parent_owner(), test_PrintDlgExW(), test_PSM_ADDPAGE(), test_PSM_INSERTPAGE(), test_RunControlPanel(), test_SetFocus(), test_SetForegroundWindow(), test_SetParent(), test_SetWindowPos(), test_title(), test_token_security_descriptor(), test_wiznavigation(), ThemePreWindowProc(), thread(), TileWindows(), TREEVIEW_CreateDragImage(), UManStartDlg(), WinMain(), WINTRUST_CertVerify(), WINTRUST_DefaultVerify(), WndProc(), and wWinMain().

◆ GetDpiAwarenessContextForProcess()

DPI_AWARENESS_CONTEXT WINAPI GetDpiAwarenessContextForProcess ( HANDLE  process)

Definition at line 638 of file win.c.

639{
640 return LongToHandle( NtUserGetProcessDpiAwarenessContext( process ) );
641}
#define LongToHandle(h)
Definition: basetsd.h:82

◆ GetDpiForWindow()

UINT WINAPI GetDpiForWindow ( HWND  hwnd)

Definition at line 679 of file win.c.

680{
681 return NtUserGetDpiForWindow( hwnd );
682}

◆ GetLastActivePopup()

HWND WINAPI GetLastActivePopup ( HWND  hwnd)

Definition at line 1325 of file win.c.

1326{
1327 return NtUserGetLastActivePopup( hwnd );
1328}

◆ GetParent()

HWND WINAPI GetParent ( HWND  hwnd)

Definition at line 1270 of file win.c.

1271{
1272 return NtUserGetParent( hwnd );
1273}

◆ GetProcessDefaultLayout()

BOOL WINAPI GetProcessDefaultLayout ( DWORD layout)

Definition at line 1554 of file win.c.

1555{
1556 if (!layout)
1557 {
1559 return FALSE;
1560 }
1561 *layout = NtUserGetProcessDefaultLayout();
1562 if (*layout == ~0u)
1563 {
1565 DWORD i, version_layout = 0;
1566 UINT len;
1567 DWORD user_lang = GetUserDefaultLangID();
1568 DWORD *languages;
1569 void *data = NULL;
1570
1572 if (!(len = GetFileVersionInfoSizeW( buffer, NULL ))) goto done;
1573 if (!(data = HeapAlloc( GetProcessHeap(), 0, len ))) goto done;
1574 if (!GetFileVersionInfoW( buffer, 0, len, data )) goto done;
1575 if (!VerQueryValueW( data, L"\\VarFileInfo\\Translation", (void **)&languages, &len ) || !len) goto done;
1576
1577 len /= sizeof(DWORD);
1578 for (i = 0; i < len; i++) if (LOWORD(languages[i]) == user_lang) break;
1579 if (i == len) /* try neutral language */
1580 for (i = 0; i < len; i++)
1581 if (LOWORD(languages[i]) == MAKELANGID( PRIMARYLANGID(user_lang), SUBLANG_NEUTRAL )) break;
1582 if (i == len) i = 0; /* default to the first one */
1583
1584 swprintf( buffer, ARRAY_SIZE(buffer), L"\\StringFileInfo\\%04x%04x\\FileDescription",
1585 LOWORD(languages[i]), HIWORD(languages[i]) );
1586 if (!VerQueryValueW( data, buffer, (void **)&str, &len )) goto done;
1587 TRACE( "found description %s\n", debugstr_w( str ));
1588 if (str[0] == 0x200e && str[1] == 0x200e) version_layout = LAYOUT_RTL;
1589
1590 done:
1591 HeapFree( GetProcessHeap(), 0, data );
1592 NtUserSetProcessDefaultLayout( *layout = version_layout );
1593 }
1594 return TRUE;
1595}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1177
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1057
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611
#define swprintf
Definition: precomp.h:40
GLuint buffer
Definition: glext.h:5915
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 * u
Definition: glfuncs.h:240
#define debugstr_w
Definition: kernel32.h:32
static DWORD layout
Definition: win.c:53
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
const WCHAR * str
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_NEUTRAL
Definition: nls.h:167
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define HIWORD(l)
Definition: typedefs.h:247
#define ERROR_NOACCESS
Definition: winerror.h:578
#define LAYOUT_RTL
Definition: wingdi.h:1371

◆ GetTopWindow()

HWND WINAPI GetTopWindow ( HWND  hwnd)

Definition at line 1297 of file win.c.

1298{
1299 if (!hwnd) hwnd = GetDesktopWindow();
1300 return GetWindow( hwnd, GW_CHILD );
1301}
#define GW_CHILD
Definition: winuser.h:766

◆ GetWindow()

HWND WINAPI GetWindow ( HWND  hwnd,
UINT  rel 
)

Definition at line 1307 of file win.c.

1308{
1309 return NtUserGetWindowRelative( hwnd, rel );
1310}

◆ GetWindowContextHelpId()

DWORD WINAPI GetWindowContextHelpId ( HWND  hwnd)

Definition at line 1433 of file win.c.

1434{
1435 return NtUserGetWindowContextHelpId( hwnd );
1436}

◆ GetWindowDisplayAffinity()

BOOL WINAPI GetWindowDisplayAffinity ( HWND  hwnd,
DWORD affinity 
)

Definition at line 1704 of file win.c.

1705{
1706 FIXME("(%p, %p): stub\n", hwnd, affinity);
1707
1708 if (!hwnd || !affinity)
1709 {
1711 return FALSE;
1712 }
1713
1714 *affinity = WDA_NONE;
1715 return TRUE;
1716}
KAFFINITY affinity
Definition: wave.h:2
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881
#define WDA_NONE
Definition: winuser.h:3410

◆ GetWindowDpiAwarenessContext()

DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext ( HWND  hwnd)

Definition at line 630 of file win.c.

631{
632 return LongToHandle( NtUserGetWindowDpiAwarenessContext( hwnd ) );
633}

◆ GetWindowDpiHostingBehavior()

DPI_HOSTING_BEHAVIOR WINAPI GetWindowDpiHostingBehavior ( HWND  hwnd)

Definition at line 646 of file win.c.

647{
648 FIXME("(%p): stub\n", hwnd);
649 return DPI_HOSTING_BEHAVIOR_DEFAULT;
650}

◆ GetWindowInfo()

BOOL WINAPI DECLSPEC_HOTPATCH GetWindowInfo ( HWND  hwnd,
WINDOWINFO info 
)

Definition at line 1499 of file win.c.

1500{
1501 return NtUserGetWindowInfo( hwnd, info );
1502}

◆ GetWindowLongA()

LONG WINAPI DECLSPEC_HOTPATCH GetWindowLongA ( HWND  hwnd,
INT  offset 
)

Definition at line 948 of file win.c.

950{
951 switch (offset)
952 {
953#ifdef _WIN64
954 case GWLP_WNDPROC:
955 case GWLP_HINSTANCE:
956 case GWLP_HWNDPARENT:
957 WARN( "Invalid offset %d\n", offset );
959 return 0;
960#endif
961 default:
962 if (sizeof(void *) == sizeof(LONG))
963 {
964 LONG_PTR ret = NtUserGetWindowLongA( hwnd, offset );
966 }
967 return NtUserGetWindowLongA( hwnd, offset );
968 }
969}
#define WARN(fmt,...)
Definition: precomp.h:61
long LONG
Definition: pedump.c:60
#define GWLP_WNDPROC
Definition: treelist.c:66
static LONG_PTR get_window_long_ptr(HWND hwnd, int offset, LONG_PTR ret, BOOL ansi)
Definition: win.c:653
#define ERROR_INVALID_INDEX
Definition: winerror.h:894
#define GWLP_HINSTANCE
Definition: winuser.h:859
#define GWLP_HWNDPARENT
Definition: winuser.h:861

◆ GetWindowLongW()

LONG WINAPI GetWindowLongW ( HWND  hwnd,
INT  offset 
)

Definition at line 975 of file win.c.

976{
977 switch (offset)
978 {
979#ifdef _WIN64
980 case GWLP_WNDPROC:
981 case GWLP_HINSTANCE:
982 case GWLP_HWNDPARENT:
983 WARN( "Invalid offset %d\n", offset );
985 return 0;
986#endif
987 default:
988 if (sizeof(void *) == sizeof(LONG))
989 {
990 LONG_PTR ret = NtUserGetWindowLongW( hwnd, offset );
992 }
993 return NtUserGetWindowLongW( hwnd, offset );
994 }
995}

◆ GetWindowModuleFileNameA()

UINT WINAPI GetWindowModuleFileNameA ( HWND  hwnd,
LPSTR  module,
UINT  size 
)

Definition at line 1459 of file win.c.

1460{
1462
1463 TRACE( "%p, %p, %u\n", hwnd, module, size );
1464
1465 if (!WIN_IsCurrentProcess( hwnd ))
1466 {
1468 return 0;
1469 }
1470
1472 return GetModuleFileNameA( hinst, module, size );
1473}
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
static HINSTANCE hinst
Definition: edit.c:551
HANDLE HINSTANCE
Definition: typedefs.h:77
HWND WIN_IsCurrentProcess(HWND hwnd)
Definition: win.c:131
#define GetWindowLongPtrA
Definition: winuser.h:4831

◆ GetWindowModuleFileNameW()

UINT WINAPI GetWindowModuleFileNameW ( HWND  hwnd,
LPWSTR  module,
UINT  size 
)

Definition at line 1478 of file win.c.

1479{
1481
1482 TRACE( "%p, %p, %u\n", hwnd, module, size );
1483
1484 if (!WIN_IsCurrentProcess( hwnd ))
1485 {
1487 return 0;
1488 }
1489
1491 return GetModuleFileNameW( hinst, module, size );
1492}
#define GetWindowLongPtrW
Definition: winuser.h:4832

◆ GetWindowRect()

BOOL WINAPI GetWindowRect ( HWND  hwnd,
RECT rect 
)

Definition at line 698 of file win.c.

699{
700 UINT dpi = NTUSER_DPI_CONTEXT_GET_DPI( (UINT_PTR)GetThreadDpiAwarenessContext() );
701 BOOL ret = NtUserGetWindowRect( hwnd, rect, dpi );
702 if (ret) TRACE( "hwnd %p %s\n", hwnd, wine_dbgstr_rect(rect) );
703 return ret;
704}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160

◆ GetWindowRgn()

int WINAPI GetWindowRgn ( HWND  hwnd,
HRGN  hrgn 
)

Definition at line 710 of file win.c.

711{
712 return NtUserGetWindowRgnEx( hwnd, hrgn, 0 );
713}
static HRGN hrgn
Definition: win.c:55

Referenced by GetWindowRgnBox().

◆ GetWindowRgnBox()

int WINAPI GetWindowRgnBox ( HWND  hwnd,
RECT rect 
)

Definition at line 719 of file win.c.

720{
721 int ret = ERROR;
722 HRGN hrgn;
723
724 if (!rect)
725 return ERROR;
726
727 if ((hrgn = CreateRectRgn( 0, 0, 0, 0 )))
728 {
729 if ((ret = GetWindowRgn( hwnd, hrgn )) != ERROR )
730 ret = GetRgnBox( hrgn, rect );
732 }
733
734 return ret;
735}
#define ERROR(name)
Definition: error_private.h:53
pKey DeleteObject()
int WINAPI GetWindowRgn(HWND hwnd, HRGN hrgn)
Definition: win.c:710
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI GetRgnBox(_In_ HRGN, _Out_ LPRECT)

◆ GetWindowTextA()

INT WINAPI GetWindowTextA ( HWND  hwnd,
LPSTR  lpString,
INT  nMaxCount 
)

Definition at line 1120 of file win.c.

1121{
1122 WCHAR *buffer;
1123 int ret = 0;
1124
1125 if (!lpString || nMaxCount <= 0) return 0;
1126
1127 __TRY
1128 {
1129 lpString[0] = 0;
1130
1132 {
1133 ret = (INT)SendMessageA( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString );
1134 }
1135 else if ((buffer = HeapAlloc( GetProcessHeap(), 0, nMaxCount * sizeof(WCHAR) )))
1136 {
1137 /* when window belongs to other process, don't send a message */
1139 if (!WideCharToMultiByte( CP_ACP, 0, buffer, -1, lpString, nMaxCount, NULL, NULL ))
1140 lpString[nMaxCount-1] = 0;
1142 ret = strlen(lpString);
1143 }
1144 }
1146 {
1147 ret = 0;
1148 }
1149 __ENDTRY
1150
1151 return ret;
1152}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
#define WideCharToMultiByte
Definition: compat.h:111
#define __EXCEPT_PAGE_FAULT
Definition: compat.h:81
INT NTAPI NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount)
Definition: window.c:4592
#define INT
Definition: polytest.cpp:20
LONG_PTR LPARAM
Definition: windef.h:208
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_GETTEXT
Definition: winuser.h:1621
_In_ int nMaxCount
Definition: winuser.h:4880

◆ GetWindowTextLengthA()

INT WINAPI GetWindowTextLengthA ( HWND  hwnd)

Definition at line 1226 of file win.c.

1227{
1228 CPINFO info;
1229
1231
1232 /* when window belongs to other process, don't send a message */
1233 GetCPInfo( CP_ACP, &info );
1234 return NtUserGetWindowTextLength( hwnd ) * info.MaxCharSize;
1235}
BOOL WINAPI GetCPInfo(UINT codepage, LPCPINFO cpinfo)
Definition: locale.c:2144
#define WM_GETTEXTLENGTH
Definition: winuser.h:1622

◆ GetWindowTextLengthW()

INT WINAPI GetWindowTextLengthW ( HWND  hwnd)

Definition at line 1240 of file win.c.

1241{
1243
1244 /* when window belongs to other process, don't send a message */
1245 return NtUserGetWindowTextLength( hwnd );
1246}
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ GetWindowTextW()

INT WINAPI GetWindowTextW ( HWND  hwnd,
LPWSTR  lpString,
INT  nMaxCount 
)

Definition at line 1158 of file win.c.

1159{
1160 int ret;
1161
1162 if (!lpString || nMaxCount <= 0) return 0;
1163
1164 __TRY
1165 {
1166 lpString[0] = 0;
1167
1169 {
1170 ret = (INT)SendMessageW( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString );
1171 }
1172 else
1173 {
1174 /* when window belongs to other process, don't send a message */
1176 }
1177 }
1179 {
1180 ret = 0;
1181 }
1182 __ENDTRY
1183
1184 return ret;
1185}

◆ GetWindowThreadProcessId()

DWORD WINAPI GetWindowThreadProcessId ( HWND  hwnd,
LPDWORD  process 
)

Definition at line 1261 of file win.c.

1262{
1263 return NtUserGetWindowThread( hwnd, process );
1264}

◆ GetWindowWord()

WORD WINAPI GetWindowWord ( HWND  hwnd,
INT  offset 
)

Definition at line 919 of file win.c.

920{
921 return NtUserGetWindowWord( hwnd, offset );
922}

◆ is_broadcast()

static BOOL is_broadcast ( HWND  hwnd)
inlinestatic

Definition at line 120 of file win.c.

121{
122 return hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST;
123}
#define HWND_TOPMOST
Definition: winuser.h:1211
#define HWND_BROADCAST
Definition: winuser.h:1207

Referenced by SetWindowTextA(), and SetWindowTextW().

◆ is_default_coord()

static BOOL is_default_coord ( int  x)
static

Definition at line 286 of file win.c.

287{
288 return x == CW_USEDEFAULT || x == 0x8000;
289}
#define CW_USEDEFAULT
Definition: winuser.h:225

Referenced by WIN_CreateWindowEx().

◆ is_desktop_window()

BOOL is_desktop_window ( HWND  hwnd)

Definition at line 102 of file win.c.

103{
104 struct ntuser_thread_info *thread_info = NtUserGetThreadInfo();
105
106 if (!hwnd) return FALSE;
107 if (hwnd == UlongToHandle( thread_info->top_window )) return TRUE;
108 if (hwnd == UlongToHandle( thread_info->msg_window )) return TRUE;
109
110 if (!HIWORD(hwnd) || HIWORD(hwnd) == 0xffff)
111 {
112 if (LOWORD(thread_info->top_window) == LOWORD(hwnd)) return TRUE;
113 if (LOWORD(thread_info->msg_window) == LOWORD(hwnd)) return TRUE;
114 }
115 return FALSE;
116}

◆ IsChild()

BOOL WINAPI IsChild ( HWND  parent,
HWND  child 
)

Definition at line 1279 of file win.c.

1280{
1281 return NtUserIsChild( parent, child );
1282}

◆ IsIconic()

BOOL WINAPI IsIconic ( HWND  hwnd)

Definition at line 813 of file win.c.

814{
815 return (GetWindowLongW( hwnd, GWL_STYLE ) & WS_MINIMIZE) != 0;
816}

Referenced by OpenIcon(), and SwitchToThisWindow().

◆ IsWindow()

BOOL WINAPI IsWindow ( HWND  hwnd)

Definition at line 1252 of file win.c.

1253{
1254 return NtUserIsWindow( hwnd );
1255}

◆ IsWindowEnabled()

BOOL WINAPI IsWindowEnabled ( HWND  hwnd)

Definition at line 613 of file win.c.

614{
615 return NtUserIsWindowEnabled( hwnd );
616}

◆ IsWindowUnicode()

BOOL WINAPI IsWindowUnicode ( HWND  hwnd)

Definition at line 621 of file win.c.

622{
623 return NtUserIsWindowUnicode( hwnd );
624}

◆ IsWindowVisible()

BOOL WINAPI IsWindowVisible ( HWND  hwnd)

Definition at line 1288 of file win.c.

1289{
1290 return NtUserIsWindowVisible( hwnd );
1291}

◆ IsZoomed()

BOOL WINAPI IsZoomed ( HWND  hwnd)

Definition at line 822 of file win.c.

823{
824 return (GetWindowLongW( hwnd, GWL_STYLE ) & WS_MAXIMIZE) != 0;
825}

Referenced by WIN_CreateWindowEx().

◆ LockSetForegroundWindow()

BOOL WINAPI LockSetForegroundWindow ( UINT  lockcode)

Definition at line 842 of file win.c.

843{
844 /* FIXME: If Win98/2000 style SetForegroundWindow behavior is
845 * implemented, then fix this function. */
846 return TRUE;
847}

◆ MapWindowPoints()

INT WINAPI MapWindowPoints ( HWND  hwnd_from,
HWND  hwnd_to,
POINT points,
UINT  count 
)

Definition at line 785 of file win.c.

786{
787 UINT dpi = NTUSER_DPI_CONTEXT_GET_DPI( (UINT_PTR)GetThreadDpiAwarenessContext() );
788 return NtUserMapWindowPoints( hwnd_from, hwnd_to, points, count, dpi );
789}
GLsizei const GLfloat * points
Definition: glext.h:8112

◆ OpenIcon()

BOOL WINAPI OpenIcon ( HWND  hwnd)

Definition at line 505 of file win.c.

506{
507 if (!IsIconic( hwnd )) return FALSE;
509 return TRUE;
510}
BOOL WINAPI IsIconic(HWND hwnd)
Definition: win.c:813
#define SW_SHOWNORMAL
Definition: winuser.h:773

◆ RealChildWindowFromPoint()

HWND WINAPI RealChildWindowFromPoint ( HWND  parent,
POINT  pt 
)

Definition at line 768 of file win.c.

769{
771}
HWND NTAPI NtUserRealChildWindowFromPoint(HWND Parent, LONG x, LONG y)
Definition: winpos.c:3513

◆ ScreenToClient()

BOOL WINAPI ScreenToClient ( HWND  hwnd,
POINT pt 
)

Definition at line 804 of file win.c.

805{
806 return NtUserScreenToClient( hwnd, pt );
807}

◆ ScrollWindow()

BOOL WINAPI ScrollWindow ( HWND  hwnd,
INT  dx,
INT  dy,
const RECT rect,
const RECT clip_rect 
)

Definition at line 1642 of file win.c.

1643{
1644 UINT flags = SW_INVALIDATE | SW_ERASE | (rect ? 0 : SW_SCROLLCHILDREN) | SW_NODCCACHE;
1645 return NtUserScrollWindowEx( hwnd, dx, dy, rect, clip_rect, 0, NULL, flags );
1646}
DWORD NTAPI NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *rect, const RECT *clipRect, HRGN hrgnUpdate, LPRECT rcUpdate, UINT flags)
Definition: scrollex.c:571
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
#define SW_SCROLLCHILDREN
Definition: winuser.h:2581
#define SW_INVALIDATE
Definition: winuser.h:2582
#define SW_ERASE
Definition: winuser.h:2583

◆ set_dialog_proc()

static LONG_PTR set_dialog_proc ( HWND  hwnd,
LONG_PTR  newval,
BOOL  ansi 
)
static

Definition at line 664 of file win.c.

665{
668 newval = NtUserCallTwoParam( newval, ansi, NtUserAllocWinProc );
670 proc = NtUserGetDialogProc( (DLGPROC)ret, ansi );
671 if (proc) ret = (UINT_PTR)proc;
672 return ret;
673}
#define NtUserSetWindowLongPtr
Definition: ntuser.h:3288
DWORD_PTR NTAPI NtUserCallTwoParam(DWORD_PTR Param1, DWORD_PTR Param2, DWORD Routine)
Definition: simplecall.c:434

Referenced by SetWindowLongA(), and SetWindowLongW().

◆ SetProcessDefaultLayout()

BOOL WINAPI SetProcessDefaultLayout ( DWORD  layout)

Definition at line 1603 of file win.c.

1604{
1605 return NtUserSetProcessDefaultLayout( layout );
1606}

◆ SetWindowCompositionAttribute()

BOOL WINAPI SetWindowCompositionAttribute ( HWND  hwnd,
void data 
)

Definition at line 1738 of file win.c.

1739{
1740 FIXME("(%p, %p): stub\n", hwnd, data);
1742 return FALSE;
1743}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ SetWindowContextHelpId()

BOOL WINAPI SetWindowContextHelpId ( HWND  hwnd,
DWORD  id 
)

Definition at line 1442 of file win.c.

1443{
1444 return NtUserSetWindowContextHelpId( hwnd, id );
1445}

◆ SetWindowDisplayAffinity()

BOOL WINAPI SetWindowDisplayAffinity ( HWND  hwnd,
DWORD  affinity 
)

Definition at line 1721 of file win.c.

1722{
1723 FIXME("(%p, %lu): stub\n", hwnd, affinity);
1724
1725 if (!hwnd)
1726 {
1728 return FALSE;
1729 }
1730
1732 return FALSE;
1733}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7

◆ SetWindowLongA()

LONG WINAPI DECLSPEC_HOTPATCH SetWindowLongA ( HWND  hwnd,
INT  offset,
LONG  newval 
)

Definition at line 1003 of file win.c.

1004{
1005 switch (offset)
1006 {
1007#ifdef _WIN64
1008 case GWLP_WNDPROC:
1009 case GWLP_HINSTANCE:
1010 case GWLP_HWNDPARENT:
1011 WARN( "Invalid offset %d\n", offset );
1013 return 0;
1014#else
1015 case DWLP_DLGPROC:
1016 if (NtUserGetDialogInfo( hwnd )) return set_dialog_proc( hwnd, newval, TRUE );
1017 /* fall through */
1018#endif
1019 default:
1020 return NtUserSetWindowLong( hwnd, offset, newval, TRUE );
1021 }
1022}
LONG NTAPI NtUserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
Definition: window.c:4048
static LONG_PTR set_dialog_proc(HWND hwnd, LONG_PTR newval, BOOL ansi)
Definition: win.c:664

◆ SetWindowLongW()

LONG WINAPI DECLSPEC_HOTPATCH SetWindowLongW ( HWND  hwnd,
INT  offset,
LONG  newval 
)

Definition at line 1091 of file win.c.

1096{
1097 switch (offset)
1098 {
1099#ifdef _WIN64
1100 case GWLP_WNDPROC:
1101 case GWLP_HINSTANCE:
1102 case GWLP_HWNDPARENT:
1103 WARN("Invalid offset %d\n", offset );
1105 return 0;
1106#else
1107 case DWLP_DLGPROC:
1108 if (NtUserGetDialogInfo( hwnd )) return set_dialog_proc( hwnd, newval, FALSE );
1109 /* fall through */
1110#endif
1111 default:
1112 return NtUserSetWindowLong( hwnd, offset, newval, FALSE );
1113 }
1114}

◆ SetWindowTextA()

BOOL WINAPI DECLSPEC_HOTPATCH SetWindowTextA ( HWND  hwnd,
LPCSTR  lpString 
)

Definition at line 1192 of file win.c.

1193{
1194 if (is_broadcast(hwnd))
1195 {
1197 return FALSE;
1198 }
1199 if (!WIN_IsCurrentProcess( hwnd ))
1200 WARN( "setting text %s of other process window %p should not use SendMessage\n",
1201 debugstr_a(lpString), hwnd );
1202 return (BOOL)SendMessageA( hwnd, WM_SETTEXT, 0, (LPARAM)lpString );
1203}
#define debugstr_a
Definition: kernel32.h:31
static BOOL is_broadcast(HWND hwnd)
Definition: win.c:120
#define WM_SETTEXT
Definition: winuser.h:1620

◆ SetWindowTextW()

BOOL WINAPI DECLSPEC_HOTPATCH SetWindowTextW ( HWND  hwnd,
LPCWSTR  lpString 
)

Definition at line 1209 of file win.c.

1210{
1211 if (is_broadcast(hwnd))
1212 {
1214 return FALSE;
1215 }
1216 if (!WIN_IsCurrentProcess( hwnd ))
1217 WARN( "setting text %s of other process window %p should not use SendMessage\n",
1218 debugstr_w(lpString), hwnd );
1219 return (BOOL)SendMessageW( hwnd, WM_SETTEXT, 0, (LPARAM)lpString );
1220}

◆ ShowOwnedPopups()

BOOL WINAPI ShowOwnedPopups ( HWND  owner,
BOOL  show 
)

Definition at line 1316 of file win.c.

1317{
1318 return NtUserShowOwnedPopups( owner, show );
1319}

◆ SwitchToThisWindow()

void WINAPI SwitchToThisWindow ( HWND  hwnd,
BOOL  alt_tab 
)

Definition at line 688 of file win.c.

689{
691 else BringWindowToTop( hwnd );
692}
BOOL WINAPI BringWindowToTop(HWND hwnd)
Definition: win.c:853
#define SW_RESTORE
Definition: winuser.h:782

◆ UpdateLayeredWindow()

BOOL WINAPI UpdateLayeredWindow ( HWND  hwnd,
HDC  hdcDst,
POINT pptDst,
SIZE psize,
HDC  hdcSrc,
POINT pptSrc,
COLORREF  crKey,
BLENDFUNCTION pblend,
DWORD  flags 
)

Definition at line 1524 of file win.c.

1527{
1528 UPDATELAYEREDWINDOWINFO info;
1529
1530 if (flags & ULW_EX_NORESIZE) /* only valid for UpdateLayeredWindowIndirect */
1531 {
1533 return FALSE;
1534 }
1535 info.cbSize = sizeof(info);
1536 info.hdcDst = hdcDst;
1537 info.pptDst = pptDst;
1538 info.psize = psize;
1539 info.hdcSrc = hdcSrc;
1540 info.pptSrc = pptSrc;
1541 info.crKey = crKey;
1542 info.pblend = pblend;
1543 info.dwFlags = flags;
1544 info.prcDirty = NULL;
1546}
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569
BOOL WINAPI UpdateLayeredWindowIndirect(HWND hwnd, const UPDATELAYEREDWINDOWINFO *info)
Definition: win.c:1507
#define ULW_EX_NORESIZE
Definition: winuser.h:2790
static HDC hdcSrc
Definition: xlate.c:32
static HDC hdcDst
Definition: xlate.c:32

◆ UpdateLayeredWindowIndirect()

BOOL WINAPI UpdateLayeredWindowIndirect ( HWND  hwnd,
const UPDATELAYEREDWINDOWINFO *  info 
)

Definition at line 1507 of file win.c.

1508{
1509 if (!info || info->cbSize != sizeof(*info))
1510 {
1512 return FALSE;
1513 }
1514
1515 return NtUserUpdateLayeredWindow( hwnd, info->hdcDst, info->pptDst, info->psize,
1516 info->hdcSrc, info->pptSrc, info->crKey,
1517 info->pblend, info->dwFlags, info->prcDirty );
1518}
BOOL NTAPI NtUserUpdateLayeredWindow(HWND hwnd, HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags, RECT *prcDirty)
Definition: layered.c:341

Referenced by UpdateLayeredWindow().

◆ UpdateWindow()

BOOL WINAPI UpdateWindow ( HWND  hwnd)

Definition at line 1612 of file win.c.

1613{
1614 if (!hwnd)
1615 {
1617 return FALSE;
1618 }
1619
1621}
BOOL NTAPI NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags)
Definition: painting.c:2003
#define RDW_UPDATENOW
Definition: winuser.h:1223
#define RDW_ALLCHILDREN
Definition: winuser.h:1224

◆ ValidateRgn()

BOOL WINAPI ValidateRgn ( HWND  hwnd,
HRGN  hrgn 
)

Definition at line 1627 of file win.c.

1628{
1629 if (!hwnd)
1630 {
1632 return FALSE;
1633 }
1634
1636}
#define RDW_VALIDATE
Definition: winuser.h:1221

◆ WIN_CreateWindowEx()

HWND WIN_CreateWindowEx ( CREATESTRUCTW cs,
LPCWSTR  className,
HINSTANCE  module,
BOOL  unicode 
)

Definition at line 296 of file win.c.

297{
298 UNICODE_STRING class, window_name = {0};
299 HWND hwnd, top_child = 0;
300 MDICREATESTRUCTW mdi_cs;
302 WCHAR name_buf[8];
303 HMENU menu;
304
305 if (!get_class_info( module, className, &info, &class, FALSE )) return FALSE;
306
307 TRACE("%s %s%s%s ex=%08lx style=%08lx %d,%d %dx%d parent=%p menu=%p inst=%p params=%p\n",
308 unicode ? debugstr_w(cs->lpszName) : debugstr_a((LPCSTR)cs->lpszName),
309 debugstr_w(className), class.Buffer != className ? "->" : "",
310 class.Buffer != className ? debugstr_wn(class.Buffer, class.Length / sizeof(WCHAR)) : "",
311 cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy,
312 cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams );
313 if(TRACE_ON(win)) dump_window_styles( cs->style, cs->dwExStyle );
314
315 /* Fix the styles for MDI children */
316 if (cs->dwExStyle & WS_EX_MDICHILD)
317 {
318 POINT pos[2];
319 UINT id = 0;
320
321 if (!NtUserGetMDIClientInfo( cs->hwndParent ))
322 {
323 WARN("WS_EX_MDICHILD, but parent %p is not MDIClient\n", cs->hwndParent);
324 return 0;
325 }
326
327 /* cs->lpCreateParams of WM_[NC]CREATE is different for MDI children.
328 * MDICREATESTRUCT members have the originally passed values.
329 *
330 * Note: we rely on the fact that MDICREATESTRUCTA and MDICREATESTRUCTW
331 * have the same layout.
332 */
333 mdi_cs.szClass = cs->lpszClass;
334 mdi_cs.szTitle = cs->lpszName;
335 mdi_cs.hOwner = cs->hInstance;
336 mdi_cs.x = cs->x;
337 mdi_cs.y = cs->y;
338 mdi_cs.cx = cs->cx;
339 mdi_cs.cy = cs->cy;
340 mdi_cs.style = cs->style;
341 mdi_cs.lParam = (LPARAM)cs->lpCreateParams;
342
343 cs->lpCreateParams = &mdi_cs;
344
346 {
347 if (cs->style & WS_POPUP)
348 {
349 TRACE("WS_POPUP with MDIS_ALLCHILDSTYLES is not allowed\n");
350 return 0;
351 }
352 cs->style |= WS_CHILD | WS_CLIPSIBLINGS;
353 }
354 else
355 {
356 cs->style &= ~WS_POPUP;
359 }
360
361 top_child = GetWindow(cs->hwndParent, GW_CHILD);
362
363 if (top_child)
364 {
365 /* Restore current maximized child */
366 if((cs->style & WS_VISIBLE) && IsZoomed(top_child))
367 {
368 TRACE("Restoring current maximized child %p\n", top_child);
369 if (cs->style & WS_MAXIMIZE)
370 {
371 /* if the new window is maximized don't bother repainting */
372 SendMessageW( top_child, WM_SETREDRAW, FALSE, 0 );
373 NtUserShowWindow( top_child, SW_SHOWNORMAL );
374 SendMessageW( top_child, WM_SETREDRAW, TRUE, 0 );
375 }
376 else NtUserShowWindow( top_child, SW_SHOWNORMAL );
377 }
378 }
379
380 MDI_CalcDefaultChildPos( cs->hwndParent, -1, pos, 0, &id );
381 if (!(cs->style & WS_POPUP)) cs->hMenu = ULongToHandle(id);
382
383 TRACE( "MDI child id %04x\n", id );
384
385 if (cs->style & (WS_CHILD | WS_POPUP))
386 {
387 if (is_default_coord( cs->x ))
388 {
389 cs->x = pos[0].x;
390 cs->y = pos[0].y;
391 }
392 if (is_default_coord( cs->cx ) || !cs->cx) cs->cx = pos[1].x;
393 if (is_default_coord( cs->cy ) || !cs->cy) cs->cy = pos[1].y;
394 }
395 }
396
397 if (!unicode && cs->lpszName)
398 {
399 const char *nameA = (const char *)cs->lpszName;
400 /* resource ID string is a special case */
401 if (nameA[0] == '\xff')
402 {
403 name_buf[0] = 0xffff;
404 name_buf[1] = MAKEWORD( nameA[1], nameA[2] );
405 name_buf[2] = 0;
406 RtlInitUnicodeString( &window_name, name_buf );
407 }
408 else if (!RtlCreateUnicodeStringFromAsciiz( &window_name, (const char *)cs->lpszName ))
409 return 0;
410 }
411 else RtlInitUnicodeString( &window_name, cs->lpszName );
412
413 menu = cs->hMenu;
414 if (!menu && info.lpszMenuName && (cs->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
415 menu = LoadMenuW( cs->hInstance, info.lpszMenuName );
416
417 hwnd = NtUserCreateWindowEx( cs->dwExStyle, &class, NULL, &window_name, cs->style,
418 cs->x, cs->y, cs->cx, cs->cy, cs->hwndParent, menu, module,
419 cs->lpCreateParams, 0, cs->hInstance, 0, !unicode );
420 if (!hwnd && menu && menu != cs->hMenu) NtUserDestroyMenu( menu );
421 if (!unicode && window_name.Buffer != name_buf) RtlFreeUnicodeString( &window_name );
422 return hwnd;
423}
#define ULongToHandle(h)
Definition: basetsd.h:81
Definition: bufpool.h:45
#define TRACE_ON(x)
Definition: compat.h:75
HWND NTAPI NtUserCreateWindowEx(DWORD dwExStyle, PLARGE_STRING plstrClassName, PLARGE_STRING plstrClsVersion, PLARGE_STRING plstrWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam, DWORD dwFlags, PVOID acbiBuffer)
Definition: window.c:2669
BOOL NTAPI NtUserDestroyMenu(HMENU hMenu)
Definition: menu.c:5834
#define debugstr_wn
Definition: kernel32.h:33
static real win[4][36]
if(dx< 0)
Definition: linetemp.h:194
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define MAKEWORD(a, b)
Definition: typedefs.h:248
void MDI_CalcDefaultChildPos(HWND hwndClient, INT total, LPPOINT lpPos, INT delta, UINT *id)
Definition: mdi.c:308
static void dump_window_styles(DWORD style, DWORD exstyle)
Definition: win.c:176
static BOOL is_default_coord(int x)
Definition: win.c:286
BOOL WINAPI IsZoomed(HWND hwnd)
Definition: win.c:822
#define MDIS_ALLCHILDSTYLES
Definition: winuser.h:253
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define WM_SETREDRAW
Definition: winuser.h:1619
const char * LPCSTR
Definition: xmlstorage.h:183

◆ WIN_GetFullHandle()

HWND WIN_GetFullHandle ( HWND  hwnd)

Definition at line 153 of file win.c.

154{
155 return UlongToHandle( NtUserCallHwnd( hwnd, NtUserGetFullWindowHandle ));
156}
DWORD_PTR NTAPI NtUserCallHwnd(HWND hWnd, DWORD Routine)
Definition: simplecall.c:711

◆ WIN_IsCurrentProcess()

HWND WIN_IsCurrentProcess ( HWND  hwnd)

◆ WIN_IsCurrentThread()

HWND WIN_IsCurrentThread ( HWND  hwnd)

Definition at line 142 of file win.c.

143{
144 return UlongToHandle( NtUserCallHwnd( hwnd, NtUserIsCurrentThreadWindow ));
145}

◆ WIN_ListChildren()

HWND * WIN_ListChildren ( HWND  hwnd)

Definition at line 1337 of file win.c.

1338{
1339 HWND *list;
1340 ULONG size = 128;
1342
1343 if (!(hwnd = GetWindow( hwnd, GW_CHILD ))) return NULL;
1344
1345 for (;;)
1346 {
1347 if (!(list = HeapAlloc( GetProcessHeap(), 0, size * sizeof(HWND) ))) return NULL;
1349 if (!status && size > 1) break;
1350 HeapFree( GetProcessHeap(), 0, list );
1351 if (status != STATUS_BUFFER_TOO_SMALL) return NULL;
1352 }
1353 list[size - 1] = 0;
1354 return list;
1355}

Referenced by AnyPopup(), DIALOG_IdToHwnd(), GetDlgItem(), and User32DefWindowProc().

◆ WIN_SetStyle()

ULONG WIN_SetStyle ( HWND  hwnd,
ULONG  set_bits,
ULONG  clear_bits 
)

Definition at line 164 of file win.c.

165{
166 /* FIXME: Use SetWindowLong or move callers to win32u instead.
167 * We use STYLESTRUCT to pass params, but meaning of its field does not match our usage. */
168 STYLESTRUCT style = { .styleNew = set_bits, .styleOld = clear_bits };
169 return NtUserCallHwndParam( hwnd, (UINT_PTR)&style, NtUserSetWindowStyle );
170}
DWORD NTAPI NtUserCallHwndParam(HWND hWnd, DWORD_PTR Param, DWORD Routine)
Definition: simplecall.c:778

Referenced by ButtonWndProc_common().

◆ WindowFromPoint()

HWND WINAPI WindowFromPoint ( POINT  pt)

Definition at line 751 of file win.c.

752{
753 return NtUserWindowFromPoint( pt.x, pt.y );
754}
HWND NTAPI NtUserWindowFromPoint(LONG X, LONG Y)
Definition: winpos.c:3857

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( win  )