ReactOS 0.4.15-dev-7704-gc07eb9f
status.c File Reference
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wine/unicode.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 86 of file status.c.

◆ HORZ_GAP

#define HORZ_GAP   2

Definition at line 88 of file status.c.

◆ VERT_BORDER

#define VERT_BORDER   2

Definition at line 87 of file status.c.

Function Documentation

◆ debugstr_t()

static LPCSTR debugstr_t ( LPCWSTR  text,
BOOL  isW 
)
inlinestatic

Definition at line 98 of file status.c.

99{
100 return isW ? debugstr_w(text) : debugstr_a((LPCSTR)text);
101}
const WCHAR * text
Definition: package.c:1799
#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 1333 of file status.c.

1334{
1335 WNDCLASSW wndClass;
1336
1337 ZeroMemory (&wndClass, sizeof(WNDCLASSW));
1339 wndClass.lpfnWndProc = StatusWindowProc;
1340 wndClass.cbClsExtra = 0;
1341 wndClass.cbWndExtra = sizeof(STATUS_INFO *);
1342 wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
1343 wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1345
1346 RegisterClassW (&wndClass);
1347}
static LRESULT WINAPI StatusWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: status.c:1174
#define STATUSCLASSNAMEW
Definition: commctrl.h:1936
LPCWSTR lpszClassName
Definition: winuser.h:3184
HBRUSH hbrBackground
Definition: winuser.h:3182
int cbClsExtra
Definition: winuser.h:3177
UINT style
Definition: winuser.h:3175
WNDPROC lpfnWndProc
Definition: winuser.h:3176
int cbWndExtra
Definition: winuser.h:3178
HCURSOR hCursor
Definition: winuser.h:3181
#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:2088
#define CS_GLOBALCLASS
Definition: winuser.h:652
#define COLOR_BTNFACE
Definition: winuser.h:927
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DllMain().

◆ STATUS_Unregister()

void STATUS_Unregister ( void  )

Definition at line 1357 of file status.c.

1358{
1360}
#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 104 of file status.c.

105{
106 HTHEME theme;
107 UINT height;
109 int margin;
110
111 COMCTL32_GetFontMetrics(infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont, &tm);
112 margin = (tm.tmInternalLeading ? tm.tmInternalLeading : 2);
113 height = max(tm.tmHeight + margin + 2*GetSystemMetrics(SM_CYBORDER), infoPtr->minHeight) + infoPtr->verticalBorder;
114
115 if ((theme = GetWindowTheme(infoPtr->Self)))
116 {
117 /* Determine bar height from theme such that the content area is
118 * textHeight pixels large */
119 HDC hdc = GetDC(infoPtr->Self);
120 RECT r;
121
122 SetRect(&r, 0, 0, 0, max(infoPtr->minHeight, tm.tmHeight));
123 if (SUCCEEDED(GetThemeBackgroundExtent(theme, hdc, SP_PANE, 0, &r, &r)))
124 {
125 height = r.bottom - r.top;
126 }
127 ReleaseDC(infoPtr->Self, hdc);
128 }
129
130 TRACE(" textHeight=%d+%d, final height=%d\n", tm.tmHeight, tm.tmInternalLeading, height);
131 return height;
132}
void COMCTL32_GetFontMetrics(HFONT hFont, TEXTMETRICW *ptm) DECLSPEC_HIDDEN
Definition: commctrl.c:1721
HRESULT WINAPI GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pContentRect, RECT *pExtentRect)
Definition: draw.c:1528
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:92
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
unsigned int UINT
Definition: ndis.h:50
#define TRACE(s)
Definition: solgame.cpp:4
INT verticalBorder
Definition: status.c:76
HFONT hFont
Definition: status.c:69
UINT minHeight
Definition: status.c:66
HFONT hDefaultFont
Definition: status.c:70
HWND Self
Definition: status.c:62
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:964
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 161 of file status.c.

162{
163 RECT r = part->bound;
165 HTHEME theme = GetWindowTheme (infoPtr->Self);
166 int themePart = SP_PANE;
167 int x = 0;
168
169 TRACE("part bound %s\n", wine_dbgstr_rect(&r));
170 if (part->style & SBT_POPOUT)
172 else if (part->style & SBT_NOBORDERS)
173 border = 0;
174
175 if (theme)
176 {
177 if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
178 && (infoPtr->simple || (itemID == (infoPtr->numParts-1))))
179 themePart = SP_GRIPPERPANE;
180 DrawThemeBackground(theme, hdc, themePart, 0, &r, NULL);
181 }
182 else
184
185 if (part->hIcon) {
186 INT cy = r.bottom - r.top;
187 DrawIconEx (hdc, r.left + 2, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL);
188 x = 2 + cy;
189 }
190
191 if (part->style & SBT_OWNERDRAW) {
192 DRAWITEMSTRUCT dis;
193
194 dis.CtlID = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
195 dis.itemID = itemID;
196 dis.hwndItem = infoPtr->Self;
197 dis.hDC = hdc;
198 dis.rcItem = r;
199 dis.itemData = (ULONG_PTR)part->text;
200 SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
201 } else {
202 r.left += x;
203#ifdef __REACTOS__
204 if (!theme)
205 {
206 r.left -= 2;
208 }
209 else
210 {
211 r.left += 2;
212 r.right -= 2;
213 DrawThemeText(theme, hdc, SP_PANE, 0, part->text, -1, DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX, 0, &r);
214 }
215#else
217#endif
218 }
219}
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:1377
#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:1971
#define SBT_POPOUT
Definition: commctrl.h:1972
#define SBARS_SIZEGRIP
Definition: commctrl.h:1923
#define SBT_OWNERDRAW
Definition: commctrl.h:1970
LPWSTR text
Definition: status.c:56
HICON hIcon
Definition: status.c:57
BOOL simple
Definition: status.c:67
WORD numParts
Definition: status.c:64
HWND Notify
Definition: status.c:63
ULONG_PTR itemData
Definition: winuser.h:3092
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:4828
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:1644
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:2011
#define DT_VCENTER
Definition: winuser.h:543
#define GWLP_ID
Definition: winuser.h:859
#define BDR_RAISEDOUTER
Definition: winuser.h:442
#define BF_RECT
Definition: winuser.h:462
#define GWL_STYLE
Definition: winuser.h:851
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 135 of file status.c.

136{
137 RECT rc = *lpRect;
138
139 TRACE("draw size grip %s\n", wine_dbgstr_rect(lpRect));
140
141 if (theme)
142 {
143 SIZE gripperSize;
144 if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect,
145 TS_DRAW, &gripperSize)))
146 {
147 rc.left = rc.right - gripperSize.cx;
148 rc.top = rc.bottom - gripperSize.cy;
149 if (SUCCEEDED (DrawThemeBackground(theme, hdc, SP_GRIPPER, 0, &rc, NULL)))
150 return;
151 }
152 }
153
154 rc.left = max( rc.left, rc.right - GetSystemMetrics(SM_CXVSCROLL) - 1 );
155 rc.top = max( rc.top, rc.bottom - GetSystemMetrics(SM_CYHSCROLL) - 1 );
157}
HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz)
Definition: draw.c:1777
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:960
#define DFCS_SCROLLSIZEGRIP
Definition: winuser.h:494
#define SM_CYHSCROLL
Definition: winuser.h:961

Referenced by STATUSBAR_Refresh().

◆ STATUSBAR_GetBorders()

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

Definition at line 389 of file status.c.

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

Referenced by StatusWindowProc().

◆ STATUSBAR_GetIcon()

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

Definition at line 414 of file status.c.

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

Referenced by StatusWindowProc().

◆ STATUSBAR_GetParts()

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

Definition at line 429 of file status.c.

430{
431 INT i;
432
433 TRACE("(%d)\n", num_parts);
434 if (parts) {
435#ifdef __REACTOS__
436 if (num_parts > infoPtr->numParts)
437 num_parts = infoPtr->numParts;
438#endif
439 for (i = 0; i < num_parts; i++) {
440 parts[i] = infoPtr->parts[i].x;
441 }
442 }
443 return infoPtr->numParts;
444}
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
static const D3D_BLOB_PART parts[]
Definition: blob.c:76

Referenced by StatusWindowProc().

◆ STATUSBAR_GetRect()

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

Definition at line 448 of file status.c.

449{
450 TRACE("part %d\n", nPart);
451 if(nPart >= infoPtr->numParts || nPart < 0)
452 return FALSE;
453 if (infoPtr->simple)
454 *rect = infoPtr->part0.bound;
455 else
456 *rect = infoPtr->parts[nPart].bound;
457 return TRUE;
458}
#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 462 of file status.c.

463{
464 STATUSWINDOWPART *part;
466
467 TRACE("part %d\n", nPart);
468
469 /* MSDN says: "simple parts use index of 0", so this check is ok. */
470 if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
471
472 if (infoPtr->simple)
473 part = &infoPtr->part0;
474 else
475 part = &infoPtr->parts[nPart];
476
477 if (part->style & SBT_OWNERDRAW)
478 result = (LRESULT)part->text;
479 else {
480 DWORD len = part->text ? WideCharToMultiByte( CP_ACP, 0, part->text, -1,
481 NULL, 0, NULL, NULL ) - 1 : 0;
482 result = MAKELONG( len, part->style );
483 if (part->text && buf)
484 WideCharToMultiByte( CP_ACP, 0, part->text, -1, buf, len+1, NULL, NULL );
485 }
486 return result;
487}
#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 517 of file status.c.

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

Referenced by StatusWindowProc().

◆ STATUSBAR_GetTextW()

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

Definition at line 491 of file status.c.

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

Referenced by StatusWindowProc().

◆ STATUSBAR_GetTipTextA()

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

Definition at line 542 of file status.c.

543{
544 TRACE("\n");
545 if (tip) {
547 buf[0]='\0';
548
549 if (infoPtr->hwndToolTip) {
550 TTTOOLINFOA ti;
551 ti.cbSize = sizeof(TTTOOLINFOA);
552 ti.hwnd = infoPtr->Self;
553 ti.uId = id;
554 ti.lpszText = buf;
555 SendMessageA (infoPtr->hwndToolTip, TTM_GETTEXTA, 0, (LPARAM)&ti);
556 }
557 lstrcpynA (tip, buf, size);
558 }
559 return 0;
560}
#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:1802
struct tagTOOLINFOA TTTOOLINFOA
HWND hwndToolTip
Definition: status.c:68
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 564 of file status.c.

565{
566 TRACE("\n");
567 if (tip) {
569 buf[0]=0;
570
571 if (infoPtr->hwndToolTip) {
572 TTTOOLINFOW ti;
573 ti.cbSize = sizeof(TTTOOLINFOW);
574 ti.hwnd = infoPtr->Self;
575 ti.uId = id;
576 ti.lpszText = buf;
577 SendMessageW(infoPtr->hwndToolTip, TTM_GETTEXTW, 0, (LPARAM)&ti);
578 }
579 lstrcpynW(tip, buf, size);
580 }
581
582 return 0;
583}
#define lstrcpynW
Definition: compat.h:738
struct tagTOOLINFOW TTTOOLINFOW
#define TTM_GETTEXTW
Definition: commctrl.h:1803
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 310 of file status.c.

311{
312 unsigned int i;
313
314 if (infoPtr->simple)
315 return 255;
316
317 for (i = 0; i < infoPtr->numParts; i++)
318 if (pt->x >= infoPtr->parts[i].bound.left && pt->x <= infoPtr->parts[i].bound.right)
319 return i;
320 return -2;
321}
#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 1138 of file status.c.

1139{
1140 if (cmd == NF_REQUERY) {
1141 INT i = SendMessageW(from, WM_NOTIFYFORMAT, (WPARAM)infoPtr->Self, NF_QUERY);
1142 infoPtr->bUnicode = (i == NFR_UNICODE);
1143 }
1144 return infoPtr->bUnicode ? NFR_UNICODE : NFR_ANSI;
1145}
CardRegion * from
Definition: spigame.cpp:19
BOOL bUnicode
Definition: status.c:72
Definition: ftp_var.h:139
UINT_PTR WPARAM
Definition: windef.h:207
#define NF_REQUERY
Definition: winuser.h:2460
#define NFR_ANSI
Definition: winuser.h:2457
#define NFR_UNICODE
Definition: winuser.h:2458
#define NF_QUERY
Definition: winuser.h:2459

Referenced by STATUSBAR_WMCreate(), and StatusWindowProc().

◆ STATUSBAR_Refresh()

static LRESULT STATUSBAR_Refresh ( STATUS_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 257 of file status.c.

258{
259 RECT rect;
260 HBRUSH hbrBk;
261 HFONT hOldFont;
262 HTHEME theme;
263
264 TRACE("\n");
265 if (!IsWindowVisible(infoPtr->Self))
266 return 0;
267
269
270 GetClientRect (infoPtr->Self, &rect);
271
272 if ((theme = GetWindowTheme (infoPtr->Self)))
273 {
274 DrawThemeBackground(theme, hdc, 0, 0, &rect, NULL);
275 }
276 else
277 {
278 if (infoPtr->clrBk != CLR_DEFAULT)
279 hbrBk = CreateSolidBrush (infoPtr->clrBk);
280 else
282 FillRect(hdc, &rect, hbrBk);
283 if (infoPtr->clrBk != CLR_DEFAULT)
284 DeleteObject (hbrBk);
285 }
286
287 hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
288
289 if (infoPtr->simple) {
290 STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->part0, 0);
291 } else {
292 unsigned int i;
293
294 for (i = 0; i < infoPtr->numParts; i++) {
295 STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->parts[i], i);
296 }
297 }
298
299 SelectObject (hdc, hOldFont);
300
301 if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
302 && !(GetWindowLongW (infoPtr->Notify, GWL_STYLE) & WS_MAXIMIZE))
304
305 return 0;
306}
static void STATUSBAR_SetPartBounds(STATUS_INFO *infoPtr)
Definition: status.c:325
static void STATUSBAR_RefreshPart(const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
Definition: status.c:223
static void STATUSBAR_DrawSizeGrip(HTHEME theme, HDC hdc, LPRECT lpRect)
Definition: status.c:135
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:71
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
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:928

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 223 of file status.c.

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

373{
374 MSG msg;
375
376 msg.hwnd = infoPtr->Self;
377 msg.message = uMsg;
378 msg.wParam = wParam;
379 msg.lParam = lParam;
380 msg.time = GetMessageTime ();
381 msg.pt.x = (short)LOWORD(GetMessagePos ());
382 msg.pt.y = (short)HIWORD(GetMessagePos ());
383
384 return SendMessageW (infoPtr->hwndToolTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
385}
#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:1792
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 1149 of file status.c.

1150{
1151 NMMOUSE nm;
1152
1153 TRACE("code %04x, lParam=%lx\n", code, lParam);
1154 nm.hdr.hwndFrom = infoPtr->Self;
1155 nm.hdr.idFrom = GetWindowLongPtrW(infoPtr->Self, GWLP_ID);
1156 nm.hdr.code = code;
1157 nm.pt.x = (short)LOWORD(lParam);
1158 nm.pt.y = (short)HIWORD(lParam);
1159 nm.dwItemSpec = STATUSBAR_InternalHitTest(infoPtr, &nm.pt);
1160 nm.dwItemData = 0;
1161 nm.dwHitInfo = 0x30000; /* seems constant */
1162
1163 /* Do default processing if WM_NOTIFY returns zero */
1164 if(!SendMessageW(infoPtr->Notify, WM_NOTIFY, nm.hdr.idFrom, (LPARAM)&nm))
1165 {
1166 return DefWindowProcW(infoPtr->Self, msg, wParam, lParam);
1167 }
1168 return 0;
1169}
static int STATUSBAR_InternalHitTest(const STATUS_INFO *infoPtr, const POINT *pt)
Definition: status.c:310
#define WM_NOTIFY
Definition: richedit.h:61
Definition: inflate.c:139
UINT_PTR idFrom
Definition: winuser.h:3157
UINT code
Definition: winuser.h:3158
HWND hwndFrom
Definition: winuser.h:3156
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 587 of file status.c.

588{
589 COLORREF oldBkColor;
590
591 oldBkColor = infoPtr->clrBk;
592 infoPtr->clrBk = color;
593 InvalidateRect(infoPtr->Self, NULL, FALSE);
594
595 TRACE("CREF: %08x -> %08x\n", oldBkColor, infoPtr->clrBk);
596 return oldBkColor;
597}
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 401 of file status.c.

402{
403 TRACE("\n");
404 infoPtr->horizontalBorder = in[0];
405 infoPtr->verticalBorder = in[1];
406 infoPtr->horizontalGap = in[2];
407 InvalidateRect(infoPtr->Self, NULL, FALSE);
408
409 return TRUE;
410}
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 601 of file status.c.

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

Referenced by StatusWindowProc().

◆ STATUSBAR_SetMinHeight()

static BOOL STATUSBAR_SetMinHeight ( STATUS_INFO infoPtr,
INT  height 
)
static

Definition at line 628 of file status.c.

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

Referenced by StatusWindowProc().

◆ STATUSBAR_SetPartBounds()

static void STATUSBAR_SetPartBounds ( STATUS_INFO infoPtr)
static

Definition at line 325 of file status.c.

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

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 640 of file status.c.

641{
642 STATUSWINDOWPART *tmp;
643 INT i, oldNumParts;
644
645 TRACE("(%d,%p)\n", count, parts);
646
647 if(!count) return FALSE;
648
649 oldNumParts = infoPtr->numParts;
650 infoPtr->numParts = count;
651 if (oldNumParts > infoPtr->numParts) {
652 for (i = infoPtr->numParts ; i < oldNumParts; i++) {
653 if (!(infoPtr->parts[i].style & SBT_OWNERDRAW))
654 Free (infoPtr->parts[i].text);
655 }
656 } else if (oldNumParts < infoPtr->numParts) {
657 tmp = Alloc (sizeof(STATUSWINDOWPART) * infoPtr->numParts);
658 if (!tmp) return FALSE;
659 for (i = 0; i < oldNumParts; i++) {
660 tmp[i] = infoPtr->parts[i];
661 }
662 Free (infoPtr->parts);
663 infoPtr->parts = tmp;
664 }
665 if (oldNumParts == infoPtr->numParts) {
666 for (i=0; i < oldNumParts; i++)
667 if (infoPtr->parts[i].x != parts[i])
668 break;
669 if (i==oldNumParts) /* Unchanged? no need to redraw! */
670 return TRUE;
671 }
672
673 for (i = 0; i < infoPtr->numParts; i++)
674 infoPtr->parts[i].x = parts[i];
675
676 if (infoPtr->hwndToolTip) {
677 INT nTipCount;
678 TTTOOLINFOW ti;
679 WCHAR wEmpty = 0;
680
681 ZeroMemory (&ti, sizeof(TTTOOLINFOW));
682 ti.cbSize = sizeof(TTTOOLINFOW);
683 ti.hwnd = infoPtr->Self;
684 ti.lpszText = &wEmpty;
685
686 nTipCount = SendMessageW (infoPtr->hwndToolTip, TTM_GETTOOLCOUNT, 0, 0);
687 if (nTipCount < infoPtr->numParts) {
688 /* add tools */
689 for (i = nTipCount; i < infoPtr->numParts; i++) {
690 TRACE("add tool %d\n", i);
691 ti.uId = i;
693 0, (LPARAM)&ti);
694 }
695 }
696 else if (nTipCount > infoPtr->numParts) {
697 /* delete tools */
698 for (i = nTipCount - 1; i >= infoPtr->numParts; i--) {
699 TRACE("delete tool %d\n", i);
700 ti.uId = i;
702 0, (LPARAM)&ti);
703 }
704 }
705 }
706 STATUSBAR_SetPartBounds (infoPtr);
707 InvalidateRect(infoPtr->Self, NULL, FALSE);
708 return TRUE;
709}
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:1789
#define TTM_GETTOOLCOUNT
Definition: commctrl.h:1806
#define TTM_ADDTOOLW
Definition: commctrl.h:1787
_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 713 of file status.c.

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

796{
797 TRACE("part %d: \"%s\"\n", id, text);
798 if (infoPtr->hwndToolTip) {
799 TTTOOLINFOA ti;
800 ti.cbSize = sizeof(TTTOOLINFOA);
801 ti.hwnd = infoPtr->Self;
802 ti.uId = id;
803 ti.hinst = 0;
804 ti.lpszText = text;
806 }
807
808 return 0;
809}
#define TTM_UPDATETIPTEXTA
Definition: commctrl.h:1804
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 813 of file status.c.

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

Referenced by StatusWindowProc().

◆ STATUSBAR_SetUnicodeFormat()

static LRESULT STATUSBAR_SetUnicodeFormat ( STATUS_INFO infoPtr,
BOOL  bUnicode 
)
inlinestatic

Definition at line 831 of file status.c.

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

Referenced by StatusWindowProc().

◆ STATUSBAR_Simple()

static BOOL STATUSBAR_Simple ( STATUS_INFO infoPtr,
BOOL  simple 
)
static

Definition at line 843 of file status.c.

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

Referenced by StatusWindowProc().

◆ STATUSBAR_WMCreate()

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

Definition at line 894 of file status.c.

895{
896 STATUS_INFO *infoPtr;
897 NONCLIENTMETRICSW nclm;
898 DWORD dwStyle;
899 RECT rect;
900 int len;
901
902 TRACE("\n");
903 infoPtr = Alloc (sizeof(STATUS_INFO));
904 if (!infoPtr) goto create_fail;
905 SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
906
907 infoPtr->Self = hwnd;
908 infoPtr->Notify = lpCreate->hwndParent;
909 infoPtr->numParts = 1;
910 infoPtr->parts = 0;
911 infoPtr->simple = FALSE;
912 infoPtr->clrBk = CLR_DEFAULT;
913 infoPtr->hFont = 0;
914 infoPtr->horizontalBorder = HORZ_BORDER;
915 infoPtr->verticalBorder = VERT_BORDER;
916 infoPtr->horizontalGap = HORZ_GAP;
918 if (infoPtr->minHeight & 1) infoPtr->minHeight--;
919
920 STATUSBAR_NotifyFormat(infoPtr, infoPtr->Notify, NF_REQUERY);
921
922 ZeroMemory (&nclm, sizeof(nclm));
923 nclm.cbSize = sizeof(nclm);
924 SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, nclm.cbSize, &nclm, 0);
925 infoPtr->hDefaultFont = CreateFontIndirectW (&nclm.lfStatusFont);
926
928
929 /* initialize simple case */
930 infoPtr->part0.bound = rect;
931 infoPtr->part0.text = 0;
932 infoPtr->part0.x = 0;
933 infoPtr->part0.style = 0;
934 infoPtr->part0.hIcon = 0;
935
936 /* initialize first part */
937 infoPtr->parts = Alloc (sizeof(STATUSWINDOWPART));
938 if (!infoPtr->parts) goto create_fail;
939 infoPtr->parts[0].bound = rect;
940 infoPtr->parts[0].text = 0;
941 infoPtr->parts[0].x = -1;
942 infoPtr->parts[0].style = 0;
943 infoPtr->parts[0].hIcon = 0;
944
946
947 if (lpCreate->lpszName && (len = strlenW ((LPCWSTR)lpCreate->lpszName)))
948 {
949 infoPtr->parts[0].text = Alloc ((len + 1)*sizeof(WCHAR));
950 if (!infoPtr->parts[0].text) goto create_fail;
951 strcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName);
952 }
953
954 dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
955 /* native seems to clear WS_BORDER, too */
956 dwStyle &= ~WS_BORDER;
957 SetWindowLongW (hwnd, GWL_STYLE, dwStyle);
958
959 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
960
961 if (dwStyle & SBT_TOOLTIPS) {
962 infoPtr->hwndToolTip =
967
968 if (infoPtr->hwndToolTip) {
969 NMTOOLTIPSCREATED nmttc;
970
971 nmttc.hdr.hwndFrom = hwnd;
974 nmttc.hwndToolTips = infoPtr->hwndToolTip;
975
976 SendMessageW (lpCreate->hwndParent, WM_NOTIFY, nmttc.hdr.idFrom, (LPARAM)&nmttc);
977 }
978 }
979
980 return 0;
981
982create_fail:
983 TRACE(" failed!\n");
984 if (infoPtr) STATUSBAR_WMDestroy(infoPtr);
985 return -1;
986}
#define HORZ_GAP
Definition: status.c:88
#define HORZ_BORDER
Definition: status.c:86
static LRESULT STATUSBAR_WMDestroy(STATUS_INFO *infoPtr)
Definition: status.c:864
static const WCHAR themeClass[]
Definition: status.c:90
#define VERT_BORDER
Definition: status.c:87
static LRESULT STATUSBAR_NotifyFormat(STATUS_INFO *infoPtr, HWND from, INT cmd)
Definition: status.c:1138
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:1925
LPCSTR lpszName
Definition: winuser.h:2948
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:855
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:5345
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by StatusWindowProc().

◆ STATUSBAR_WMDestroy()

static LRESULT STATUSBAR_WMDestroy ( STATUS_INFO infoPtr)
static

Definition at line 864 of file status.c.

865{
866 unsigned int i;
867
868 TRACE("\n");
869 for (i = 0; i < infoPtr->numParts; i++) {
870 if (!(infoPtr->parts[i].style & SBT_OWNERDRAW))
871 Free (infoPtr->parts[i].text);
872 }
873 if (!(infoPtr->part0.style & SBT_OWNERDRAW))
874 Free (infoPtr->part0.text);
875 Free (infoPtr->parts);
876
877 /* delete default font */
878 if (infoPtr->hDefaultFont)
879 DeleteObject (infoPtr->hDefaultFont);
880
881 /* delete tool tip control */
882 if (infoPtr->hwndToolTip)
883 DestroyWindow (infoPtr->hwndToolTip);
884
886
887 SetWindowLongPtrW(infoPtr->Self, 0, 0);
888 Free (infoPtr);
889 return 0;
890}
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 992 of file status.c.

993{
994 INT len;
995
996 TRACE("\n");
997 if (!(infoPtr->parts[0].text))
998 return 0;
999
1000 len = strlenW (infoPtr->parts[0].text);
1001
1002 if (!size)
1003 return len;
1004 else if (size > len) {
1005 strcpyW (buf, infoPtr->parts[0].text);
1006 return len;
1007 }
1008 else {
1009 memcpy (buf, infoPtr->parts[0].text, (size - 1) * sizeof(WCHAR));
1010 buf[size - 1] = 0;
1011 return size - 1;
1012 }
1013}
#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 1017 of file status.c.

1018{
1019 if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
1020 && !(GetWindowLongW (infoPtr->Notify, GWL_STYLE) & WS_MAXIMIZE)) {
1021 RECT rect;
1022 POINT pt;
1023
1024 GetClientRect (infoPtr->Self, &rect);
1025
1026 pt.x = x;
1027 pt.y = y;
1028 ScreenToClient (infoPtr->Self, &pt);
1029
1030 if (pt.x >= rect.right - GetSystemMetrics(SM_CXVSCROLL))
1031 {
1032 if (GetWindowLongW( infoPtr->Self, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) return HTBOTTOMLEFT;
1033 else return HTBOTTOMRIGHT;
1034 }
1035 }
1036
1037 return HTERROR;
1038}
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
#define HTERROR
Definition: winuser.h:2471
#define HTBOTTOMRIGHT
Definition: winuser.h:2494
#define HTBOTTOMLEFT
Definition: winuser.h:2493
#define GWL_EXSTYLE
Definition: winuser.h:850
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 1042 of file status.c.

1043{
1044 PAINTSTRUCT ps;
1045
1046 TRACE("\n");
1047 if (hdc) return STATUSBAR_Refresh (infoPtr, hdc);
1048 hdc = BeginPaint (infoPtr->Self, &ps);
1049 STATUSBAR_Refresh (infoPtr, hdc);
1050 EndPaint (infoPtr->Self, &ps);
1051
1052 return 0;
1053}
static LRESULT STATUSBAR_Refresh(STATUS_INFO *infoPtr, HDC hdc)
Definition: status.c:257
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 1057 of file status.c.

1058{
1059 infoPtr->hFont = font;
1060 TRACE("%p\n", infoPtr->hFont);
1061
1062 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
1063 SendMessageW(infoPtr->Self, WM_SIZE, 0, 0); /* update size */
1064 if (redraw)
1065 InvalidateRect(infoPtr->Self, NULL, FALSE);
1066
1067 return 0;
1068}
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:1610

Referenced by StatusWindowProc().

◆ STATUSBAR_WMSetText()

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

Definition at line 1072 of file status.c.

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

Referenced by StatusWindowProc().

◆ STATUSBAR_WMSize()

static BOOL STATUSBAR_WMSize ( STATUS_INFO infoPtr,
WORD  flags 
)
static

Definition at line 1099 of file status.c.

1100{
1101 INT width, x, y;
1102 RECT parent_rect;
1103
1104 /* Need to resize width to match parent */
1105 TRACE("flags %04x\n", flags);
1106
1107 if (flags != SIZE_RESTORED && flags != SIZE_MAXIMIZED) {
1108 WARN("flags MUST be SIZE_RESTORED or SIZE_MAXIMIZED\n");
1109 return FALSE;
1110 }
1111
1112 if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE;
1113
1114 /* width and height don't apply */
1115 if (!GetClientRect (infoPtr->Notify, &parent_rect))
1116 return FALSE;
1117
1118 width = parent_rect.right - parent_rect.left;
1119 x = parent_rect.left;
1120 y = parent_rect.bottom - infoPtr->height;
1121 MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE);
1122 STATUSBAR_SetPartBounds (infoPtr);
1123 return TRUE;
1124}
#define WARN(fmt,...)
Definition: debug.h:112
GLint GLint GLsizei width
Definition: gl.h:1546
GLbitfield flags
Definition: glext.h:7161
#define CCS_NORESIZE
Definition: commctrl.h:2245
#define SIZE_MAXIMIZED
Definition: winuser.h:2506
#define SIZE_RESTORED
Definition: winuser.h:2504
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 1174 of file status.c.

1175{
1176 STATUS_INFO *infoPtr = (STATUS_INFO *)GetWindowLongPtrW (hwnd, 0);
1177 INT nPart = ((INT) wParam) & 0x00ff;
1178 LRESULT res;
1179
1180 TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hwnd, msg, wParam, lParam);
1181 if (!infoPtr && msg != WM_CREATE)
1182 return DefWindowProcW (hwnd, msg, wParam, lParam);
1183
1184 switch (msg) {
1185 case SB_GETBORDERS:
1186 return STATUSBAR_GetBorders (infoPtr, (INT *)lParam);
1187
1188 case SB_GETICON:
1189 return (LRESULT)STATUSBAR_GetIcon (infoPtr, nPart);
1190
1191 case SB_GETPARTS:
1192 return STATUSBAR_GetParts (infoPtr, (INT)wParam, (INT *)lParam);
1193
1194 case SB_GETRECT:
1195 return STATUSBAR_GetRect (infoPtr, nPart, (LPRECT)lParam);
1196
1197 case SB_GETTEXTA:
1198 return STATUSBAR_GetTextA (infoPtr, nPart, (LPSTR)lParam);
1199
1200 case SB_GETTEXTW:
1201 return STATUSBAR_GetTextW (infoPtr, nPart, (LPWSTR)lParam);
1202
1203 case SB_GETTEXTLENGTHA:
1204 case SB_GETTEXTLENGTHW:
1205 return STATUSBAR_GetTextLength (infoPtr, nPart);
1206
1207 case SB_GETTIPTEXTA:
1209
1210 case SB_GETTIPTEXTW:
1212
1214 return infoPtr->bUnicode;
1215
1216 case SB_ISSIMPLE:
1217 return infoPtr->simple;
1218
1219 case SB_SETBORDERS:
1220 return STATUSBAR_SetBorders (infoPtr, (INT *)lParam);
1221
1222 case SB_SETBKCOLOR:
1223 return STATUSBAR_SetBkColor (infoPtr, (COLORREF)lParam);
1224
1225 case SB_SETICON:
1226 return STATUSBAR_SetIcon (infoPtr, nPart, (HICON)lParam);
1227
1228 case SB_SETMINHEIGHT:
1229 return STATUSBAR_SetMinHeight (infoPtr, (INT)wParam);
1230
1231 case SB_SETPARTS:
1232 return STATUSBAR_SetParts (infoPtr, (INT)wParam, (LPINT)lParam);
1233
1234 case SB_SETTEXTA:
1235 return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, FALSE);
1236
1237 case SB_SETTEXTW:
1238 return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, TRUE);
1239
1240 case SB_SETTIPTEXTA:
1241 return STATUSBAR_SetTipTextA (infoPtr, (INT)wParam, (LPSTR)lParam);
1242
1243 case SB_SETTIPTEXTW:
1244 return STATUSBAR_SetTipTextW (infoPtr, (INT)wParam, (LPWSTR)lParam);
1245
1247 return STATUSBAR_SetUnicodeFormat (infoPtr, (BOOL)wParam);
1248
1249 case SB_SIMPLE:
1250 return STATUSBAR_Simple (infoPtr, (BOOL)wParam);
1251
1252 case WM_CREATE:
1254
1255 case WM_DESTROY:
1256 return STATUSBAR_WMDestroy (infoPtr);
1257
1258 case WM_GETFONT:
1259 return (LRESULT)(infoPtr->hFont? infoPtr->hFont : infoPtr->hDefaultFont);
1260
1261 case WM_GETTEXT:
1262 return STATUSBAR_WMGetText (infoPtr, (INT)wParam, (LPWSTR)lParam);
1263
1264 case WM_GETTEXTLENGTH:
1265 return LOWORD(STATUSBAR_GetTextLength (infoPtr, 0));
1266
1267 case WM_LBUTTONDBLCLK:
1269
1270 case WM_LBUTTONUP:
1272
1273 case WM_MOUSEMOVE:
1274 return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
1275
1276 case WM_NCHITTEST:
1277 res = STATUSBAR_WMNCHitTest(infoPtr, (short)LOWORD(lParam),
1278 (short)HIWORD(lParam));
1279 if (res != HTERROR) return res;
1280 return DefWindowProcW (hwnd, msg, wParam, lParam);
1281
1282 case WM_NCLBUTTONUP:
1283 case WM_NCLBUTTONDOWN:
1284 PostMessageW (infoPtr->Notify, msg, wParam, lParam);
1285 return 0;
1286
1287 case WM_NOTIFYFORMAT:
1288 return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam);
1289
1290 case WM_PRINTCLIENT:
1291 case WM_PAINT:
1292 return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
1293
1294 case WM_RBUTTONDBLCLK:
1296
1297 case WM_RBUTTONUP:
1299
1300 case WM_SETFONT:
1301 return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
1302
1303 case WM_SETTEXT:
1304 return STATUSBAR_WMSetText (infoPtr, (LPCSTR)lParam);
1305
1306 case WM_SIZE:
1307 if (STATUSBAR_WMSize (infoPtr, (WORD)wParam)) return 0;
1308 return DefWindowProcW (hwnd, msg, wParam, lParam);
1309
1310 case WM_SYSCOLORCHANGE:
1312 return 0;
1313
1314 case WM_THEMECHANGED:
1315 return theme_changed (infoPtr);
1316
1317 default:
1318 if ((msg >= WM_USER) && (msg < WM_APP) && !COMCTL32_IsReflectedMessage(msg))
1319 ERR("unknown msg %04x wp=%04lx lp=%08lx\n",
1320 msg, wParam, lParam);
1321 return DefWindowProcW (hwnd, msg, wParam, lParam);
1322 }
1323}
#define ERR(fmt,...)
Definition: debug.h:110
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
Definition: commctrl.c:1748
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
Definition: commctrl.c:1586
static LRESULT STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: status.c:1149
static LRESULT STATUSBAR_SetUnicodeFormat(STATUS_INFO *infoPtr, BOOL bUnicode)
Definition: status.c:831
static LRESULT STATUSBAR_GetTipTextW(const STATUS_INFO *infoPtr, INT id, LPWSTR tip, INT size)
Definition: status.c:564
static BOOL STATUSBAR_SetMinHeight(STATUS_INFO *infoPtr, INT height)
Definition: status.c:628
static LRESULT theme_changed(const STATUS_INFO *infoPtr)
Definition: status.c:1128
static LRESULT STATUSBAR_WMPaint(STATUS_INFO *infoPtr, HDC hdc)
Definition: status.c:1042
static LRESULT STATUSBAR_WMCreate(HWND hwnd, const CREATESTRUCTA *lpCreate)
Definition: status.c:894
static INT STATUSBAR_GetParts(const STATUS_INFO *infoPtr, INT num_parts, INT parts[])
Definition: status.c:429
static COLORREF STATUSBAR_SetBkColor(STATUS_INFO *infoPtr, COLORREF color)
Definition: status.c:587
static BOOL STATUSBAR_WMSetText(const STATUS_INFO *infoPtr, LPCSTR text)
Definition: status.c:1072
static BOOL STATUSBAR_WMSize(STATUS_INFO *infoPtr, WORD flags)
Definition: status.c:1099
static LRESULT STATUSBAR_GetTextW(STATUS_INFO *infoPtr, INT nPart, LPWSTR buf)
Definition: status.c:491
static BOOL STATUSBAR_Simple(STATUS_INFO *infoPtr, BOOL simple)
Definition: status.c:843
static LRESULT STATUSBAR_Relay2Tip(const STATUS_INFO *infoPtr, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: status.c:371
static INT STATUSBAR_WMGetText(const STATUS_INFO *infoPtr, INT size, LPWSTR buf)
Definition: status.c:992
static BOOL STATUSBAR_SetTextT(STATUS_INFO *infoPtr, INT nPart, WORD style, LPWSTR text, BOOL isW)
Definition: status.c:713
static LRESULT STATUSBAR_GetTipTextA(const STATUS_INFO *infoPtr, INT id, LPSTR tip, INT size)
Definition: status.c:542
static BOOL STATUSBAR_GetRect(const STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
Definition: status.c:448
static BOOL STATUSBAR_SetParts(STATUS_INFO *infoPtr, INT count, LPINT parts)
Definition: status.c:640
static LRESULT STATUSBAR_SetTipTextW(const STATUS_INFO *infoPtr, INT id, LPWSTR text)
Definition: status.c:813
static LRESULT STATUSBAR_SetTipTextA(const STATUS_INFO *infoPtr, INT id, LPSTR text)
Definition: status.c:795
static HICON STATUSBAR_GetIcon(const STATUS_INFO *infoPtr, INT nPart)
Definition: status.c:414
static LRESULT STATUSBAR_GetTextLength(STATUS_INFO *infoPtr, INT nPart)
Definition: status.c:517
static BOOL STATUSBAR_GetBorders(const STATUS_INFO *infoPtr, INT out[])
Definition: status.c:389
static BOOL STATUSBAR_WMNCHitTest(const STATUS_INFO *infoPtr, INT x, INT y)
Definition: status.c:1017
static LRESULT STATUSBAR_GetTextA(STATUS_INFO *infoPtr, INT nPart, LPSTR buf)
Definition: status.c:462
static LRESULT STATUSBAR_WMSetFont(STATUS_INFO *infoPtr, HFONT font, BOOL redraw)
Definition: status.c:1057
static BOOL STATUSBAR_SetIcon(STATUS_INFO *infoPtr, INT nPart, HICON hIcon)
Definition: status.c:601
static BOOL STATUSBAR_SetBorders(STATUS_INFO *infoPtr, const INT in[])
Definition: status.c:401
#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:84
#define INT
Definition: polytest.cpp:20
#define NM_RDBLCLK
Definition: commctrl.h:134
#define SB_SIMPLE
Definition: commctrl.h:1958
#define SB_GETTEXTA
Definition: commctrl.h:1943
#define SB_GETTEXTLENGTHA
Definition: commctrl.h:1945
#define SB_GETRECT
Definition: commctrl.h:1959
#define NM_DBLCLK
Definition: commctrl.h:131
#define SB_GETPARTS
Definition: commctrl.h:1955
#define SB_SETBKCOLOR
Definition: commctrl.h:1976
#define SB_GETICON
Definition: commctrl.h:1966
#define SB_GETTIPTEXTA
Definition: commctrl.h:1964
#define NM_CLICK
Definition: commctrl.h:130
#define SB_SETICON
Definition: commctrl.h:1961
#define SB_GETTEXTLENGTHW
Definition: commctrl.h:1946
#define SB_SETTEXTA
Definition: commctrl.h:1941
#define SB_SETUNICODEFORMAT
Definition: commctrl.h:1967
#define SB_GETTEXTW
Definition: commctrl.h:1944
#define SB_ISSIMPLE
Definition: commctrl.h:1960
#define SB_GETTIPTEXTW
Definition: commctrl.h:1965
#define SB_SETTIPTEXTW
Definition: commctrl.h:1963
#define SB_SETMINHEIGHT
Definition: commctrl.h:1957
#define SB_SETTIPTEXTA
Definition: commctrl.h:1962
#define NM_RCLICK
Definition: commctrl.h:133
#define SB_GETUNICODEFORMAT
Definition: commctrl.h:1968
#define SB_SETPARTS
Definition: commctrl.h:1954
#define SB_SETTEXTW
Definition: commctrl.h:1942
#define SB_GETBORDERS
Definition: commctrl.h:1956
#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:1619
#define WM_GETTEXTLENGTH
Definition: winuser.h:1618
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1607
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1777
#define WM_NCHITTEST
Definition: winuser.h:1685
#define WM_RBUTTONUP
Definition: winuser.h:1779
#define WM_RBUTTONDBLCLK
Definition: winuser.h:1780
#define WM_MOUSEMOVE
Definition: winuser.h:1774
#define WM_GETTEXT
Definition: winuser.h:1617
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1625
#define WM_GETFONT
Definition: winuser.h:1650
#define WM_SETTEXT
Definition: winuser.h:1616
#define WM_SETFONT
Definition: winuser.h:1649
#define WM_LBUTTONUP
Definition: winuser.h:1776
#define WM_NCLBUTTONUP
Definition: winuser.h:1692
#define WM_USER
Definition: winuser.h:1894
#define WM_DESTROY
Definition: winuser.h:1608
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1691
char * LPSTR
Definition: xmlstorage.h:182

Referenced by STATUS_Register().

◆ theme_changed()

static LRESULT theme_changed ( const STATUS_INFO infoPtr)
static

Definition at line 1128 of file status.c.

1129{
1130 HTHEME theme = GetWindowTheme (infoPtr->Self);
1131 CloseThemeData (theme);
1132 OpenThemeData (infoPtr->Self, themeClass);
1133 return 0;
1134}

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 90 of file status.c.

Referenced by STATUSBAR_WMCreate(), and theme_changed().