BOOL NtfUnicode; /* notify format */
STATUSWINDOWPART part0; /* simple window */
STATUSWINDOWPART* parts;
-} STATUSWINDOWINFO;
+} STATUS_INFO;
/*
* Run tests using Waite Group Windows95 API Bible Vol. 1&2
#define VERT_BORDER 2
#define HORZ_GAP 2
-#define STATUSBAR_GetInfoPtr(hwnd) ((STATUSWINDOWINFO *)GetWindowLongPtrW (hwnd, 0))
-
/* prototype */
static void
-STATUSBAR_SetPartBounds (STATUSWINDOWINFO *infoPtr);
+STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr);
static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW)
{
static void
-STATUSBAR_DrawPart (HDC hdc, const STATUSWINDOWPART *part, const STATUSWINDOWINFO *infoPtr, int itemID)
+STATUSBAR_DrawPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, int itemID)
{
RECT r = part->bound;
UINT border = BDR_SUNKENOUTER;
static void
-STATUSBAR_RefreshPart (const STATUSWINDOWINFO *infoPtr, const STATUSWINDOWPART *part, HDC hdc, int itemID)
+STATUSBAR_RefreshPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, int itemID)
{
HBRUSH hbrBk;
HFONT hOldFont;
hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
- STATUSBAR_DrawPart (hdc, part, infoPtr, itemID);
+ STATUSBAR_DrawPart (infoPtr, hdc, part, itemID);
SelectObject (hdc, hOldFont);
static LRESULT
-STATUSBAR_Refresh (STATUSWINDOWINFO *infoPtr, HDC hdc)
+STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
{
int i;
RECT rect;
hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
if (infoPtr->simple) {
- STATUSBAR_RefreshPart (infoPtr, &infoPtr->part0, hdc, 0);
+ STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->part0, 0);
} else {
for (i = 0; i < infoPtr->numParts; i++) {
- STATUSBAR_RefreshPart (infoPtr, &infoPtr->parts[i], hdc, i);
+ STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->parts[i], i);
}
}
static void
-STATUSBAR_SetPartBounds (STATUSWINDOWINFO *infoPtr)
+STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr)
{
STATUSWINDOWPART *part;
RECT rect, *r;
static LRESULT
-STATUSBAR_Relay2Tip (STATUSWINDOWINFO *infoPtr, UINT uMsg,
+STATUSBAR_Relay2Tip (STATUS_INFO *infoPtr, UINT uMsg,
WPARAM wParam, LPARAM lParam)
{
MSG msg;
static HICON
-STATUSBAR_GetIcon (STATUSWINDOWINFO *infoPtr, INT nPart)
+STATUSBAR_GetIcon (STATUS_INFO *infoPtr, INT nPart)
{
TRACE("%d\n", nPart);
/* MSDN says: "simple parts are indexed with -1" */
static INT
-STATUSBAR_GetParts (STATUSWINDOWINFO *infoPtr, INT num_parts, INT parts[])
+STATUSBAR_GetParts (STATUS_INFO *infoPtr, INT num_parts, INT parts[])
{
INT i;
static BOOL
-STATUSBAR_GetRect (STATUSWINDOWINFO *infoPtr, INT nPart, LPRECT rect)
+STATUSBAR_GetRect (STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
{
TRACE("part %d\n", nPart);
if (infoPtr->simple)
static LRESULT
-STATUSBAR_GetTextA (STATUSWINDOWINFO *infoPtr, INT nPart, LPSTR buf)
+STATUSBAR_GetTextA (STATUS_INFO *infoPtr, INT nPart, LPSTR buf)
{
STATUSWINDOWPART *part;
LRESULT result;
static LRESULT
-STATUSBAR_GetTextW (STATUSWINDOWINFO *infoPtr, INT nPart, LPWSTR buf)
+STATUSBAR_GetTextW (STATUS_INFO *infoPtr, INT nPart, LPWSTR buf)
{
STATUSWINDOWPART *part;
LRESULT result;
static LRESULT
-STATUSBAR_GetTextLength (STATUSWINDOWINFO *infoPtr, INT nPart)
+STATUSBAR_GetTextLength (STATUS_INFO *infoPtr, INT nPart)
{
STATUSWINDOWPART *part;
DWORD result;
}
static LRESULT
-STATUSBAR_GetTipTextA (STATUSWINDOWINFO *infoPtr, INT id, LPSTR tip, INT size)
+STATUSBAR_GetTipTextA (STATUS_INFO *infoPtr, INT id, LPSTR tip, INT size)
{
TRACE("\n");
if (tip) {
static LRESULT
-STATUSBAR_GetTipTextW (STATUSWINDOWINFO *infoPtr, INT id, LPWSTR tip, INT size)
+STATUSBAR_GetTipTextW (STATUS_INFO *infoPtr, INT id, LPWSTR tip, INT size)
{
TRACE("\n");
if (tip) {
static COLORREF
-STATUSBAR_SetBkColor (STATUSWINDOWINFO *infoPtr, COLORREF color)
+STATUSBAR_SetBkColor (STATUS_INFO *infoPtr, COLORREF color)
{
COLORREF oldBkColor;
static BOOL
-STATUSBAR_SetIcon (STATUSWINDOWINFO *infoPtr, INT nPart, HICON hIcon)
+STATUSBAR_SetIcon (STATUS_INFO *infoPtr, INT nPart, HICON hIcon)
{
if ((nPart < -1) || (nPart >= infoPtr->numParts))
return FALSE;
static BOOL
-STATUSBAR_SetMinHeight (STATUSWINDOWINFO *infoPtr, INT height)
+STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
{
TRACE("(height=%d)\n", height);
static BOOL
-STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts)
+STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
{
STATUSWINDOWPART *tmp;
int i, oldNumParts;
static BOOL
-STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style,
+STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
LPCWSTR text, BOOL isW)
{
STATUSWINDOWPART *part=NULL;
static LRESULT
-STATUSBAR_SetTipTextA (STATUSWINDOWINFO *infoPtr, INT id, LPSTR text)
+STATUSBAR_SetTipTextA (STATUS_INFO *infoPtr, INT id, LPSTR text)
{
TRACE("part %d: \"%s\"\n", id, text);
if (infoPtr->hwndToolTip) {
static LRESULT
-STATUSBAR_SetTipTextW (STATUSWINDOWINFO *infoPtr, INT id, LPWSTR text)
+STATUSBAR_SetTipTextW (STATUS_INFO *infoPtr, INT id, LPWSTR text)
{
TRACE("part %d: \"%s\"\n", id, debugstr_w(text));
if (infoPtr->hwndToolTip) {
inline static LRESULT
-STATUSBAR_SetUnicodeFormat (STATUSWINDOWINFO *infoPtr, BOOL bUnicode)
+STATUSBAR_SetUnicodeFormat (STATUS_INFO *infoPtr, BOOL bUnicode)
{
BOOL bOld = infoPtr->bUnicode;
static BOOL
-STATUSBAR_Simple (STATUSWINDOWINFO *infoPtr, BOOL simple)
+STATUSBAR_Simple (STATUS_INFO *infoPtr, BOOL simple)
{
NMHDR nmhdr;
static LRESULT
-STATUSBAR_WMDestroy (STATUSWINDOWINFO *infoPtr)
+STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
{
int i;
static LRESULT
STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
{
- STATUSWINDOWINFO *infoPtr;
+ STATUS_INFO *infoPtr;
NONCLIENTMETRICSW nclm;
DWORD dwStyle;
RECT rect;
HDC hdc;
TRACE("\n");
- infoPtr = (STATUSWINDOWINFO*)Alloc (sizeof(STATUSWINDOWINFO));
+ infoPtr = (STATUS_INFO*)Alloc (sizeof(STATUS_INFO));
if (!infoPtr) goto create_fail;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
/* in contrast to SB_GETTEXT*, WM_GETTEXT handles the text
* of the first part only (usual behaviour) */
static INT
-STATUSBAR_WMGetText (STATUSWINDOWINFO *infoPtr, INT size, LPWSTR buf)
+STATUSBAR_WMGetText (STATUS_INFO *infoPtr, INT size, LPWSTR buf)
{
INT len;
static BOOL
-STATUSBAR_WMNCHitTest (STATUSWINDOWINFO *infoPtr, INT x, INT y)
+STATUSBAR_WMNCHitTest (STATUS_INFO *infoPtr, INT x, INT y)
{
if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) {
RECT rect;
static LRESULT
-STATUSBAR_WMPaint (STATUSWINDOWINFO *infoPtr, HDC hdc)
+STATUSBAR_WMPaint (STATUS_INFO *infoPtr, HDC hdc)
{
PAINTSTRUCT ps;
static LRESULT
-STATUSBAR_WMSetFont (STATUSWINDOWINFO *infoPtr, HFONT font, BOOL redraw)
+STATUSBAR_WMSetFont (STATUS_INFO *infoPtr, HFONT font, BOOL redraw)
{
infoPtr->hFont = font;
TRACE("%p\n", infoPtr->hFont);
static BOOL
-STATUSBAR_WMSetText (STATUSWINDOWINFO *infoPtr, LPCSTR text)
+STATUSBAR_WMSetText (STATUS_INFO *infoPtr, LPCSTR text)
{
STATUSWINDOWPART *part;
int len;
static BOOL
-STATUSBAR_WMSize (STATUSWINDOWINFO *infoPtr, WORD flags)
+STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags)
{
INT width, x, y;
RECT parent_rect;
static LRESULT
-STATUSBAR_NotifyFormat (STATUSWINDOWINFO *infoPtr, HWND from, INT cmd)
+STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
{
if (cmd == NF_REQUERY) {
INT i = SendMessageW(from, WM_NOTIFYFORMAT, (WPARAM)infoPtr->Self, NF_QUERY);
static LRESULT
-STATUSBAR_SendNotify (HWND hwnd, UINT code)
+STATUSBAR_SendNotify (STATUS_INFO *infoPtr, UINT code)
{
- STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr(hwnd);
NMHDR nmhdr;
TRACE("code %04x\n", code);
- nmhdr.hwndFrom = hwnd;
- nmhdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
+ nmhdr.hwndFrom = infoPtr->Self;
+ nmhdr.idFrom = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
nmhdr.code = code;
SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
return 0;
static LRESULT WINAPI
StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr(hwnd);
+ STATUS_INFO *infoPtr = (STATUS_INFO *)GetWindowLongPtrW (hwnd, 0);
INT nPart = ((INT) wParam) & 0x00ff;
LRESULT res;
return STATUSBAR_GetTextLength (infoPtr, 0);
case WM_LBUTTONDBLCLK:
- return STATUSBAR_SendNotify (hwnd, NM_DBLCLK);
+ return STATUSBAR_SendNotify (infoPtr, NM_DBLCLK);
case WM_LBUTTONUP:
- return STATUSBAR_SendNotify (hwnd, NM_CLICK);
+ return STATUSBAR_SendNotify (infoPtr, NM_CLICK);
case WM_MOUSEMOVE:
return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
case WM_RBUTTONDBLCLK:
- return STATUSBAR_SendNotify (hwnd, NM_RDBLCLK);
+ return STATUSBAR_SendNotify (infoPtr, NM_RDBLCLK);
case WM_RBUTTONUP:
- return STATUSBAR_SendNotify (hwnd, NM_RCLICK);
+ return STATUSBAR_SendNotify (infoPtr, NM_RCLICK);
case WM_SETFONT:
return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW;
wndClass.lpfnWndProc = StatusWindowProc;
wndClass.cbClsExtra = 0;
- wndClass.cbWndExtra = sizeof(STATUSWINDOWINFO *);
+ wndClass.cbWndExtra = sizeof(STATUS_INFO *);
wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wndClass.lpszClassName = STATUSCLASSNAMEW;