ReactOS 0.4.16-dev-188-g678aa63
status.c File Reference
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "uxtheme.h"
#include "vssym32.h"
#include "wine/debug.h"
Include dependency graph for status.c:

Go to the source code of this file.

Classes

struct  STATUSWINDOWPART
 
struct  STATUS_INFO
 

Macros

#define HORZ_BORDER   0
 
#define VERT_BORDER   2
 
#define HORZ_GAP   2
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (statusbar)
 
static void STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr)
 
static LRESULT STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
 
static LPCSTR debugstr_t (LPCWSTR text, BOOL isW)
 
static UINT STATUSBAR_ComputeHeight (STATUS_INFO *infoPtr)
 
static void STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect)
 
static void STATUSBAR_DrawPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
 
static void STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
 
static LRESULT STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
 
static int STATUSBAR_InternalHitTest (const STATUS_INFO *infoPtr, const POINT *pt)
 
static LRESULT STATUSBAR_Relay2Tip (const STATUS_INFO *infoPtr, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL STATUSBAR_GetBorders (const STATUS_INFO *infoPtr, INT out[])
 
static BOOL STATUSBAR_SetBorders (STATUS_INFO *infoPtr, const INT in[])
 
static HICON STATUSBAR_GetIcon (const STATUS_INFO *infoPtr, INT nPart)
 
static INT STATUSBAR_GetParts (const STATUS_INFO *infoPtr, INT num_parts, INT parts[])
 
static BOOL STATUSBAR_GetRect (const STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
 
static LRESULT STATUSBAR_GetTextA (STATUS_INFO *infoPtr, INT nPart, LPSTR buf)
 
static LRESULT STATUSBAR_GetTextW (STATUS_INFO *infoPtr, INT nPart, LPWSTR buf)
 
static LRESULT STATUSBAR_GetTextLength (STATUS_INFO *infoPtr, INT nPart)
 
static LRESULT STATUSBAR_GetTipTextA (const STATUS_INFO *infoPtr, INT id, LPSTR tip, INT size)
 
static LRESULT STATUSBAR_GetTipTextW (const STATUS_INFO *infoPtr, INT id, LPWSTR tip, INT size)
 
static COLORREF STATUSBAR_SetBkColor (STATUS_INFO *infoPtr, COLORREF color)
 
static BOOL STATUSBAR_SetIcon (STATUS_INFO *infoPtr, INT nPart, HICON hIcon)
 
static BOOL STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
 
static BOOL STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
 
static BOOL STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style, LPWSTR text, BOOL isW)
 
static LRESULT STATUSBAR_SetTipTextA (const STATUS_INFO *infoPtr, INT id, LPSTR text)
 
static LRESULT STATUSBAR_SetTipTextW (const STATUS_INFO *infoPtr, INT id, LPWSTR text)
 
static LRESULT STATUSBAR_SetUnicodeFormat (STATUS_INFO *infoPtr, BOOL bUnicode)
 
static BOOL STATUSBAR_Simple (STATUS_INFO *infoPtr, BOOL simple)
 
static LRESULT STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
 
static LRESULT STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
 
static INT STATUSBAR_WMGetText (const STATUS_INFO *infoPtr, INT size, LPWSTR buf)
 
static BOOL STATUSBAR_WMNCHitTest (const STATUS_INFO *infoPtr, INT x, INT y)
 
static LRESULT STATUSBAR_WMPaint (STATUS_INFO *infoPtr, HDC hdc)
 
static LRESULT STATUSBAR_WMSetFont (STATUS_INFO *infoPtr, HFONT font, BOOL redraw)
 
static BOOL STATUSBAR_WMSetText (const STATUS_INFO *infoPtr, LPCSTR text)
 
static BOOL STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags)
 
static LRESULT theme_changed (const STATUS_INFO *infoPtr)
 
static LRESULT STATUSBAR_SendMouseNotify (const STATUS_INFO *infoPtr, UINT code, UINT msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
void STATUS_Register (void)
 
void STATUS_Unregister (void)
 

Variables

static const WCHAR themeClass [] = { 'S','t','a','t','u','s',0 }
 

Macro Definition Documentation

◆ HORZ_BORDER

#define HORZ_BORDER   0

Definition at line 85 of file status.c.

◆ HORZ_GAP

#define HORZ_GAP   2

Definition at line 87 of file status.c.

◆ VERT_BORDER

#define VERT_BORDER   2

Definition at line 86 of file status.c.

Function Documentation

◆ debugstr_t()

static LPCSTR debugstr_t ( LPCWSTR  text,
BOOL  isW 
)
inlinestatic

Definition at line 97 of file status.c.

98{
100}
const WCHAR * text
Definition: package.c:1794
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
static const WCHAR isW[]
Definition: lex.c:62
const char * LPCSTR
Definition: xmlstorage.h:183

◆ STATUS_Register()

void STATUS_Register ( void  )

Definition at line 1336 of file status.c.

1337{
1338 WNDCLASSW wndClass;
1339
1340 ZeroMemory (&wndClass, sizeof(WNDCLASSW));
1342 wndClass.lpfnWndProc = StatusWindowProc;
1343 wndClass.cbClsExtra = 0;
1344 wndClass.cbWndExtra = sizeof(STATUS_INFO *);
1345 wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
1346 wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1348
1349 RegisterClassW (&wndClass);
1350}
static LRESULT WINAPI StatusWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: status.c:1177
#define STATUSCLASSNAMEW
Definition: commctrl.h:1941
LPCWSTR lpszClassName
Definition: winuser.h:3188
HBRUSH hbrBackground
Definition: winuser.h:3186
int cbClsExtra
Definition: winuser.h:3181
UINT style
Definition: winuser.h:3179
WNDPROC lpfnWndProc
Definition: winuser.h:3180
int cbWndExtra
Definition: winuser.h:3182
HCURSOR hCursor
Definition: winuser.h:3185
#define ZeroMemory
Definition: winbase.h:1712
#define CS_VREDRAW
Definition: winuser.h:658
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:687
#define CS_DBLCLKS
Definition: winuser.h:651
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2157
#define CS_GLOBALCLASS
Definition: winuser.h:652
#define COLOR_BTNFACE
Definition: winuser.h:931
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DllMain().

◆ STATUS_Unregister()

void STATUS_Unregister ( void  )

Definition at line 1360 of file status.c.

1361{
1363}
#define NULL
Definition: types.h:112
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by DllMain().

◆ STATUSBAR_ComputeHeight()

static UINT STATUSBAR_ComputeHeight ( STATUS_INFO infoPtr)
static

Definition at line 103 of file status.c.

104{
105 HTHEME theme;
106 UINT height;
108 int margin;
109
110 COMCTL32_GetFontMetrics(infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont, &tm);
111 margin = (tm.tmInternalLeading ? tm.tmInternalLeading : 2);
112 height = max(tm.tmHeight + margin + 2*GetSystemMetrics(SM_CYBORDER), infoPtr->minHeight) + infoPtr->verticalBorder;
113
114 if ((theme = GetWindowTheme(infoPtr->Self)))
115 {
116 /* Determine bar height from theme such that the content area is
117 * textHeight pixels large */
118 HDC hdc = GetDC(infoPtr->Self);
119 RECT r;
120
121 SetRect(&r, 0, 0, 0, max(infoPtr->minHeight, tm.tmHeight));
122 if (SUCCEEDED(GetThemeBackgroundExtent(theme, hdc, SP_PANE, 0, &r, &r)))
123 {
124 height = r.bottom - r.top;
125 }
126 ReleaseDC(infoPtr->Self, hdc);
127 }
128
129 TRACE(" textHeight=%d+%d, final height=%d\n", tm.tmHeight, tm.tmInternalLeading, height);
130 return height;
131}
void COMCTL32_GetFontMetrics(HFONT hFont, TEXTMETRICW *ptm) DECLSPEC_HIDDEN
Definition: commctrl.c:1728
HRESULT WINAPI GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pContentRect, RECT *pExtentRect)
Definition: draw.c:1572
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:851
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
unsigned int UINT
Definition: ndis.h:50
#define TRACE(s)
Definition: solgame.cpp:4
INT verticalBorder
Definition: status.c:75
HFONT hFont
Definition: status.c:68
UINT minHeight
Definition: status.c:65
HFONT hDefaultFont
Definition: status.c:69
HWND Self
Definition: status.c:61
Definition: time.h:68
#define max(a, b)
Definition: svc.c:63
@ SP_PANE
Definition: vsstyle.h:1198
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define SM_CYBORDER
Definition: winuser.h:968
HDC WINAPI GetDC(_In_opt_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by STATUSBAR_SetMinHeight(), STATUSBAR_WMCreate(), and STATUSBAR_WMSetFont().

◆ STATUSBAR_DrawPart()

static void STATUSBAR_DrawPart ( const STATUS_INFO infoPtr,
HDC  hdc,
const STATUSWINDOWPART part,
int  itemID 
)
static

Definition at line 160 of file status.c.

161{
162 RECT r = part->bound;
164 HTHEME theme = GetWindowTheme (infoPtr->Self);
165 int themePart = SP_PANE;
166 int x = 0;
167
168 TRACE("part bound %s\n", wine_dbgstr_rect(&r));
169 if (part->style & SBT_POPOUT)
171 else if (part->style & SBT_NOBORDERS)
172 border = 0;
173
174 if (theme)
175 {
176 if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
177 && (infoPtr->simple || (itemID == (infoPtr->numParts-1))))
178 themePart = SP_GRIPPERPANE;
179 DrawThemeBackground(theme, hdc, themePart, 0, &r, NULL);
180 }
181 else
183
184 if (part->hIcon) {
185 INT cy = r.bottom - r.top;
186 DrawIconEx (hdc, r.left + 2, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL);
187 x = 2 + cy;
188 }
189
190 if (part->style & SBT_OWNERDRAW) {
191 DRAWITEMSTRUCT dis;
192
193 dis.CtlID = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
194 dis.itemID = itemID;
195 dis.hwndItem = infoPtr->Self;
196 dis.hDC = hdc;
197 dis.rcItem = r;
198 dis.itemData = (ULONG_PTR)part->text;
199 SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
200 } else {
201 r.left += x;
202#ifdef __REACTOS__
203 if (!theme)
204 {
205 r.left -= 2;
207 }
208 else
209 {
210 r.left += 2;
211 r.right -= 2;
212 DrawThemeText(theme, hdc, SP_PANE, 0, part->text, -1, DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX, 0, &r);
213 }
214#else
216#endif
217 }
218}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
void WINAPI DrawStatusTextW(HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style)
Definition: commctrl.c:677
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect)
Definition: draw.c:1500
#define ULONG_PTR
Definition: config.h:101
GLint GLint GLsizei GLsizei GLsizei GLint border
Definition: gl.h:1546
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define SBT_NOBORDERS
Definition: commctrl.h:1976
#define SBT_POPOUT
Definition: commctrl.h:1977
#define SBARS_SIZEGRIP
Definition: commctrl.h:1928
#define SBT_OWNERDRAW
Definition: commctrl.h:1975
LPWSTR text
Definition: status.c:55
HICON hIcon
Definition: status.c:56
BOOL simple
Definition: status.c:66
WORD numParts
Definition: status.c:63
HWND Notify
Definition: status.c:62
ULONG_PTR itemData
Definition: winuser.h:3096
int32_t INT
Definition: typedefs.h:58
@ SP_GRIPPERPANE
Definition: vsstyle.h:1199
LONG_PTR LPARAM
Definition: windef.h:208
#define DI_NORMAL
Definition: wingdi.h:72
#define DT_NOPREFIX
Definition: winuser.h:537
#define BDR_SUNKENOUTER
Definition: winuser.h:443
#define GetWindowLongPtrW
Definition: winuser.h:4832
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define DT_SINGLELINE
Definition: winuser.h:540
#define BF_ADJUST
Definition: winuser.h:470
#define WM_DRAWITEM
Definition: winuser.h:1648
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:2080
#define DT_VCENTER
Definition: winuser.h:543
#define GWLP_ID
Definition: winuser.h:863
#define BDR_RAISEDOUTER
Definition: winuser.h:442
#define BF_RECT
Definition: winuser.h:462
#define GWL_STYLE
Definition: winuser.h:855
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by STATUSBAR_RefreshPart().

◆ STATUSBAR_DrawSizeGrip()

static void STATUSBAR_DrawSizeGrip ( HTHEME  theme,
HDC  hdc,
LPRECT  lpRect 
)
static

Definition at line 134 of file status.c.

135{
136 RECT rc = *lpRect;
137
138 TRACE("draw size grip %s\n", wine_dbgstr_rect(lpRect));
139
140 if (theme)
141 {
142 SIZE gripperSize;
143 if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect,
144 TS_DRAW, &gripperSize)))
145 {
146 rc.left = rc.right - gripperSize.cx;
147 rc.top = rc.bottom - gripperSize.cy;
148 if (SUCCEEDED (DrawThemeBackground(theme, hdc, SP_GRIPPER, 0, &rc, NULL)))
149 return;
150 }
151 }
152
153 rc.left = max( rc.left, rc.right - GetSystemMetrics(SM_CXVSCROLL) - 1 );
154 rc.top = max( rc.top, rc.bottom - GetSystemMetrics(SM_CYHSCROLL) - 1 );
156}
HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz)
Definition: draw.c:1821
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
@ SP_GRIPPER
Definition: vsstyle.h:1200
#define DFC_SCROLL
Definition: winuser.h:475
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define SM_CXVSCROLL
Definition: winuser.h:964
#define DFCS_SCROLLSIZEGRIP
Definition: winuser.h:494
#define SM_CYHSCROLL
Definition: winuser.h:965

Referenced by STATUSBAR_Refresh().

◆ STATUSBAR_GetBorders()

static BOOL STATUSBAR_GetBorders ( const STATUS_INFO infoPtr,
INT  out[] 
)
static

Definition at line 388 of file status.c.

389{
390 TRACE("\n");
391 out[0] = infoPtr->horizontalBorder;
392 out[1] = infoPtr->verticalBorder;
393 out[2] = infoPtr->horizontalGap;
394
395 return TRUE;
396}
#define TRUE
Definition: types.h:120
static FILE * out
Definition: regtests2xml.c:44
INT horizontalBorder
Definition: status.c:74
INT horizontalGap
Definition: status.c:76

Referenced by StatusWindowProc().

◆ STATUSBAR_GetIcon()

static HICON STATUSBAR_GetIcon ( const STATUS_INFO infoPtr,
INT  nPart 
)
static

Definition at line 413 of file status.c.

414{
415 TRACE("%d\n", nPart);
416 /* MSDN says: "simple parts are indexed with -1" */
417 if ((nPart < -1) || (nPart >= infoPtr->numParts))
418 return 0;
419
420 if (nPart == -1)
421 return (infoPtr->part0.hIcon);
422 else
423 return (infoPtr->parts[nPart].hIcon);
424}
STATUSWINDOWPART part0
Definition: status.c:72
STATUSWINDOWPART * parts
Definition: status.c:73

Referenced by StatusWindowProc().

◆ STATUSBAR_GetParts()

static INT STATUSBAR_GetParts ( const STATUS_INFO infoPtr,
INT  num_parts,
INT  parts[] 
)
static

Definition at line 428 of file status.c.

429{
430 INT i;
431
432 TRACE("(%d)\n", num_parts);
433 if (parts) {
434#ifdef __REACTOS__
435 if (num_parts > infoPtr->numParts)
436 num_parts = infoPtr->numParts;
437#endif
438 for (i = 0; i < num_parts; i++) {
439 parts[i] = infoPtr->parts[i].x;
440 }
441 }
442 return infoPtr->numParts;
443}
std::map< E_STRING, PART_TEST > parts
Definition: LocaleTests.cpp:67
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

Referenced by StatusWindowProc().

◆ STATUSBAR_GetRect()

static BOOL STATUSBAR_GetRect ( const STATUS_INFO infoPtr,
INT  nPart,
LPRECT  rect 
)
static

Definition at line 447 of file status.c.

448{
449 TRACE("part %d\n", nPart);
450 if(nPart >= infoPtr->numParts || nPart < 0)
451 return FALSE;
452 if (infoPtr->simple)
453 *rect = infoPtr->part0.bound;
454 else
455 *rect = infoPtr->parts[nPart].bound;
456 return TRUE;
457}
#define FALSE
Definition: types.h:117
& rect
Definition: startmenu.cpp:1413

Referenced by StatusWindowProc().

◆ STATUSBAR_GetTextA()

static LRESULT STATUSBAR_GetTextA ( STATUS_INFO infoPtr,
INT  nPart,
LPSTR  buf 
)
static

Definition at line 461 of file status.c.

462{
463 STATUSWINDOWPART *part;
465
466 TRACE("part %d\n", nPart);
467
468 /* MSDN says: "simple parts use index of 0", so this check is ok. */
469 if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
470
471 if (infoPtr->simple)
472 part = &infoPtr->part0;
473 else
474 part = &infoPtr->parts[nPart];
475
476 if (part->style & SBT_OWNERDRAW)
477 result = (LRESULT)part->text;
478 else {
479 DWORD len = part->text ? WideCharToMultiByte( CP_ACP, 0, part->text, -1,
480 NULL, 0, NULL, NULL ) - 1 : 0;
481 result = MAKELONG( len, part->style );
482 if (part->text && buf)
483 WideCharToMultiByte( CP_ACP, 0, part->text, -1, buf, len+1, NULL, NULL );
484 }
485 return result;
486}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
#define LRESULT
Definition: ole.h:14
#define MAKELONG(a, b)
Definition: typedefs.h:249
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by StatusWindowProc().

◆ STATUSBAR_GetTextLength()

static LRESULT STATUSBAR_GetTextLength ( STATUS_INFO infoPtr,
INT  nPart 
)
static

Definition at line 516 of file status.c.

517{
518 STATUSWINDOWPART *part;
520
521 TRACE("part %d\n", nPart);
522
523 /* MSDN says: "simple parts use index of 0", so this check is ok. */
524 if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
525
526 if (infoPtr->simple)
527 part = &infoPtr->part0;
528 else
529 part = &infoPtr->parts[nPart];
530
531 if ((~part->style & SBT_OWNERDRAW) && part->text)
532 result = lstrlenW(part->text);
533 else
534 result = 0;
535
536 result |= (part->style << 16);
537 return result;
538}
#define lstrlenW
Definition: compat.h:750

Referenced by StatusWindowProc().

◆ STATUSBAR_GetTextW()

static LRESULT STATUSBAR_GetTextW ( STATUS_INFO infoPtr,
INT  nPart,
LPWSTR  buf 
)
static

Definition at line 490 of file status.c.

491{
492 STATUSWINDOWPART *part;
494
495 TRACE("part %d\n", nPart);
496 if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
497
498 if (infoPtr->simple)
499 part = &infoPtr->part0;
500 else
501 part = &infoPtr->parts[nPart];
502
503 if (part->style & SBT_OWNERDRAW)
504 result = (LRESULT)part->text;
505 else {
506 result = part->text ? lstrlenW (part->text) : 0;
507 result |= (part->style << 16);
508 if (part->text && buf)
509 lstrcpyW (buf, part->text);
510 }
511 return result;
512}
#define lstrcpyW
Definition: compat.h:749

Referenced by StatusWindowProc().

◆ STATUSBAR_GetTipTextA()

static LRESULT STATUSBAR_GetTipTextA ( const STATUS_INFO infoPtr,
INT  id,
LPSTR  tip,
INT  size 
)
static

Definition at line 541 of file status.c.

542{
543 TRACE("\n");
544 if (tip) {
546 buf[0]='\0';
547
548 if (infoPtr->hwndToolTip) {
549 TTTOOLINFOA ti;
550 ti.cbSize = sizeof(TTTOOLINFOA);
551 ti.hwnd = infoPtr->Self;
552 ti.uId = id;
553 ti.lpszText = buf;
554 SendMessageA (infoPtr->hwndToolTip, TTM_GETTEXTA, 0, (LPARAM)&ti);
555 }
556 lstrcpynA (tip, buf, size);
557 }
558 return 0;
559}
#define lstrcpynA
Definition: compat.h:751
GLsizeiptr size
Definition: glext.h:5919
GLuint id
Definition: glext.h:5910
#define INFOTIPSIZE
Definition: commctrl.h:124
#define TTM_GETTEXTA
Definition: commctrl.h:1807
struct tagTOOLINFOA TTTOOLINFOA
HWND hwndToolTip
Definition: status.c:67
LPSTR lpszText
Definition: commctrl.h:1734
UINT_PTR uId
Definition: commctrl.h:1731
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
char CHAR
Definition: xmlstorage.h:175

Referenced by StatusWindowProc().

◆ STATUSBAR_GetTipTextW()

static LRESULT STATUSBAR_GetTipTextW ( const STATUS_INFO infoPtr,
INT  id,
LPWSTR  tip,
INT  size 
)
static

Definition at line 563 of file status.c.

564{
565 TRACE("\n");
566 if (tip) {
568 buf[0]=0;
569
570 if (infoPtr->hwndToolTip) {
571 TTTOOLINFOW ti;
572 ti.cbSize = sizeof(TTTOOLINFOW);
573 ti.hwnd = infoPtr->Self;
574 ti.uId = id;
575 ti.lpszText = buf;
576 SendMessageW(infoPtr->hwndToolTip, TTM_GETTEXTW, 0, (LPARAM)&ti);
577 }
578 lstrcpynW(tip, buf, size);
579 }
580
581 return 0;
582}
#define lstrcpynW
Definition: compat.h:738
struct tagTOOLINFOW TTTOOLINFOW
#define TTM_GETTEXTW
Definition: commctrl.h:1808
UINT_PTR uId
Definition: commctrl.h:1743
LPWSTR lpszText
Definition: commctrl.h:1746
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by StatusWindowProc().

◆ STATUSBAR_InternalHitTest()

static int STATUSBAR_InternalHitTest ( const STATUS_INFO infoPtr,
const POINT pt 
)
static

Definition at line 309 of file status.c.

310{
311 unsigned int i;
312
313 if (infoPtr->simple)
314 return 255;
315
316 for (i = 0; i < infoPtr->numParts; i++)
317 if (pt->x >= infoPtr->parts[i].bound.left && pt->x <= infoPtr->parts[i].bound.right)
318 return i;
319 return -2;
320}
#define pt(x, y)
Definition: drawing.c:79

Referenced by STATUSBAR_SendMouseNotify().

◆ STATUSBAR_NotifyFormat()

static LRESULT STATUSBAR_NotifyFormat ( STATUS_INFO infoPtr,
HWND  from,
INT  cmd 
)
static

Definition at line 1141 of file status.c.

1142{
1143 if (cmd == NF_REQUERY) {
1144 INT i = SendMessageW(from, WM_NOTIFYFORMAT, (WPARAM)infoPtr->Self, NF_QUERY);
1145 infoPtr->bUnicode = (i == NFR_UNICODE);
1146 }
1147 return infoPtr->bUnicode ? NFR_UNICODE : NFR_ANSI;
1148}
CardRegion * from
Definition: spigame.cpp:19
BOOL bUnicode
Definition: status.c:71
Definition: ftp_var.h:139
UINT_PTR WPARAM
Definition: windef.h:207
#define NF_REQUERY
Definition: winuser.h:2464
#define NFR_ANSI
Definition: winuser.h:2461
#define NFR_UNICODE
Definition: winuser.h:2462
#define NF_QUERY
Definition: winuser.h:2463

Referenced by STATUSBAR_WMCreate(), and StatusWindowProc().

◆ STATUSBAR_Refresh()

static LRESULT STATUSBAR_Refresh ( STATUS_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 256 of file status.c.

257{
258 RECT rect;
259 HBRUSH hbrBk;
260 HFONT hOldFont;
261 HTHEME theme;
262
263 TRACE("\n");
264 if (!IsWindowVisible(infoPtr->Self))
265 return 0;
266
268
269 GetClientRect (infoPtr->Self, &rect);
270
271 if ((theme = GetWindowTheme (infoPtr->Self)))
272 {
273 DrawThemeBackground(theme, hdc, 0, 0, &rect, NULL);
274 }
275 else
276 {
277 if (infoPtr->clrBk != CLR_DEFAULT)
278 hbrBk = CreateSolidBrush (infoPtr->clrBk);
279 else
281 FillRect(hdc, &rect, hbrBk);
282 if (infoPtr->clrBk != CLR_DEFAULT)
283 DeleteObject (hbrBk);
284 }
285
286 hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
287
288 if (infoPtr->simple) {
289 STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->part0, 0);
290 } else {
291 unsigned int i;
292
293 for (i = 0; i < infoPtr->numParts; i++) {
294 STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->parts[i], i);
295 }
296 }
297
298 SelectObject (hdc, hOldFont);
299
300 if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
301 && !(GetWindowLongW (infoPtr->Notify, GWL_STYLE) & WS_MAXIMIZE))
303
304 return 0;
305}
static void STATUSBAR_SetPartBounds(STATUS_INFO *infoPtr)
Definition: status.c:324
static void STATUSBAR_RefreshPart(const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
Definition: status.c:222
static void STATUSBAR_DrawSizeGrip(HTHEME theme, HDC hdc, LPRECT lpRect)
Definition: status.c:134
pKey DeleteObject()
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define WS_MAXIMIZE
Definition: pedump.c:623
#define CLR_DEFAULT
Definition: commctrl.h:320
COLORREF clrBk
Definition: status.c:70
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define COLOR_3DFACE
Definition: winuser.h:932

Referenced by STATUSBAR_WMPaint().

◆ STATUSBAR_RefreshPart()

static void STATUSBAR_RefreshPart ( const STATUS_INFO infoPtr,
HDC  hdc,
const STATUSWINDOWPART part,
int  itemID 
)
static

Definition at line 222 of file status.c.

223{
224 HBRUSH hbrBk;
225 HTHEME theme;
226
227 TRACE("item %d\n", itemID);
228
229 if (part->bound.right < part->bound.left) return;
230
231 if (!RectVisible(hdc, &part->bound))
232 return;
233
234 if ((theme = GetWindowTheme (infoPtr->Self)))
235 {
236 RECT cr;
237 GetClientRect (infoPtr->Self, &cr);
238 DrawThemeBackground(theme, hdc, 0, 0, &cr, &part->bound);
239 }
240 else
241 {
242 if (infoPtr->clrBk != CLR_DEFAULT)
243 hbrBk = CreateSolidBrush (infoPtr->clrBk);
244 else
246 FillRect(hdc, &part->bound, hbrBk);
247 if (infoPtr->clrBk != CLR_DEFAULT)
248 DeleteObject (hbrBk);
249 }
250
251 STATUSBAR_DrawPart (infoPtr, hdc, part, itemID);
252}
static void STATUSBAR_DrawPart(const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
Definition: status.c:160
BOOL WINAPI RectVisible(_In_ HDC, _In_ LPCRECT)

Referenced by STATUSBAR_Refresh().

◆ STATUSBAR_Relay2Tip()

static LRESULT STATUSBAR_Relay2Tip ( const STATUS_INFO infoPtr,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 370 of file status.c.

372{
373 MSG msg;
374
375 msg.hwnd = infoPtr->Self;
376 msg.message = uMsg;
377 msg.wParam = wParam;
378 msg.lParam = lParam;
379 msg.time = GetMessageTime ();
380 msg.pt.x = (short)LOWORD(GetMessagePos ());
381 msg.pt.y = (short)HIWORD(GetMessagePos ());
382
383 return SendMessageW (infoPtr->hwndToolTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
384}
#define msg(x)
Definition: auth_time.c:54
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define LOWORD(l)
Definition: pedump.c:82
#define TTM_RELAYEVENT
Definition: commctrl.h:1797
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define HIWORD(l)
Definition: typedefs.h:247
DWORD WINAPI GetMessagePos(void)
Definition: message.c:1351
LONG WINAPI GetMessageTime(void)
Definition: message.c:1361

Referenced by StatusWindowProc().

◆ STATUSBAR_SendMouseNotify()

static LRESULT STATUSBAR_SendMouseNotify ( const STATUS_INFO infoPtr,
UINT  code,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1152 of file status.c.

1153{
1154 NMMOUSE nm;
1155
1156 TRACE("code %04x, lParam=%lx\n", code, lParam);
1157 nm.hdr.hwndFrom = infoPtr->Self;
1158 nm.hdr.idFrom = GetWindowLongPtrW(infoPtr->Self, GWLP_ID);
1159 nm.hdr.code = code;
1160 nm.pt.x = (short)LOWORD(lParam);
1161 nm.pt.y = (short)HIWORD(lParam);
1162 nm.dwItemSpec = STATUSBAR_InternalHitTest(infoPtr, &nm.pt);
1163 nm.dwItemData = 0;
1164 nm.dwHitInfo = 0x30000; /* seems constant */
1165
1166 /* Do default processing if WM_NOTIFY returns zero */
1167 if(!SendMessageW(infoPtr->Notify, WM_NOTIFY, nm.hdr.idFrom, (LPARAM)&nm))
1168 {
1169 return DefWindowProcW(infoPtr->Self, msg, wParam, lParam);
1170 }
1171 return 0;
1172}
static int STATUSBAR_InternalHitTest(const STATUS_INFO *infoPtr, const POINT *pt)
Definition: status.c:309
#define WM_NOTIFY
Definition: richedit.h:61
Definition: inflate.c:139
UINT_PTR idFrom
Definition: winuser.h:3161
UINT code
Definition: winuser.h:3162
HWND hwndFrom
Definition: winuser.h:3160
POINT pt
Definition: commctrl.h:166
DWORD_PTR dwItemData
Definition: commctrl.h:165
DWORD_PTR dwItemSpec
Definition: commctrl.h:164
NMHDR hdr
Definition: commctrl.h:163
LPARAM dwHitInfo
Definition: commctrl.h:167
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by StatusWindowProc().

◆ STATUSBAR_SetBkColor()

static COLORREF STATUSBAR_SetBkColor ( STATUS_INFO infoPtr,
COLORREF  color 
)
static

Definition at line 586 of file status.c.

587{
588 COLORREF oldBkColor;
589
590 oldBkColor = infoPtr->clrBk;
591 infoPtr->clrBk = color;
592 InvalidateRect(infoPtr->Self, NULL, FALSE);
593
594 TRACE("CREF: %08x -> %08x\n", oldBkColor, infoPtr->clrBk);
595 return oldBkColor;
596}
GLuint color
Definition: glext.h:6243
DWORD COLORREF
Definition: windef.h:300
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

Referenced by StatusWindowProc().

◆ STATUSBAR_SetBorders()

static BOOL STATUSBAR_SetBorders ( STATUS_INFO infoPtr,
const INT  in[] 
)
static

Definition at line 400 of file status.c.

401{
402 TRACE("\n");
403 infoPtr->horizontalBorder = in[0];
404 infoPtr->verticalBorder = in[1];
405 infoPtr->horizontalGap = in[2];
406 InvalidateRect(infoPtr->Self, NULL, FALSE);
407
408 return TRUE;
409}
GLuint in
Definition: glext.h:9616

Referenced by StatusWindowProc().

◆ STATUSBAR_SetIcon()

static BOOL STATUSBAR_SetIcon ( STATUS_INFO infoPtr,
INT  nPart,
HICON  hIcon 
)
static

Definition at line 600 of file status.c.

601{
602 if ((nPart < -1) || (nPart >= infoPtr->numParts))
603 return FALSE;
604
605 TRACE("setting part %d\n", nPart);
606
607 /* FIXME: MSDN says "if nPart is -1, the status bar is assumed simple" */
608 if (nPart == -1) {
609 if (infoPtr->part0.hIcon == hIcon) /* same as - no redraw */
610 return TRUE;
611 infoPtr->part0.hIcon = hIcon;
612 if (infoPtr->simple)
613 InvalidateRect(infoPtr->Self, &infoPtr->part0.bound, FALSE);
614 } else {
615 if (infoPtr->parts[nPart].hIcon == hIcon) /* same as - no redraw */
616 return TRUE;
617
618 infoPtr->parts[nPart].hIcon = hIcon;
619 if (!(infoPtr->simple))
620 InvalidateRect(infoPtr->Self, &infoPtr->parts[nPart].bound, FALSE);
621 }
622 return TRUE;
623}
HICON hIcon
Definition: msconfig.c:44

Referenced by StatusWindowProc().

◆ STATUSBAR_SetMinHeight()

static BOOL STATUSBAR_SetMinHeight ( STATUS_INFO infoPtr,
INT  height 
)
static

Definition at line 627 of file status.c.

628{
630 if (ysize & 1) ysize--;
631 infoPtr->minHeight = max(height, ysize);
632 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
633 /* like native, don't resize the control */
634 return TRUE;
635}
static UINT STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
Definition: status.c:103
UINT height
Definition: status.c:64
#define SM_CYSIZE
Definition: winuser.h:995

Referenced by StatusWindowProc().

◆ STATUSBAR_SetPartBounds()

static void STATUSBAR_SetPartBounds ( STATUS_INFO infoPtr)
static

Definition at line 324 of file status.c.

325{
326 STATUSWINDOWPART *part;
327 RECT rect, *r;
328 UINT i;
329
330 /* get our window size */
331 GetClientRect (infoPtr->Self, &rect);
332 TRACE("client wnd size is %s\n", wine_dbgstr_rect(&rect));
333
334 rect.left += infoPtr->horizontalBorder;
335 rect.top += infoPtr->verticalBorder;
336
337 /* set bounds for simple rectangle */
338 infoPtr->part0.bound = rect;
339
340 /* set bounds for non-simple rectangles */
341 for (i = 0; i < infoPtr->numParts; i++) {
342 part = &infoPtr->parts[i];
343 r = &infoPtr->parts[i].bound;
344 r->top = rect.top;
345 r->bottom = rect.bottom;
346 if (i == 0)
347 r->left = 0;
348 else
349 r->left = infoPtr->parts[i-1].bound.right + infoPtr->horizontalGap;
350 if (part->x == -1)
351 r->right = rect.right;
352 else
353 r->right = part->x;
354
355 if (infoPtr->hwndToolTip) {
356 TTTOOLINFOW ti;
357
358 ti.cbSize = sizeof(TTTOOLINFOW);
359 ti.hwnd = infoPtr->Self;
360 ti.uId = i;
361 ti.rect = *r;
363 0, (LPARAM)&ti);
364 }
365 }
366}
#define TTM_NEWTOOLRECTW
Definition: commctrl.h:1796

Referenced by STATUSBAR_Refresh(), STATUSBAR_SetParts(), and STATUSBAR_WMSize().

◆ STATUSBAR_SetParts()

static BOOL STATUSBAR_SetParts ( STATUS_INFO infoPtr,
INT  count,
LPINT  parts 
)
static

Definition at line 639 of file status.c.

640{
641 STATUSWINDOWPART *tmp;
642 INT i, oldNumParts;
643
644 TRACE("(%d,%p)\n", count, parts);
645
646 if(!count) return FALSE;
647
648 oldNumParts = infoPtr->numParts;
649 infoPtr->numParts = count;
650 if (oldNumParts > infoPtr->numParts) {
651 for (i = infoPtr->numParts ; i < oldNumParts; i++) {
652 if (!(infoPtr->parts[i].style & SBT_OWNERDRAW))
653 Free (infoPtr->parts[i].text);
654 }
655 } else if (oldNumParts < infoPtr->numParts) {
656 tmp = Alloc (sizeof(STATUSWINDOWPART) * infoPtr->numParts);
657 if (!tmp) return FALSE;
658 for (i = 0; i < oldNumParts; i++) {
659 tmp[i] = infoPtr->parts[i];
660 }
661 Free (infoPtr->parts);
662 infoPtr->parts = tmp;
663 }
664 if (oldNumParts == infoPtr->numParts) {
665 for (i=0; i < oldNumParts; i++)
666 if (infoPtr->parts[i].x != parts[i])
667 break;
668 if (i==oldNumParts) /* Unchanged? no need to redraw! */
669 return TRUE;
670 }
671
672 for (i = 0; i < infoPtr->numParts; i++)
673 infoPtr->parts[i].x = parts[i];
674
675 if (infoPtr->hwndToolTip) {
676 INT nTipCount;
677 TTTOOLINFOW ti;
678 WCHAR wEmpty = 0;
679
680 ZeroMemory (&ti, sizeof(TTTOOLINFOW));
681 ti.cbSize = sizeof(TTTOOLINFOW);
682 ti.hwnd = infoPtr->Self;
683 ti.lpszText = &wEmpty;
684
685 nTipCount = SendMessageW (infoPtr->hwndToolTip, TTM_GETTOOLCOUNT, 0, 0);
686 if (nTipCount < infoPtr->numParts) {
687 /* add tools */
688 for (i = nTipCount; i < infoPtr->numParts; i++) {
689 TRACE("add tool %d\n", i);
690 ti.uId = i;
692 0, (LPARAM)&ti);
693 }
694 }
695 else if (nTipCount > infoPtr->numParts) {
696 /* delete tools */
697 for (i = nTipCount - 1; i >= infoPtr->numParts; i--) {
698 TRACE("delete tool %d\n", i);
699 ti.uId = i;
701 0, (LPARAM)&ti);
702 }
703 }
704 }
705 STATUSBAR_SetPartBounds (infoPtr);
706 InvalidateRect(infoPtr->Self, NULL, FALSE);
707 return TRUE;
708}
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
GLuint GLuint GLsizei count
Definition: gl.h:1545
if(dx< 0)
Definition: linetemp.h:194
#define TTM_DELTOOLW
Definition: commctrl.h:1794
#define TTM_GETTOOLCOUNT
Definition: commctrl.h:1811
#define TTM_ADDTOOLW
Definition: commctrl.h:1792
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815

Referenced by StatusWindowProc().

◆ STATUSBAR_SetTextT()

static BOOL STATUSBAR_SetTextT ( STATUS_INFO infoPtr,
INT  nPart,
WORD  style,
LPWSTR  text,
BOOL  isW 
)
static

Definition at line 712 of file status.c.

714{
716 BOOL changed = FALSE;
717 INT oldStyle;
718
719 if (style & SBT_OWNERDRAW) {
720 TRACE("part %d, text %p\n",nPart,text);
721 }
722 else TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW));
723
724 /* MSDN says: "If the parameter is set to SB_SIMPLEID (255), the status
725 * window is assumed to be a simple window */
726
727 if (nPart == 0x00ff) {
728 part = &infoPtr->part0;
729 } else {
730 if (infoPtr->parts && nPart >= 0 && nPart < infoPtr->numParts) {
731 part = &infoPtr->parts[nPart];
732 }
733 }
734 if (!part) return FALSE;
735
736 if (part->style != style)
737 changed = TRUE;
738
739 oldStyle = part->style;
740 part->style = style;
741 if (style & SBT_OWNERDRAW) {
742 if (!(oldStyle & SBT_OWNERDRAW))
743 Free (part->text);
744 part->text = text;
745 } else {
746 LPWSTR ntext;
747 WCHAR *idx;
748
749 if (text && !isW) {
750 LPCSTR atxt = (LPCSTR)text;
751 DWORD len = MultiByteToWideChar( CP_ACP, 0, atxt, -1, NULL, 0 );
752 ntext = Alloc( (len + 1)*sizeof(WCHAR) );
753 if (!ntext) return FALSE;
754 MultiByteToWideChar( CP_ACP, 0, atxt, -1, ntext, len );
755 } else if (text) {
756 ntext = Alloc( (lstrlenW(text) + 1)*sizeof(WCHAR) );
757 if (!ntext) return FALSE;
758 lstrcpyW (ntext, text);
759 } else ntext = 0;
760
761 /* replace nonprintable characters with spaces */
762 if (ntext) {
763 idx = ntext;
764 while (*idx) {
765 if(!iswprint(*idx))
766 *idx = ' ';
767 idx++;
768 }
769 }
770
771 /* check if text is unchanged -> no need to redraw */
772 if (text) {
773 if (!changed && part->text && !lstrcmpW(ntext, part->text)) {
774 Free(ntext);
775 return TRUE;
776 }
777 } else {
778 if (!changed && !part->text)
779 return TRUE;
780 }
781
782 if (!(oldStyle & SBT_OWNERDRAW))
783 Free (part->text);
784 part->text = ntext;
785 }
786 InvalidateRect(infoPtr->Self, &part->bound, FALSE);
787 UpdateWindow(infoPtr->Self);
788
789 return TRUE;
790}
Arabic default style
Definition: afstyles.h:94
unsigned int idx
Definition: utils.c:41
#define MultiByteToWideChar
Definition: compat.h:110
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
#define debugstr_t
Definition: utils.cpp:194
unsigned int BOOL
Definition: ntddk_ex.h:94
#define iswprint(_c)
Definition: ctype.h:672
BOOL WINAPI UpdateWindow(_In_ HWND)

Referenced by StatusWindowProc().

◆ STATUSBAR_SetTipTextA()

static LRESULT STATUSBAR_SetTipTextA ( const STATUS_INFO infoPtr,
INT  id,
LPSTR  text 
)
static

Definition at line 794 of file status.c.

795{
796 TRACE("part %d: \"%s\"\n", id, text);
797 if (infoPtr->hwndToolTip) {
798 TTTOOLINFOA ti;
799 ti.cbSize = sizeof(TTTOOLINFOA);
800 ti.hwnd = infoPtr->Self;
801 ti.uId = id;
802 ti.hinst = 0;
803 ti.lpszText = text;
805 }
806
807 return 0;
808}
#define TTM_UPDATETIPTEXTA
Definition: commctrl.h:1809
HINSTANCE hinst
Definition: commctrl.h:1733

Referenced by StatusWindowProc().

◆ STATUSBAR_SetTipTextW()

static LRESULT STATUSBAR_SetTipTextW ( const STATUS_INFO infoPtr,
INT  id,
LPWSTR  text 
)
static

Definition at line 812 of file status.c.

813{
814 TRACE("part %d: \"%s\"\n", id, debugstr_w(text));
815 if (infoPtr->hwndToolTip) {
816 TTTOOLINFOW ti;
817 ti.cbSize = sizeof(TTTOOLINFOW);
818 ti.hwnd = infoPtr->Self;
819 ti.uId = id;
820 ti.hinst = 0;
821 ti.lpszText = text;
823 }
824
825 return 0;
826}
#define TTM_UPDATETIPTEXTW
Definition: commctrl.h:1810
HINSTANCE hinst
Definition: commctrl.h:1745

Referenced by StatusWindowProc().

◆ STATUSBAR_SetUnicodeFormat()

static LRESULT STATUSBAR_SetUnicodeFormat ( STATUS_INFO infoPtr,
BOOL  bUnicode 
)
inlinestatic

Definition at line 830 of file status.c.

831{
832 BOOL bOld = infoPtr->bUnicode;
833
834 TRACE("(0x%x)\n", bUnicode);
835 infoPtr->bUnicode = bUnicode;
836
837 return bOld;
838}

Referenced by StatusWindowProc().

◆ STATUSBAR_Simple()

static BOOL STATUSBAR_Simple ( STATUS_INFO infoPtr,
BOOL  simple 
)
static

Definition at line 842 of file status.c.

843{
844 NMHDR nmhdr;
845
846 TRACE("(simple=%d)\n", simple);
847 if (infoPtr->simple == simple) /* no need to change */
848 return TRUE;
849
850 infoPtr->simple = simple;
851
852 /* send notification */
853 nmhdr.hwndFrom = infoPtr->Self;
854 nmhdr.idFrom = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
856 SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
857 InvalidateRect(infoPtr->Self, NULL, FALSE);
858 return TRUE;
859}
#define SBN_SIMPLEMODECHANGE
Definition: commctrl.h:1983

Referenced by StatusWindowProc().

◆ STATUSBAR_WMCreate()

static LRESULT STATUSBAR_WMCreate ( HWND  hwnd,
const CREATESTRUCTA lpCreate 
)
static

Definition at line 893 of file status.c.

894{
895 STATUS_INFO *infoPtr;
896 NONCLIENTMETRICSW nclm;
897 DWORD dwStyle;
898 RECT rect;
899 int len;
900
901 TRACE("\n");
902 infoPtr = Alloc (sizeof(STATUS_INFO));
903 if (!infoPtr) goto create_fail;
904 SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
905
906 infoPtr->Self = hwnd;
907 infoPtr->Notify = lpCreate->hwndParent;
908 infoPtr->numParts = 1;
909 infoPtr->parts = 0;
910 infoPtr->simple = FALSE;
911 infoPtr->clrBk = CLR_DEFAULT;
912 infoPtr->hFont = 0;
913 infoPtr->horizontalBorder = HORZ_BORDER;
914 infoPtr->verticalBorder = VERT_BORDER;
915 infoPtr->horizontalGap = HORZ_GAP;
917 if (infoPtr->minHeight & 1) infoPtr->minHeight--;
918
919 STATUSBAR_NotifyFormat(infoPtr, infoPtr->Notify, NF_REQUERY);
920
921 ZeroMemory (&nclm, sizeof(nclm));
922 nclm.cbSize = sizeof(nclm);
923 SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, nclm.cbSize, &nclm, 0);
924 infoPtr->hDefaultFont = CreateFontIndirectW (&nclm.lfStatusFont);
925
927
928 /* initialize simple case */
929 infoPtr->part0.bound = rect;
930 infoPtr->part0.text = 0;
931 infoPtr->part0.x = 0;
932 infoPtr->part0.style = 0;
933 infoPtr->part0.hIcon = 0;
934
935 /* initialize first part */
936 infoPtr->parts = Alloc (sizeof(STATUSWINDOWPART));
937 if (!infoPtr->parts) goto create_fail;
938 infoPtr->parts[0].bound = rect;
939 infoPtr->parts[0].text = 0;
940 infoPtr->parts[0].x = -1;
941 infoPtr->parts[0].style = 0;
942 infoPtr->parts[0].hIcon = 0;
943
945
946 if (lpCreate->lpszName && (len = lstrlenW ((LPCWSTR)lpCreate->lpszName)))
947 {
948 infoPtr->parts[0].text = Alloc ((len + 1)*sizeof(WCHAR));
949 if (!infoPtr->parts[0].text) goto create_fail;
950 lstrcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName);
951 }
952
953 dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
954 /* native seems to clear WS_BORDER, too */
955 dwStyle &= ~WS_BORDER;
956 SetWindowLongW (hwnd, GWL_STYLE, dwStyle);
957
958 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
959
960 if (dwStyle & SBT_TOOLTIPS) {
961 infoPtr->hwndToolTip =
966
967 if (infoPtr->hwndToolTip) {
968 NMTOOLTIPSCREATED nmttc;
969
970 nmttc.hdr.hwndFrom = hwnd;
973 nmttc.hwndToolTips = infoPtr->hwndToolTip;
974
975 SendMessageW (lpCreate->hwndParent, WM_NOTIFY, nmttc.hdr.idFrom, (LPARAM)&nmttc);
976 }
977 }
978
979 return 0;
980
981create_fail:
982 TRACE(" failed!\n");
983 if (infoPtr) STATUSBAR_WMDestroy(infoPtr);
984 return -1;
985}
#define HORZ_GAP
Definition: status.c:87
#define HORZ_BORDER
Definition: status.c:85
static LRESULT STATUSBAR_WMDestroy(STATUS_INFO *infoPtr)
Definition: status.c:863
static const WCHAR themeClass[]
Definition: status.c:89
#define VERT_BORDER
Definition: status.c:86
static LRESULT STATUSBAR_NotifyFormat(STATUS_INFO *infoPtr, HWND from, INT cmd)
Definition: status.c:1141
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
#define WS_POPUP
Definition: pedump.c:616
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
#define NM_TOOLTIPSCREATED
Definition: commctrl.h:144
#define TTS_ALWAYSTIP
Definition: commctrl.h:1757
#define SBT_TOOLTIPS
Definition: commctrl.h:1930
LPCSTR lpszName
Definition: winuser.h:2952
uint32_t DWORD_PTR
Definition: typedefs.h:65
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
#define GWLP_HINSTANCE
Definition: winuser.h:859
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define CW_USEDEFAULT
Definition: winuser.h:225
#define SetWindowLongPtrW
Definition: winuser.h:5358
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by StatusWindowProc().

◆ STATUSBAR_WMDestroy()

static LRESULT STATUSBAR_WMDestroy ( STATUS_INFO infoPtr)
static

Definition at line 863 of file status.c.

864{
865 unsigned int i;
866
867 TRACE("\n");
868 for (i = 0; i < infoPtr->numParts; i++) {
869 if (!(infoPtr->parts[i].style & SBT_OWNERDRAW))
870 Free (infoPtr->parts[i].text);
871 }
872 if (!(infoPtr->part0.style & SBT_OWNERDRAW))
873 Free (infoPtr->part0.text);
874 Free (infoPtr->parts);
875
876 /* delete default font */
877 if (infoPtr->hDefaultFont)
878 DeleteObject (infoPtr->hDefaultFont);
879
880 /* delete tool tip control */
881 if (infoPtr->hwndToolTip)
882 DestroyWindow (infoPtr->hwndToolTip);
883
885
886 SetWindowLongPtrW(infoPtr->Self, 0, 0);
887 Free (infoPtr);
888 return 0;
889}
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by STATUSBAR_WMCreate(), and StatusWindowProc().

◆ STATUSBAR_WMGetText()

static INT STATUSBAR_WMGetText ( const STATUS_INFO infoPtr,
INT  size,
LPWSTR  buf 
)
static

Definition at line 991 of file status.c.

992{
993 INT len;
994
995 TRACE("\n");
996 if (!(infoPtr->parts[0].text))
997 return 0;
998
999 len = lstrlenW (infoPtr->parts[0].text);
1000
1001 if (!size)
1002 return len;
1003 else if (size > len) {
1004 lstrcpyW (buf, infoPtr->parts[0].text);
1005 return len;
1006 }
1007 else {
1008 memcpy (buf, infoPtr->parts[0].text, (size - 1) * sizeof(WCHAR));
1009 buf[size - 1] = 0;
1010 return size - 1;
1011 }
1012}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by StatusWindowProc().

◆ STATUSBAR_WMNCHitTest()

static BOOL STATUSBAR_WMNCHitTest ( const STATUS_INFO infoPtr,
INT  x,
INT  y 
)
static

Definition at line 1016 of file status.c.

1017{
1018 if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
1019 && !(GetWindowLongW (infoPtr->Notify, GWL_STYLE) & WS_MAXIMIZE)) {
1020 RECT rect;
1021 POINT pt;
1022
1023 GetClientRect (infoPtr->Self, &rect);
1024
1025 pt.x = x;
1026 pt.y = y;
1027 ScreenToClient (infoPtr->Self, &pt);
1028
1029 if (pt.x >= rect.right - GetSystemMetrics(SM_CXVSCROLL))
1030 {
1031 if (GetWindowLongW( infoPtr->Self, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) return HTBOTTOMLEFT;
1032 else return HTBOTTOMRIGHT;
1033 }
1034 }
1035
1036 return HTERROR;
1037}
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
#define HTERROR
Definition: winuser.h:2475
#define HTBOTTOMRIGHT
Definition: winuser.h:2498
#define HTBOTTOMLEFT
Definition: winuser.h:2497
#define GWL_EXSTYLE
Definition: winuser.h:854
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

Referenced by StatusWindowProc().

◆ STATUSBAR_WMPaint()

static LRESULT STATUSBAR_WMPaint ( STATUS_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 1041 of file status.c.

1042{
1043 PAINTSTRUCT ps;
1044
1045 TRACE("\n");
1046 if (hdc) return STATUSBAR_Refresh (infoPtr, hdc);
1047 hdc = BeginPaint (infoPtr->Self, &ps);
1048 STATUSBAR_Refresh (infoPtr, hdc);
1049 EndPaint (infoPtr->Self, &ps);
1050
1051 return 0;
1052}
static LRESULT STATUSBAR_Refresh(STATUS_INFO *infoPtr, HDC hdc)
Definition: status.c:256
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)

Referenced by StatusWindowProc().

◆ STATUSBAR_WMSetFont()

static LRESULT STATUSBAR_WMSetFont ( STATUS_INFO infoPtr,
HFONT  font,
BOOL  redraw 
)
static

Definition at line 1056 of file status.c.

1057{
1058 infoPtr->hFont = font;
1059 TRACE("%p\n", infoPtr->hFont);
1060
1061 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
1062 SendMessageW(infoPtr->Self, WM_SIZE, 0, 0); /* update size */
1063 if (redraw)
1064 InvalidateRect(infoPtr->Self, NULL, FALSE);
1065
1066 return 0;
1067}
Definition: mk_font.cpp:20
void redraw(int x, int y, int cx, int cy)
Definition: qtewin.cpp:1248
#define WM_SIZE
Definition: winuser.h:1614

Referenced by StatusWindowProc().

◆ STATUSBAR_WMSetText()

static BOOL STATUSBAR_WMSetText ( const STATUS_INFO infoPtr,
LPCSTR  text 
)
static

Definition at line 1071 of file status.c.

1072{
1073 STATUSWINDOWPART *part;
1074 int len;
1075
1076 TRACE("\n");
1077 if (infoPtr->numParts == 0)
1078 return FALSE;
1079
1080 part = &infoPtr->parts[0];
1081 /* duplicate string */
1082 Free (part->text);
1083 part->text = 0;
1084
1085 if (text && (len = lstrlenW((LPCWSTR)text))) {
1086 part->text = Alloc ((len+1)*sizeof(WCHAR));
1087 if (!part->text) return FALSE;
1088 lstrcpyW (part->text, (LPCWSTR)text);
1089 }
1090
1091 InvalidateRect(infoPtr->Self, &part->bound, FALSE);
1092
1093 return TRUE;
1094}

Referenced by StatusWindowProc().

◆ STATUSBAR_WMSize()

static BOOL STATUSBAR_WMSize ( STATUS_INFO infoPtr,
WORD  flags 
)
static

Definition at line 1098 of file status.c.

1099{
1100 INT width, x, y;
1101 RECT parent_rect;
1102
1103 /* Need to resize width to match parent */
1104 TRACE("flags %04x\n", flags);
1105
1106 if (flags != SIZE_RESTORED && flags != SIZE_MAXIMIZED) {
1107 WARN("flags MUST be SIZE_RESTORED or SIZE_MAXIMIZED\n");
1108 return FALSE;
1109 }
1110
1111 if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE;
1112
1113 /* width and height don't apply */
1114 if (!GetClientRect (infoPtr->Notify, &parent_rect))
1115 return FALSE;
1116
1117 width = parent_rect.right - parent_rect.left;
1118 x = parent_rect.left;
1119 y = parent_rect.bottom - infoPtr->height;
1120 MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE);
1121 STATUSBAR_SetPartBounds (infoPtr);
1122#ifdef __REACTOS__
1123 parent_rect = infoPtr->parts[infoPtr->numParts - 1].bound;
1124 InvalidateRect(infoPtr->Self, &parent_rect, TRUE);
1125#endif
1126 return TRUE;
1127}
#define WARN(fmt,...)
Definition: precomp.h:61
GLint GLint GLsizei width
Definition: gl.h:1546
GLbitfield flags
Definition: glext.h:7161
#define CCS_NORESIZE
Definition: commctrl.h:2250
#define SIZE_MAXIMIZED
Definition: winuser.h:2510
#define SIZE_RESTORED
Definition: winuser.h:2508
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)

Referenced by StatusWindowProc().

◆ StatusWindowProc()

static LRESULT WINAPI StatusWindowProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1177 of file status.c.

1178{
1179 STATUS_INFO *infoPtr = (STATUS_INFO *)GetWindowLongPtrW (hwnd, 0);
1180 INT nPart = ((INT) wParam) & 0x00ff;
1181 LRESULT res;
1182
1183 TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hwnd, msg, wParam, lParam);
1184 if (!infoPtr && msg != WM_CREATE)
1185 return DefWindowProcW (hwnd, msg, wParam, lParam);
1186
1187 switch (msg) {
1188 case SB_GETBORDERS:
1189 return STATUSBAR_GetBorders (infoPtr, (INT *)lParam);
1190
1191 case SB_GETICON:
1192 return (LRESULT)STATUSBAR_GetIcon (infoPtr, nPart);
1193
1194 case SB_GETPARTS:
1195 return STATUSBAR_GetParts (infoPtr, (INT)wParam, (INT *)lParam);
1196
1197 case SB_GETRECT:
1198 return STATUSBAR_GetRect (infoPtr, nPart, (LPRECT)lParam);
1199
1200 case SB_GETTEXTA:
1201 return STATUSBAR_GetTextA (infoPtr, nPart, (LPSTR)lParam);
1202
1203 case SB_GETTEXTW:
1204 return STATUSBAR_GetTextW (infoPtr, nPart, (LPWSTR)lParam);
1205
1206 case SB_GETTEXTLENGTHA:
1207 case SB_GETTEXTLENGTHW:
1208 return STATUSBAR_GetTextLength (infoPtr, nPart);
1209
1210 case SB_GETTIPTEXTA:
1212
1213 case SB_GETTIPTEXTW:
1215
1217 return infoPtr->bUnicode;
1218
1219 case SB_ISSIMPLE:
1220 return infoPtr->simple;
1221
1222 case SB_SETBORDERS:
1223 return STATUSBAR_SetBorders (infoPtr, (INT *)lParam);
1224
1225 case SB_SETBKCOLOR:
1226 return STATUSBAR_SetBkColor (infoPtr, (COLORREF)lParam);
1227
1228 case SB_SETICON:
1229 return STATUSBAR_SetIcon (infoPtr, nPart, (HICON)lParam);
1230
1231 case SB_SETMINHEIGHT:
1232 return STATUSBAR_SetMinHeight (infoPtr, (INT)wParam);
1233
1234 case SB_SETPARTS:
1235 return STATUSBAR_SetParts (infoPtr, (INT)wParam, (LPINT)lParam);
1236
1237 case SB_SETTEXTA:
1238 return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, FALSE);
1239
1240 case SB_SETTEXTW:
1241 return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, TRUE);
1242
1243 case SB_SETTIPTEXTA:
1244 return STATUSBAR_SetTipTextA (infoPtr, (INT)wParam, (LPSTR)lParam);
1245
1246 case SB_SETTIPTEXTW:
1247 return STATUSBAR_SetTipTextW (infoPtr, (INT)wParam, (LPWSTR)lParam);
1248
1250 return STATUSBAR_SetUnicodeFormat (infoPtr, (BOOL)wParam);
1251
1252 case SB_SIMPLE:
1253 return STATUSBAR_Simple (infoPtr, (BOOL)wParam);
1254
1255 case WM_CREATE:
1257
1258 case WM_DESTROY:
1259 return STATUSBAR_WMDestroy (infoPtr);
1260
1261 case WM_GETFONT:
1262 return (LRESULT)(infoPtr->hFont? infoPtr->hFont : infoPtr->hDefaultFont);
1263
1264 case WM_GETTEXT:
1265 return STATUSBAR_WMGetText (infoPtr, (INT)wParam, (LPWSTR)lParam);
1266
1267 case WM_GETTEXTLENGTH:
1268 return LOWORD(STATUSBAR_GetTextLength (infoPtr, 0));
1269
1270 case WM_LBUTTONDBLCLK:
1272
1273 case WM_LBUTTONUP:
1275
1276 case WM_MOUSEMOVE:
1277 return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
1278
1279 case WM_NCHITTEST:
1280 res = STATUSBAR_WMNCHitTest(infoPtr, (short)LOWORD(lParam),
1281 (short)HIWORD(lParam));
1282 if (res != HTERROR) return res;
1283 return DefWindowProcW (hwnd, msg, wParam, lParam);
1284
1285 case WM_NCLBUTTONUP:
1286 case WM_NCLBUTTONDOWN:
1287 PostMessageW (infoPtr->Notify, msg, wParam, lParam);
1288 return 0;
1289
1290 case WM_NOTIFYFORMAT:
1291 return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam);
1292
1293 case WM_PRINTCLIENT:
1294 case WM_PAINT:
1295 return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
1296
1297 case WM_RBUTTONDBLCLK:
1299
1300 case WM_RBUTTONUP:
1302
1303 case WM_SETFONT:
1304 return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
1305
1306 case WM_SETTEXT:
1307 return STATUSBAR_WMSetText (infoPtr, (LPCSTR)lParam);
1308
1309 case WM_SIZE:
1310 if (STATUSBAR_WMSize (infoPtr, (WORD)wParam)) return 0;
1311 return DefWindowProcW (hwnd, msg, wParam, lParam);
1312
1313 case WM_SYSCOLORCHANGE:
1315 return 0;
1316
1317 case WM_THEMECHANGED:
1318 return theme_changed (infoPtr);
1319
1320 default:
1321 if ((msg >= WM_USER) && (msg < WM_APP) && !COMCTL32_IsReflectedMessage(msg))
1322 ERR("unknown msg %04x wp=%04lx lp=%08lx\n",
1323 msg, wParam, lParam);
1324 return DefWindowProcW (hwnd, msg, wParam, lParam);
1325 }
1326}
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
Definition: commctrl.c:1755
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
Definition: commctrl.c:1593
static LRESULT STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: status.c:1152
static LRESULT STATUSBAR_SetUnicodeFormat(STATUS_INFO *infoPtr, BOOL bUnicode)
Definition: status.c:830
static LRESULT STATUSBAR_GetTipTextW(const STATUS_INFO *infoPtr, INT id, LPWSTR tip, INT size)
Definition: status.c:563
static BOOL STATUSBAR_SetMinHeight(STATUS_INFO *infoPtr, INT height)
Definition: status.c:627
static LRESULT theme_changed(const STATUS_INFO *infoPtr)
Definition: status.c:1131
static LRESULT STATUSBAR_WMPaint(STATUS_INFO *infoPtr, HDC hdc)
Definition: status.c:1041
static LRESULT STATUSBAR_WMCreate(HWND hwnd, const CREATESTRUCTA *lpCreate)
Definition: status.c:893
static INT STATUSBAR_GetParts(const STATUS_INFO *infoPtr, INT num_parts, INT parts[])
Definition: status.c:428
static COLORREF STATUSBAR_SetBkColor(STATUS_INFO *infoPtr, COLORREF color)
Definition: status.c:586
static BOOL STATUSBAR_WMSetText(const STATUS_INFO *infoPtr, LPCSTR text)
Definition: status.c:1071
static BOOL STATUSBAR_WMSize(STATUS_INFO *infoPtr, WORD flags)
Definition: status.c:1098
static LRESULT STATUSBAR_GetTextW(STATUS_INFO *infoPtr, INT nPart, LPWSTR buf)
Definition: status.c:490
static BOOL STATUSBAR_Simple(STATUS_INFO *infoPtr, BOOL simple)
Definition: status.c:842
static LRESULT STATUSBAR_Relay2Tip(const STATUS_INFO *infoPtr, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: status.c:370
static INT STATUSBAR_WMGetText(const STATUS_INFO *infoPtr, INT size, LPWSTR buf)
Definition: status.c:991
static BOOL STATUSBAR_SetTextT(STATUS_INFO *infoPtr, INT nPart, WORD style, LPWSTR text, BOOL isW)
Definition: status.c:712
static LRESULT STATUSBAR_GetTipTextA(const STATUS_INFO *infoPtr, INT id, LPSTR tip, INT size)
Definition: status.c:541
static BOOL STATUSBAR_GetRect(const STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
Definition: status.c:447
static BOOL STATUSBAR_SetParts(STATUS_INFO *infoPtr, INT count, LPINT parts)
Definition: status.c:639
static LRESULT STATUSBAR_SetTipTextW(const STATUS_INFO *infoPtr, INT id, LPWSTR text)
Definition: status.c:812
static LRESULT STATUSBAR_SetTipTextA(const STATUS_INFO *infoPtr, INT id, LPSTR text)
Definition: status.c:794
static HICON STATUSBAR_GetIcon(const STATUS_INFO *infoPtr, INT nPart)
Definition: status.c:413
static LRESULT STATUSBAR_GetTextLength(STATUS_INFO *infoPtr, INT nPart)
Definition: status.c:516
static BOOL STATUSBAR_GetBorders(const STATUS_INFO *infoPtr, INT out[])
Definition: status.c:388
static BOOL STATUSBAR_WMNCHitTest(const STATUS_INFO *infoPtr, INT x, INT y)
Definition: status.c:1016
static LRESULT STATUSBAR_GetTextA(STATUS_INFO *infoPtr, INT nPart, LPSTR buf)
Definition: status.c:461
static LRESULT STATUSBAR_WMSetFont(STATUS_INFO *infoPtr, HFONT font, BOOL redraw)
Definition: status.c:1056
static BOOL STATUSBAR_SetIcon(STATUS_INFO *infoPtr, INT nPart, HICON hIcon)
Definition: status.c:600
static BOOL STATUSBAR_SetBorders(STATUS_INFO *infoPtr, const INT in[])
Definition: status.c:400
#define WM_APP
Definition: eventvwr.h:73
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint res
Definition: glext.h:9613
static HICON
Definition: imagelist.c:80
#define INT
Definition: polytest.cpp:20
#define NM_RDBLCLK
Definition: commctrl.h:134
#define SB_SIMPLE
Definition: commctrl.h:1963
#define SB_GETTEXTA
Definition: commctrl.h:1948
#define SB_GETTEXTLENGTHA
Definition: commctrl.h:1950
#define SB_GETRECT
Definition: commctrl.h:1964
#define NM_DBLCLK
Definition: commctrl.h:131
#define SB_GETPARTS
Definition: commctrl.h:1960
#define SB_SETBKCOLOR
Definition: commctrl.h:1981
#define SB_GETICON
Definition: commctrl.h:1971
#define SB_GETTIPTEXTA
Definition: commctrl.h:1969
#define NM_CLICK
Definition: commctrl.h:130
#define SB_SETICON
Definition: commctrl.h:1966
#define SB_GETTEXTLENGTHW
Definition: commctrl.h:1951
#define SB_SETTEXTA
Definition: commctrl.h:1946
#define SB_SETUNICODEFORMAT
Definition: commctrl.h:1972
#define SB_GETTEXTW
Definition: commctrl.h:1949
#define SB_ISSIMPLE
Definition: commctrl.h:1965
#define SB_GETTIPTEXTW
Definition: commctrl.h:1970
#define SB_SETTIPTEXTW
Definition: commctrl.h:1968
#define SB_SETMINHEIGHT
Definition: commctrl.h:1962
#define SB_SETTIPTEXTA
Definition: commctrl.h:1967
#define NM_RCLICK
Definition: commctrl.h:133
#define SB_GETUNICODEFORMAT
Definition: commctrl.h:1973
#define SB_SETPARTS
Definition: commctrl.h:1959
#define SB_SETTEXTW
Definition: commctrl.h:1947
#define SB_GETBORDERS
Definition: commctrl.h:1961
#define SB_SETBORDERS
Definition: commctrl.h:60
#define WM_PRINTCLIENT
Definition: richedit.h:70
int * LPINT
Definition: windef.h:178
#define WM_PAINT
Definition: winuser.h:1623
#define WM_GETTEXTLENGTH
Definition: winuser.h:1622
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1611
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1781
#define WM_NCHITTEST
Definition: winuser.h:1689
#define WM_RBUTTONUP
Definition: winuser.h:1783
#define WM_RBUTTONDBLCLK
Definition: winuser.h:1784
#define WM_MOUSEMOVE
Definition: winuser.h:1778
#define WM_GETTEXT
Definition: winuser.h:1621
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629
#define WM_GETFONT
Definition: winuser.h:1654
#define WM_SETTEXT
Definition: winuser.h:1620
#define WM_SETFONT
Definition: winuser.h:1653
#define WM_LBUTTONUP
Definition: winuser.h:1780
#define WM_NCLBUTTONUP
Definition: winuser.h:1696
#define WM_USER
Definition: winuser.h:1898
#define WM_DESTROY
Definition: winuser.h:1612
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1695
char * LPSTR
Definition: xmlstorage.h:182

Referenced by STATUS_Register().

◆ theme_changed()

static LRESULT theme_changed ( const STATUS_INFO infoPtr)
static

Definition at line 1131 of file status.c.

1132{
1133 HTHEME theme = GetWindowTheme (infoPtr->Self);
1134 CloseThemeData (theme);
1135 OpenThemeData (infoPtr->Self, themeClass);
1136 return 0;
1137}

Referenced by StatusWindowProc().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( statusbar  )

Variable Documentation

◆ themeClass

const WCHAR themeClass[] = { 'S','t','a','t','u','s',0 }
static

Definition at line 89 of file status.c.

Referenced by STATUSBAR_WMCreate(), and theme_changed().