Commit 2bccfc4a authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

Rename STATUSWINDOWINFO to STATUS_INFO, for consistency with other

controls. Fix some prototypes. Always pass infoPtr around.
parent bc883009
...@@ -79,7 +79,7 @@ typedef struct ...@@ -79,7 +79,7 @@ typedef struct
BOOL NtfUnicode; /* notify format */ BOOL NtfUnicode; /* notify format */
STATUSWINDOWPART part0; /* simple window */ STATUSWINDOWPART part0; /* simple window */
STATUSWINDOWPART* parts; STATUSWINDOWPART* parts;
} STATUSWINDOWINFO; } STATUS_INFO;
/* /*
* Run tests using Waite Group Windows95 API Bible Vol. 1&2 * Run tests using Waite Group Windows95 API Bible Vol. 1&2
...@@ -91,11 +91,9 @@ typedef struct ...@@ -91,11 +91,9 @@ typedef struct
#define VERT_BORDER 2 #define VERT_BORDER 2
#define HORZ_GAP 2 #define HORZ_GAP 2
#define STATUSBAR_GetInfoPtr(hwnd) ((STATUSWINDOWINFO *)GetWindowLongPtrW (hwnd, 0))
/* prototype */ /* prototype */
static void static void
STATUSBAR_SetPartBounds (STATUSWINDOWINFO *infoPtr); STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr);
static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW) static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW)
{ {
...@@ -148,7 +146,7 @@ STATUSBAR_DrawSizeGrip (HDC hdc, LPRECT lpRect) ...@@ -148,7 +146,7 @@ STATUSBAR_DrawSizeGrip (HDC hdc, LPRECT lpRect)
static void 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; RECT r = part->bound;
UINT border = BDR_SUNKENOUTER; UINT border = BDR_SUNKENOUTER;
...@@ -189,7 +187,7 @@ STATUSBAR_DrawPart (HDC hdc, const STATUSWINDOWPART *part, const STATUSWINDOWINF ...@@ -189,7 +187,7 @@ STATUSBAR_DrawPart (HDC hdc, const STATUSWINDOWPART *part, const STATUSWINDOWINF
static void 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; HBRUSH hbrBk;
HFONT hOldFont; HFONT hOldFont;
...@@ -208,7 +206,7 @@ STATUSBAR_RefreshPart (const STATUSWINDOWINFO *infoPtr, const STATUSWINDOWPART * ...@@ -208,7 +206,7 @@ STATUSBAR_RefreshPart (const STATUSWINDOWINFO *infoPtr, const STATUSWINDOWPART *
hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont); hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
STATUSBAR_DrawPart (hdc, part, infoPtr, itemID); STATUSBAR_DrawPart (infoPtr, hdc, part, itemID);
SelectObject (hdc, hOldFont); SelectObject (hdc, hOldFont);
...@@ -226,7 +224,7 @@ STATUSBAR_RefreshPart (const STATUSWINDOWINFO *infoPtr, const STATUSWINDOWPART * ...@@ -226,7 +224,7 @@ STATUSBAR_RefreshPart (const STATUSWINDOWINFO *infoPtr, const STATUSWINDOWPART *
static LRESULT static LRESULT
STATUSBAR_Refresh (STATUSWINDOWINFO *infoPtr, HDC hdc) STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
{ {
int i; int i;
RECT rect; RECT rect;
...@@ -250,10 +248,10 @@ STATUSBAR_Refresh (STATUSWINDOWINFO *infoPtr, HDC hdc) ...@@ -250,10 +248,10 @@ STATUSBAR_Refresh (STATUSWINDOWINFO *infoPtr, HDC hdc)
hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont); hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
if (infoPtr->simple) { if (infoPtr->simple) {
STATUSBAR_RefreshPart (infoPtr, &infoPtr->part0, hdc, 0); STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->part0, 0);
} else { } else {
for (i = 0; i < infoPtr->numParts; i++) { for (i = 0; i < infoPtr->numParts; i++) {
STATUSBAR_RefreshPart (infoPtr, &infoPtr->parts[i], hdc, i); STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->parts[i], i);
} }
} }
...@@ -270,7 +268,7 @@ STATUSBAR_Refresh (STATUSWINDOWINFO *infoPtr, HDC hdc) ...@@ -270,7 +268,7 @@ STATUSBAR_Refresh (STATUSWINDOWINFO *infoPtr, HDC hdc)
static void static void
STATUSBAR_SetPartBounds (STATUSWINDOWINFO *infoPtr) STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr)
{ {
STATUSWINDOWPART *part; STATUSWINDOWPART *part;
RECT rect, *r; RECT rect, *r;
...@@ -315,7 +313,7 @@ STATUSBAR_SetPartBounds (STATUSWINDOWINFO *infoPtr) ...@@ -315,7 +313,7 @@ STATUSBAR_SetPartBounds (STATUSWINDOWINFO *infoPtr)
static LRESULT static LRESULT
STATUSBAR_Relay2Tip (STATUSWINDOWINFO *infoPtr, UINT uMsg, STATUSBAR_Relay2Tip (STATUS_INFO *infoPtr, UINT uMsg,
WPARAM wParam, LPARAM lParam) WPARAM wParam, LPARAM lParam)
{ {
MSG msg; MSG msg;
...@@ -345,7 +343,7 @@ STATUSBAR_GetBorders (INT out[]) ...@@ -345,7 +343,7 @@ STATUSBAR_GetBorders (INT out[])
static HICON static HICON
STATUSBAR_GetIcon (STATUSWINDOWINFO *infoPtr, INT nPart) STATUSBAR_GetIcon (STATUS_INFO *infoPtr, INT nPart)
{ {
TRACE("%d\n", nPart); TRACE("%d\n", nPart);
/* MSDN says: "simple parts are indexed with -1" */ /* MSDN says: "simple parts are indexed with -1" */
...@@ -360,7 +358,7 @@ STATUSBAR_GetIcon (STATUSWINDOWINFO *infoPtr, INT nPart) ...@@ -360,7 +358,7 @@ STATUSBAR_GetIcon (STATUSWINDOWINFO *infoPtr, INT nPart)
static INT static INT
STATUSBAR_GetParts (STATUSWINDOWINFO *infoPtr, INT num_parts, INT parts[]) STATUSBAR_GetParts (STATUS_INFO *infoPtr, INT num_parts, INT parts[])
{ {
INT i; INT i;
...@@ -375,7 +373,7 @@ STATUSBAR_GetParts (STATUSWINDOWINFO *infoPtr, INT num_parts, INT parts[]) ...@@ -375,7 +373,7 @@ STATUSBAR_GetParts (STATUSWINDOWINFO *infoPtr, INT num_parts, INT parts[])
static BOOL static BOOL
STATUSBAR_GetRect (STATUSWINDOWINFO *infoPtr, INT nPart, LPRECT rect) STATUSBAR_GetRect (STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
{ {
TRACE("part %d\n", nPart); TRACE("part %d\n", nPart);
if (infoPtr->simple) if (infoPtr->simple)
...@@ -387,7 +385,7 @@ STATUSBAR_GetRect (STATUSWINDOWINFO *infoPtr, INT nPart, LPRECT rect) ...@@ -387,7 +385,7 @@ STATUSBAR_GetRect (STATUSWINDOWINFO *infoPtr, INT nPart, LPRECT rect)
static LRESULT static LRESULT
STATUSBAR_GetTextA (STATUSWINDOWINFO *infoPtr, INT nPart, LPSTR buf) STATUSBAR_GetTextA (STATUS_INFO *infoPtr, INT nPart, LPSTR buf)
{ {
STATUSWINDOWPART *part; STATUSWINDOWPART *part;
LRESULT result; LRESULT result;
...@@ -416,7 +414,7 @@ STATUSBAR_GetTextA (STATUSWINDOWINFO *infoPtr, INT nPart, LPSTR buf) ...@@ -416,7 +414,7 @@ STATUSBAR_GetTextA (STATUSWINDOWINFO *infoPtr, INT nPart, LPSTR buf)
static LRESULT static LRESULT
STATUSBAR_GetTextW (STATUSWINDOWINFO *infoPtr, INT nPart, LPWSTR buf) STATUSBAR_GetTextW (STATUS_INFO *infoPtr, INT nPart, LPWSTR buf)
{ {
STATUSWINDOWPART *part; STATUSWINDOWPART *part;
LRESULT result; LRESULT result;
...@@ -442,7 +440,7 @@ STATUSBAR_GetTextW (STATUSWINDOWINFO *infoPtr, INT nPart, LPWSTR buf) ...@@ -442,7 +440,7 @@ STATUSBAR_GetTextW (STATUSWINDOWINFO *infoPtr, INT nPart, LPWSTR buf)
static LRESULT static LRESULT
STATUSBAR_GetTextLength (STATUSWINDOWINFO *infoPtr, INT nPart) STATUSBAR_GetTextLength (STATUS_INFO *infoPtr, INT nPart)
{ {
STATUSWINDOWPART *part; STATUSWINDOWPART *part;
DWORD result; DWORD result;
...@@ -467,7 +465,7 @@ STATUSBAR_GetTextLength (STATUSWINDOWINFO *infoPtr, INT nPart) ...@@ -467,7 +465,7 @@ STATUSBAR_GetTextLength (STATUSWINDOWINFO *infoPtr, INT nPart)
} }
static LRESULT 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"); TRACE("\n");
if (tip) { if (tip) {
...@@ -489,7 +487,7 @@ STATUSBAR_GetTipTextA (STATUSWINDOWINFO *infoPtr, INT id, LPSTR tip, INT size) ...@@ -489,7 +487,7 @@ STATUSBAR_GetTipTextA (STATUSWINDOWINFO *infoPtr, INT id, LPSTR tip, INT size)
static LRESULT 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"); TRACE("\n");
if (tip) { if (tip) {
...@@ -512,7 +510,7 @@ STATUSBAR_GetTipTextW (STATUSWINDOWINFO *infoPtr, INT id, LPWSTR tip, INT size) ...@@ -512,7 +510,7 @@ STATUSBAR_GetTipTextW (STATUSWINDOWINFO *infoPtr, INT id, LPWSTR tip, INT size)
static COLORREF static COLORREF
STATUSBAR_SetBkColor (STATUSWINDOWINFO *infoPtr, COLORREF color) STATUSBAR_SetBkColor (STATUS_INFO *infoPtr, COLORREF color)
{ {
COLORREF oldBkColor; COLORREF oldBkColor;
...@@ -526,7 +524,7 @@ STATUSBAR_SetBkColor (STATUSWINDOWINFO *infoPtr, COLORREF color) ...@@ -526,7 +524,7 @@ STATUSBAR_SetBkColor (STATUSWINDOWINFO *infoPtr, COLORREF color)
static BOOL 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)) if ((nPart < -1) || (nPart >= infoPtr->numParts))
return FALSE; return FALSE;
...@@ -553,7 +551,7 @@ STATUSBAR_SetIcon (STATUSWINDOWINFO *infoPtr, INT nPart, HICON hIcon) ...@@ -553,7 +551,7 @@ STATUSBAR_SetIcon (STATUSWINDOWINFO *infoPtr, INT nPart, HICON hIcon)
static BOOL static BOOL
STATUSBAR_SetMinHeight (STATUSWINDOWINFO *infoPtr, INT height) STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
{ {
TRACE("(height=%d)\n", height); TRACE("(height=%d)\n", height);
...@@ -577,7 +575,7 @@ STATUSBAR_SetMinHeight (STATUSWINDOWINFO *infoPtr, INT height) ...@@ -577,7 +575,7 @@ STATUSBAR_SetMinHeight (STATUSWINDOWINFO *infoPtr, INT height)
static BOOL static BOOL
STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts) STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
{ {
STATUSWINDOWPART *tmp; STATUSWINDOWPART *tmp;
int i, oldNumParts; int i, oldNumParts;
...@@ -647,7 +645,7 @@ STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts) ...@@ -647,7 +645,7 @@ STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts)
static BOOL static BOOL
STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style, STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
LPCWSTR text, BOOL isW) LPCWSTR text, BOOL isW)
{ {
STATUSWINDOWPART *part=NULL; STATUSWINDOWPART *part=NULL;
...@@ -715,7 +713,7 @@ STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style, ...@@ -715,7 +713,7 @@ STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style,
static LRESULT 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); TRACE("part %d: \"%s\"\n", id, text);
if (infoPtr->hwndToolTip) { if (infoPtr->hwndToolTip) {
...@@ -734,7 +732,7 @@ STATUSBAR_SetTipTextA (STATUSWINDOWINFO *infoPtr, INT id, LPSTR text) ...@@ -734,7 +732,7 @@ STATUSBAR_SetTipTextA (STATUSWINDOWINFO *infoPtr, INT id, LPSTR text)
static LRESULT 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)); TRACE("part %d: \"%s\"\n", id, debugstr_w(text));
if (infoPtr->hwndToolTip) { if (infoPtr->hwndToolTip) {
...@@ -753,7 +751,7 @@ STATUSBAR_SetTipTextW (STATUSWINDOWINFO *infoPtr, INT id, LPWSTR text) ...@@ -753,7 +751,7 @@ STATUSBAR_SetTipTextW (STATUSWINDOWINFO *infoPtr, INT id, LPWSTR text)
inline static LRESULT inline static LRESULT
STATUSBAR_SetUnicodeFormat (STATUSWINDOWINFO *infoPtr, BOOL bUnicode) STATUSBAR_SetUnicodeFormat (STATUS_INFO *infoPtr, BOOL bUnicode)
{ {
BOOL bOld = infoPtr->bUnicode; BOOL bOld = infoPtr->bUnicode;
...@@ -765,7 +763,7 @@ STATUSBAR_SetUnicodeFormat (STATUSWINDOWINFO *infoPtr, BOOL bUnicode) ...@@ -765,7 +763,7 @@ STATUSBAR_SetUnicodeFormat (STATUSWINDOWINFO *infoPtr, BOOL bUnicode)
static BOOL static BOOL
STATUSBAR_Simple (STATUSWINDOWINFO *infoPtr, BOOL simple) STATUSBAR_Simple (STATUS_INFO *infoPtr, BOOL simple)
{ {
NMHDR nmhdr; NMHDR nmhdr;
...@@ -786,7 +784,7 @@ STATUSBAR_Simple (STATUSWINDOWINFO *infoPtr, BOOL simple) ...@@ -786,7 +784,7 @@ STATUSBAR_Simple (STATUSWINDOWINFO *infoPtr, BOOL simple)
static LRESULT static LRESULT
STATUSBAR_WMDestroy (STATUSWINDOWINFO *infoPtr) STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
{ {
int i; int i;
...@@ -816,7 +814,7 @@ STATUSBAR_WMDestroy (STATUSWINDOWINFO *infoPtr) ...@@ -816,7 +814,7 @@ STATUSBAR_WMDestroy (STATUSWINDOWINFO *infoPtr)
static LRESULT static LRESULT
STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate) STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
{ {
STATUSWINDOWINFO *infoPtr; STATUS_INFO *infoPtr;
NONCLIENTMETRICSW nclm; NONCLIENTMETRICSW nclm;
DWORD dwStyle; DWORD dwStyle;
RECT rect; RECT rect;
...@@ -824,7 +822,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate) ...@@ -824,7 +822,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
HDC hdc; HDC hdc;
TRACE("\n"); TRACE("\n");
infoPtr = (STATUSWINDOWINFO*)Alloc (sizeof(STATUSWINDOWINFO)); infoPtr = (STATUS_INFO*)Alloc (sizeof(STATUS_INFO));
if (!infoPtr) goto create_fail; if (!infoPtr) goto create_fail;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
...@@ -944,7 +942,7 @@ create_fail: ...@@ -944,7 +942,7 @@ create_fail:
/* in contrast to SB_GETTEXT*, WM_GETTEXT handles the text /* in contrast to SB_GETTEXT*, WM_GETTEXT handles the text
* of the first part only (usual behaviour) */ * of the first part only (usual behaviour) */
static INT static INT
STATUSBAR_WMGetText (STATUSWINDOWINFO *infoPtr, INT size, LPWSTR buf) STATUSBAR_WMGetText (STATUS_INFO *infoPtr, INT size, LPWSTR buf)
{ {
INT len; INT len;
...@@ -970,7 +968,7 @@ STATUSBAR_WMGetText (STATUSWINDOWINFO *infoPtr, INT size, LPWSTR buf) ...@@ -970,7 +968,7 @@ STATUSBAR_WMGetText (STATUSWINDOWINFO *infoPtr, INT size, LPWSTR buf)
static BOOL 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) { if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) {
RECT rect; RECT rect;
...@@ -994,7 +992,7 @@ STATUSBAR_WMNCHitTest (STATUSWINDOWINFO *infoPtr, INT x, INT y) ...@@ -994,7 +992,7 @@ STATUSBAR_WMNCHitTest (STATUSWINDOWINFO *infoPtr, INT x, INT y)
static LRESULT static LRESULT
STATUSBAR_WMPaint (STATUSWINDOWINFO *infoPtr, HDC hdc) STATUSBAR_WMPaint (STATUS_INFO *infoPtr, HDC hdc)
{ {
PAINTSTRUCT ps; PAINTSTRUCT ps;
...@@ -1009,7 +1007,7 @@ STATUSBAR_WMPaint (STATUSWINDOWINFO *infoPtr, HDC hdc) ...@@ -1009,7 +1007,7 @@ STATUSBAR_WMPaint (STATUSWINDOWINFO *infoPtr, HDC hdc)
static LRESULT static LRESULT
STATUSBAR_WMSetFont (STATUSWINDOWINFO *infoPtr, HFONT font, BOOL redraw) STATUSBAR_WMSetFont (STATUS_INFO *infoPtr, HFONT font, BOOL redraw)
{ {
infoPtr->hFont = font; infoPtr->hFont = font;
TRACE("%p\n", infoPtr->hFont); TRACE("%p\n", infoPtr->hFont);
...@@ -1021,7 +1019,7 @@ STATUSBAR_WMSetFont (STATUSWINDOWINFO *infoPtr, HFONT font, BOOL redraw) ...@@ -1021,7 +1019,7 @@ STATUSBAR_WMSetFont (STATUSWINDOWINFO *infoPtr, HFONT font, BOOL redraw)
static BOOL static BOOL
STATUSBAR_WMSetText (STATUSWINDOWINFO *infoPtr, LPCSTR text) STATUSBAR_WMSetText (STATUS_INFO *infoPtr, LPCSTR text)
{ {
STATUSWINDOWPART *part; STATUSWINDOWPART *part;
int len; int len;
...@@ -1058,7 +1056,7 @@ STATUSBAR_WMSetText (STATUSWINDOWINFO *infoPtr, LPCSTR text) ...@@ -1058,7 +1056,7 @@ STATUSBAR_WMSetText (STATUSWINDOWINFO *infoPtr, LPCSTR text)
static BOOL static BOOL
STATUSBAR_WMSize (STATUSWINDOWINFO *infoPtr, WORD flags) STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags)
{ {
INT width, x, y; INT width, x, y;
RECT parent_rect; RECT parent_rect;
...@@ -1088,7 +1086,7 @@ STATUSBAR_WMSize (STATUSWINDOWINFO *infoPtr, WORD flags) ...@@ -1088,7 +1086,7 @@ STATUSBAR_WMSize (STATUSWINDOWINFO *infoPtr, WORD flags)
static LRESULT static LRESULT
STATUSBAR_NotifyFormat (STATUSWINDOWINFO *infoPtr, HWND from, INT cmd) STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
{ {
if (cmd == NF_REQUERY) { if (cmd == NF_REQUERY) {
INT i = SendMessageW(from, WM_NOTIFYFORMAT, (WPARAM)infoPtr->Self, NF_QUERY); INT i = SendMessageW(from, WM_NOTIFYFORMAT, (WPARAM)infoPtr->Self, NF_QUERY);
...@@ -1099,14 +1097,13 @@ STATUSBAR_NotifyFormat (STATUSWINDOWINFO *infoPtr, HWND from, INT cmd) ...@@ -1099,14 +1097,13 @@ STATUSBAR_NotifyFormat (STATUSWINDOWINFO *infoPtr, HWND from, INT cmd)
static LRESULT static LRESULT
STATUSBAR_SendNotify (HWND hwnd, UINT code) STATUSBAR_SendNotify (STATUS_INFO *infoPtr, UINT code)
{ {
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr(hwnd);
NMHDR nmhdr; NMHDR nmhdr;
TRACE("code %04x\n", code); TRACE("code %04x\n", code);
nmhdr.hwndFrom = hwnd; nmhdr.hwndFrom = infoPtr->Self;
nmhdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID); nmhdr.idFrom = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
nmhdr.code = code; nmhdr.code = code;
SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr); SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
return 0; return 0;
...@@ -1117,7 +1114,7 @@ STATUSBAR_SendNotify (HWND hwnd, UINT code) ...@@ -1117,7 +1114,7 @@ STATUSBAR_SendNotify (HWND hwnd, UINT code)
static LRESULT WINAPI static LRESULT WINAPI
StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 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; INT nPart = ((INT) wParam) & 0x00ff;
LRESULT res; LRESULT res;
...@@ -1206,10 +1203,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -1206,10 +1203,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return STATUSBAR_GetTextLength (infoPtr, 0); return STATUSBAR_GetTextLength (infoPtr, 0);
case WM_LBUTTONDBLCLK: case WM_LBUTTONDBLCLK:
return STATUSBAR_SendNotify (hwnd, NM_DBLCLK); return STATUSBAR_SendNotify (infoPtr, NM_DBLCLK);
case WM_LBUTTONUP: case WM_LBUTTONUP:
return STATUSBAR_SendNotify (hwnd, NM_CLICK); return STATUSBAR_SendNotify (infoPtr, NM_CLICK);
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam); return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
...@@ -1232,10 +1229,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -1232,10 +1229,10 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return STATUSBAR_WMPaint (infoPtr, (HDC)wParam); return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
case WM_RBUTTONDBLCLK: case WM_RBUTTONDBLCLK:
return STATUSBAR_SendNotify (hwnd, NM_RDBLCLK); return STATUSBAR_SendNotify (infoPtr, NM_RDBLCLK);
case WM_RBUTTONUP: case WM_RBUTTONUP:
return STATUSBAR_SendNotify (hwnd, NM_RCLICK); return STATUSBAR_SendNotify (infoPtr, NM_RCLICK);
case WM_SETFONT: case WM_SETFONT:
return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam)); return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
...@@ -1272,7 +1269,7 @@ STATUS_Register (void) ...@@ -1272,7 +1269,7 @@ STATUS_Register (void)
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW; wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW;
wndClass.lpfnWndProc = StatusWindowProc; wndClass.lpfnWndProc = StatusWindowProc;
wndClass.cbClsExtra = 0; wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(STATUSWINDOWINFO *); wndClass.cbWndExtra = sizeof(STATUS_INFO *);
wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW); wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wndClass.lpszClassName = STATUSCLASSNAMEW; wndClass.lpszClassName = STATUSCLASSNAMEW;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment