Make the controls send notifications to the parent window passed to

them in CREATESTRUCT.  Based on a treeview patch by Igor Grahek.
This commit is contained in:
Dimitrie O. Paun 2003-11-20 22:04:13 +00:00 committed by Alexandre Julliard
parent abeb325cdf
commit c594043316
14 changed files with 116 additions and 108 deletions

View File

@ -57,7 +57,8 @@ typedef struct
/* reference to input stream (file or resource) */ /* reference to input stream (file or resource) */
HGLOBAL hRes; HGLOBAL hRes;
HMMIO hMMio; /* handle to mmio stream */ HMMIO hMMio; /* handle to mmio stream */
HWND hWnd; HWND hwndSelf;
HWND hwndNotify;
/* information on the loaded AVI file */ /* information on the loaded AVI file */
MainAVIHeader mah; MainAVIHeader mah;
AVIStreamHeader ash; AVIStreamHeader ash;
@ -88,9 +89,9 @@ typedef struct
static void ANIMATE_Notify(ANIMATE_INFO* infoPtr, UINT notif) static void ANIMATE_Notify(ANIMATE_INFO* infoPtr, UINT notif)
{ {
SendMessageA(GetParent(infoPtr->hWnd), WM_COMMAND, SendMessageA(infoPtr->hwndNotify, WM_COMMAND,
MAKEWPARAM(GetDlgCtrlID(infoPtr->hWnd), notif), MAKEWPARAM(GetDlgCtrlID(infoPtr->hwndSelf), notif),
(LPARAM)infoPtr->hWnd); (LPARAM)infoPtr->hwndSelf);
} }
static BOOL ANIMATE_LoadResA(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPSTR lpName) static BOOL ANIMATE_LoadResA(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPSTR lpName)
@ -149,7 +150,7 @@ static LRESULT ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
infoPtr->hThread = 0; infoPtr->hThread = 0;
} }
if (infoPtr->uTimer) { if (infoPtr->uTimer) {
KillTimer(infoPtr->hWnd, infoPtr->uTimer); KillTimer(infoPtr->hwndSelf, infoPtr->uTimer);
infoPtr->uTimer = 0; infoPtr->uTimer = 0;
} }
@ -202,7 +203,7 @@ static void ANIMATE_Free(ANIMATE_INFO *infoPtr)
infoPtr->hbmPrevFrame = 0; infoPtr->hbmPrevFrame = 0;
} }
infoPtr->indata = infoPtr->outdata = NULL; infoPtr->indata = infoPtr->outdata = NULL;
infoPtr->hWnd = 0; infoPtr->hwndSelf = 0;
infoPtr->hMMio = 0; infoPtr->hMMio = 0;
memset(&infoPtr->mah, 0, sizeof(infoPtr->mah)); memset(&infoPtr->mah, 0, sizeof(infoPtr->mah));
@ -297,7 +298,7 @@ static LRESULT ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
infoPtr->transparentColor = GetPixel(hdcMem,0,0); infoPtr->transparentColor = GetPixel(hdcMem,0,0);
} }
if(GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_TRANSPARENT) if(GetWindowLongA(infoPtr->hwndSelf, GWL_STYLE) & ACS_TRANSPARENT)
{ {
HDC hdcFinal = CreateCompatibleDC(hDC); HDC hdcFinal = CreateCompatibleDC(hDC);
HBITMAP hbmFinal = CreateCompatibleBitmap(hDC,nWidth, nHeight); HBITMAP hbmFinal = CreateCompatibleBitmap(hDC,nWidth, nHeight);
@ -322,11 +323,11 @@ static LRESULT ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
infoPtr->hbmPrevFrame = hbmFinal; infoPtr->hbmPrevFrame = hbmFinal;
} }
if (GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_CENTER) if (GetWindowLongA(infoPtr->hwndSelf, GWL_STYLE) & ACS_CENTER)
{ {
RECT rect; RECT rect;
GetWindowRect(infoPtr->hWnd, &rect); GetWindowRect(infoPtr->hwndSelf, &rect);
nOffsetX = ((rect.right - rect.left) - nWidth)/2; nOffsetX = ((rect.right - rect.left) - nWidth)/2;
nOffsetY = ((rect.bottom - rect.top) - nHeight)/2; nOffsetY = ((rect.bottom - rect.top) - nHeight)/2;
} }
@ -356,9 +357,9 @@ static LRESULT ANIMATE_DrawFrame(ANIMATE_INFO* infoPtr)
return FALSE; return FALSE;
} }
if ((hDC = GetDC(infoPtr->hWnd)) != 0) { if ((hDC = GetDC(infoPtr->hwndSelf)) != 0) {
ANIMATE_PaintFrame(infoPtr, hDC); ANIMATE_PaintFrame(infoPtr, hDC);
ReleaseDC(infoPtr->hWnd, hDC); ReleaseDC(infoPtr->hwndSelf, hDC);
} }
if (infoPtr->currFrame++ >= infoPtr->nToFrame) { if (infoPtr->currFrame++ >= infoPtr->nToFrame) {
@ -387,15 +388,15 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
while(1) while(1)
{ {
if(GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_TRANSPARENT) if(GetWindowLongA(infoPtr->hwndSelf, GWL_STYLE) & ACS_TRANSPARENT)
{ {
hDC = GetDC(infoPtr->hWnd); hDC = GetDC(infoPtr->hwndSelf);
/* sometimes the animation window will be destroyed in between /* sometimes the animation window will be destroyed in between
* by the main program, so a ReleaseDC() error msg is possible */ * by the main program, so a ReleaseDC() error msg is possible */
infoPtr->hbrushBG = (HBRUSH)SendMessageA(GetParent(infoPtr->hWnd), infoPtr->hbrushBG = (HBRUSH)SendMessageA(infoPtr->hwndNotify,
WM_CTLCOLORSTATIC, (WPARAM)hDC, WM_CTLCOLORSTATIC, (WPARAM)hDC,
(LPARAM)infoPtr->hWnd); (LPARAM)infoPtr->hwndSelf);
ReleaseDC(infoPtr->hWnd,hDC); ReleaseDC(infoPtr->hwndSelf,hDC);
} }
EnterCriticalSection(&infoPtr->cs); EnterCriticalSection(&infoPtr->cs);
@ -689,7 +690,7 @@ static LRESULT ANIMATE_OpenA(HWND hWnd, WPARAM wParam, LPARAM lParam)
HINSTANCE hInstance = (HINSTANCE)wParam; HINSTANCE hInstance = (HINSTANCE)wParam;
ANIMATE_Free(infoPtr); ANIMATE_Free(infoPtr);
infoPtr->hWnd = hWnd; infoPtr->hwndSelf = hWnd;
if (!lParam) { if (!lParam) {
TRACE("Closing avi!\n"); TRACE("Closing avi!\n");
@ -787,14 +788,15 @@ static LRESULT ANIMATE_Create(HWND hWnd, WPARAM wParam, LPARAM lParam)
return 0; return 0;
} }
TRACE("Animate style=0x%08lx, parent=%08lx\n", GetWindowLongA(hWnd, GWL_STYLE), (DWORD)GetParent(hWnd));
/* store crossref hWnd <-> info structure */ /* store crossref hWnd <-> info structure */
SetWindowLongA(hWnd, 0, (DWORD)infoPtr); SetWindowLongA(hWnd, 0, (DWORD)infoPtr);
infoPtr->hWnd = hWnd; infoPtr->hwndSelf = hWnd;
infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent;
infoPtr->transparentColor = ANIMATE_COLOR_NONE; infoPtr->transparentColor = ANIMATE_COLOR_NONE;
infoPtr->hbmPrevFrame = 0; infoPtr->hbmPrevFrame = 0;
TRACE("Animate style=0x%08lx, parent=%08lx\n", GetWindowLongA(hWnd, GWL_STYLE), (DWORD)infoPtr->hwndNotify);
InitializeCriticalSection(&infoPtr->cs); InitializeCriticalSection(&infoPtr->cs);
return 0; return 0;
@ -819,12 +821,13 @@ static LRESULT ANIMATE_Destroy(HWND hWnd, WPARAM wParam, LPARAM lParam)
static LRESULT ANIMATE_EraseBackground(HWND hWnd, WPARAM wParam, LPARAM lParam) static LRESULT ANIMATE_EraseBackground(HWND hWnd, WPARAM wParam, LPARAM lParam)
{ {
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hWnd);
RECT rect; RECT rect;
HBRUSH hBrush = 0; HBRUSH hBrush = 0;
if(GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT) if(GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
{ {
hBrush = (HBRUSH)SendMessageA(GetParent(hWnd),WM_CTLCOLORSTATIC, hBrush = (HBRUSH)SendMessageA(infoPtr->hwndNotify,WM_CTLCOLORSTATIC,
wParam, (LPARAM)hWnd); wParam, (LPARAM)hWnd);
} }
@ -882,7 +885,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT) if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
{ {
ANIMATE_INFO* infoPtr = ANIMATE_GetInfoPtr(hWnd); ANIMATE_INFO* infoPtr = ANIMATE_GetInfoPtr(hWnd);
infoPtr->hbrushBG = (HBRUSH)SendMessageA(GetParent(hWnd), infoPtr->hbrushBG = (HBRUSH)SendMessageA(infoPtr->hwndNotify,
WM_CTLCOLORSTATIC, WM_CTLCOLORSTATIC,
wParam, (LPARAM)hWnd); wParam, (LPARAM)hWnd);
} }
@ -902,7 +905,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
return DefWindowProcA(hWnd, uMsg, wParam, lParam); return DefWindowProcA(hWnd, uMsg, wParam, lParam);
if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT) if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
infoPtr->hbrushBG = (HBRUSH)SendMessageA(GetParent(hWnd), infoPtr->hbrushBG = (HBRUSH)SendMessageA(infoPtr->hwndNotify,
WM_CTLCOLORSTATIC, WM_CTLCOLORSTATIC,
wParam, (LPARAM)hWnd); wParam, (LPARAM)hWnd);

View File

@ -64,6 +64,7 @@ typedef struct
{ {
HIMAGELIST himl; HIMAGELIST himl;
HWND hwndSelf; /* my own hwnd */ HWND hwndSelf; /* my own hwnd */
HWND hwndNotify; /* my parent hwnd */
HWND hwndCombo; HWND hwndCombo;
HWND hwndEdit; HWND hwndEdit;
WNDPROC prevEditWndProc; /* previous Edit WNDPROC value */ WNDPROC prevEditWndProc; /* previous Edit WNDPROC value */
@ -190,11 +191,9 @@ static INT COMBOEX_Notify (COMBOEX_INFO *infoPtr, INT code, NMHDR *hdr)
hdr->hwndFrom = infoPtr->hwndSelf; hdr->hwndFrom = infoPtr->hwndSelf;
hdr->code = code; hdr->code = code;
if (infoPtr->NtfUnicode) if (infoPtr->NtfUnicode)
return SendMessageW (GetParent(infoPtr->hwndSelf), WM_NOTIFY, 0, return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, 0, (LPARAM)hdr);
(LPARAM)hdr);
else else
return SendMessageA (GetParent(infoPtr->hwndSelf), WM_NOTIFY, 0, return SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, 0, (LPARAM)hdr);
(LPARAM)hdr);
} }
@ -935,8 +934,9 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
infoPtr->selected = -1; infoPtr->selected = -1;
infoPtr->unicode = IsWindowUnicode (hwnd); infoPtr->unicode = IsWindowUnicode (hwnd);
infoPtr->hwndNotify = cs->hwndParent;
i = SendMessageW(GetParent (hwnd), WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY); i = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);
if ((i != NFR_ANSI) && (i != NFR_UNICODE)) { if ((i != NFR_ANSI) && (i != NFR_UNICODE)) {
WARN("wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n", i); WARN("wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n", i);
i = NFR_ANSI; i = NFR_ANSI;
@ -1079,7 +1079,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa
INT cursel, n, oldItem; INT cursel, n, oldItem;
NMCBEENDEDITW cbeend; NMCBEENDEDITW cbeend;
DWORD oldflags; DWORD oldflags;
HWND parent = GetParent (infoPtr->hwndSelf); HWND parent = infoPtr->hwndNotify;
TRACE("for command %d\n", command); TRACE("for command %d\n", command);
@ -1587,7 +1587,7 @@ static LRESULT COMBOEX_NCCreate (HWND hwnd)
static LRESULT COMBOEX_NotifyFormat (COMBOEX_INFO *infoPtr, LPARAM lParam) static LRESULT COMBOEX_NotifyFormat (COMBOEX_INFO *infoPtr, LPARAM lParam)
{ {
if (lParam == NF_REQUERY) { if (lParam == NF_REQUERY) {
INT i = SendMessageW(GetParent (infoPtr->hwndSelf), INT i = SendMessageW(infoPtr->hwndNotify,
WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY); WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
infoPtr->NtfUnicode = (i == NFR_UNICODE) ? 1 : 0; infoPtr->NtfUnicode = (i == NFR_UNICODE) ? 1 : 0;
} }
@ -2070,7 +2070,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* strings not equal -- indicate edit has changed */ /* strings not equal -- indicate edit has changed */
infoPtr->flags |= WCBE_EDITCHG; infoPtr->flags |= WCBE_EDITCHG;
} }
SendMessageW ( GetParent(infoPtr->hwndSelf), WM_COMMAND, SendMessageW ( infoPtr->hwndNotify, WM_COMMAND,
MAKEWPARAM(GetDlgCtrlID (infoPtr->hwndSelf), MAKEWPARAM(GetDlgCtrlID (infoPtr->hwndSelf),
CBN_EDITCHANGE), CBN_EDITCHANGE),
(LPARAM)infoPtr->hwndSelf); (LPARAM)infoPtr->hwndSelf);
@ -2236,9 +2236,9 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFY: case WM_NOTIFY:
if (infoPtr->NtfUnicode) if (infoPtr->NtfUnicode)
return SendMessageW (GetParent (hwnd), uMsg, wParam, lParam); return SendMessageW (infoPtr->hwndNotify, uMsg, wParam, lParam);
else else
return SendMessageA (GetParent (hwnd), uMsg, wParam, lParam); return SendMessageA (infoPtr->hwndNotify, uMsg, wParam, lParam);
/* Window messages we need to process */ /* Window messages we need to process */

View File

@ -44,6 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(datetime);
typedef struct typedef struct
{ {
HWND hMonthCal; HWND hMonthCal;
HWND hwndNotify;
HWND hUpdown; HWND hUpdown;
SYSTEMTIME date; SYSTEMTIME date;
BOOL dateValid; BOOL dateValid;
@ -895,11 +896,8 @@ DATETIME_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
else else
ShowWindow(infoPtr->hMonthCal, SW_SHOW); ShowWindow(infoPtr->hMonthCal, SW_SHOW);
TRACE ("dt:%p mc:%p mc parent:%p, desktop:%p, mcpp:%p\n", TRACE ("dt:%p mc:%p mc parent:%p, desktop:%p\n",
hwnd,infoPtr->hMonthCal, hwnd, infoPtr->hMonthCal, infoPtr->hwndNotify, GetDesktopWindow ());
GetParent (infoPtr->hMonthCal),
GetDesktopWindow (),
GetParent (GetParent (infoPtr->hMonthCal)));
DATETIME_SendSimpleNotify (hwnd, DTN_DROPDOWN); DATETIME_SendSimpleNotify (hwnd, DTN_DROPDOWN);
} }
@ -1119,7 +1117,7 @@ DATETIME_SendDateTimeChangeNotify (HWND hwnd)
dtdtc.dwFlags = GDT_VALID; dtdtc.dwFlags = GDT_VALID;
MONTHCAL_CopyTime (&infoPtr->date, &dtdtc.st); MONTHCAL_CopyTime (&infoPtr->date, &dtdtc.st);
return (BOOL) SendMessageA (GetParent (hwnd), WM_NOTIFY, return (BOOL) SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)dtdtc.nmhdr.idFrom, (LPARAM)&dtdtc); (WPARAM)dtdtc.nmhdr.idFrom, (LPARAM)&dtdtc);
} }
@ -1127,6 +1125,7 @@ DATETIME_SendDateTimeChangeNotify (HWND hwnd)
static BOOL static BOOL
DATETIME_SendSimpleNotify (HWND hwnd, UINT code) DATETIME_SendSimpleNotify (HWND hwnd, UINT code)
{ {
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
NMHDR nmhdr; NMHDR nmhdr;
TRACE("%x\n",code); TRACE("%x\n",code);
@ -1134,7 +1133,7 @@ DATETIME_SendSimpleNotify (HWND hwnd, UINT code)
nmhdr.idFrom = GetWindowLongA( hwnd, GWL_ID); nmhdr.idFrom = GetWindowLongA( hwnd, GWL_ID);
nmhdr.code = code; nmhdr.code = code;
return (BOOL) SendMessageA (GetParent (hwnd), WM_NOTIFY, return (BOOL) SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr); (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
} }
@ -1225,6 +1224,7 @@ DATETIME_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->fieldRect = (RECT *) Alloc (32*sizeof(RECT)); infoPtr->fieldRect = (RECT *) Alloc (32*sizeof(RECT));
infoPtr->buflen = (int *) Alloc (32*sizeof(int)); infoPtr->buflen = (int *) Alloc (32*sizeof(int));
infoPtr->nrFieldsAllocated = 32; infoPtr->nrFieldsAllocated = 32;
infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent;
DATETIME_SetFormat (hwnd, 0, 0); DATETIME_SetFormat (hwnd, 0, 0);
@ -1232,7 +1232,7 @@ DATETIME_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->hMonthCal = CreateWindowExA (0,"SysMonthCal32", 0, infoPtr->hMonthCal = CreateWindowExA (0,"SysMonthCal32", 0,
WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS, WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS,
0, 0, 0, 0, 0, 0, 0, 0,
GetParent(hwnd), infoPtr->hwndNotify,
0, 0, 0); 0, 0, 0);
/* initialize info structure */ /* initialize info structure */

View File

@ -199,7 +199,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
dis.rcItem = r; dis.rcItem = r;
dis.itemData = phdi->lParam; dis.itemData = phdi->lParam;
oldBkMode = SetBkMode(hdc, TRANSPARENT); oldBkMode = SetBkMode(hdc, TRANSPARENT);
SendMessageA (GetParent (hwnd), WM_DRAWITEM, SendMessageA (infoPtr->hwndNotify, WM_DRAWITEM,
(WPARAM)dis.CtlID, (LPARAM)&dis); (WPARAM)dis.CtlID, (LPARAM)&dis);
if (oldBkMode != TRANSPARENT) if (oldBkMode != TRANSPARENT)
SetBkMode(hdc, oldBkMode); SetBkMode(hdc, oldBkMode);
@ -1287,7 +1287,7 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr = (HEADER_INFO *)Alloc (sizeof(HEADER_INFO)); infoPtr = (HEADER_INFO *)Alloc (sizeof(HEADER_INFO));
SetWindowLongA (hwnd, 0, (DWORD)infoPtr); SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
infoPtr->hwndNotify = GetParent(hwnd); infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent;
infoPtr->uNumItem = 0; infoPtr->uNumItem = 0;
infoPtr->hFont = 0; infoPtr->hFont = 0;
infoPtr->items = 0; infoPtr->items = 0;

View File

@ -38,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(hotkey);
typedef struct tagHOTKEY_INFO typedef struct tagHOTKEY_INFO
{ {
HWND hwndSelf; HWND hwndSelf;
HWND hwndNotify;
HFONT hFont; HFONT hFont;
BOOL bFocus; BOOL bFocus;
INT nHeight; INT nHeight;
@ -222,6 +223,7 @@ HOTKEY_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->HotKey = infoPtr->InvComb = infoPtr->InvMod = infoPtr->CurrMod = 0; infoPtr->HotKey = infoPtr->InvComb = infoPtr->InvMod = infoPtr->CurrMod = 0;
infoPtr->CaretPos = 2; infoPtr->CaretPos = 2;
infoPtr->hwndSelf = hwnd; infoPtr->hwndSelf = hwnd;
infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent;
LoadStringW(COMCTL32_hModule, HKY_NONE, infoPtr->strNone, 15); LoadStringW(COMCTL32_hModule, HKY_NONE, infoPtr->strNone, 15);
/* get default font height */ /* get default font height */
@ -252,7 +254,7 @@ HOTKEY_EraseBackground (HOTKEY_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
RECT rc; RECT rc;
hBrush = hBrush =
(HBRUSH)SendMessageW (GetParent (infoPtr->hwndSelf), WM_CTLCOLOREDIT, (HBRUSH)SendMessageW (infoPtr->hwndNotify, WM_CTLCOLOREDIT,
wParam, (LPARAM)infoPtr->hwndSelf); wParam, (LPARAM)infoPtr->hwndSelf);
if (hBrush) if (hBrush)
hBrush = (HBRUSH)GetStockObject (WHITE_BRUSH); hBrush = (HBRUSH)GetStockObject (WHITE_BRUSH);

View File

@ -61,6 +61,7 @@ typedef struct
typedef struct typedef struct
{ {
HWND Self; HWND Self;
HWND Notify;
IPPART_INFO Part[4]; IPPART_INFO Part[4];
} IPADDRESS_INFO; } IPADDRESS_INFO;
@ -82,7 +83,7 @@ static LRESULT IPADDRESS_Notify (IPADDRESS_INFO *infoPtr, UINT command)
TRACE("(command=%x)\n", command); TRACE("(command=%x)\n", command);
return SendMessageW (GetParent (hwnd), WM_COMMAND, return SendMessageW (infoPtr->Notify, WM_COMMAND,
MAKEWPARAM (GetWindowLongW (hwnd, GWL_ID), command), (LPARAM)hwnd); MAKEWPARAM (GetWindowLongW (hwnd, GWL_ID), command), (LPARAM)hwnd);
} }
@ -99,7 +100,7 @@ static INT IPADDRESS_IPNotify (IPADDRESS_INFO *infoPtr, INT field, INT value)
nmip.iField = field; nmip.iField = field;
nmip.iValue = value; nmip.iValue = value;
SendMessageW (GetParent (infoPtr->Self), WM_NOTIFY, SendMessageW (infoPtr->Notify, WM_NOTIFY,
(WPARAM)nmip.hdr.idFrom, (LPARAM)&nmip); (WPARAM)nmip.hdr.idFrom, (LPARAM)&nmip);
TRACE("<-- %d\n", nmip.iValue); TRACE("<-- %d\n", nmip.iValue);
@ -149,7 +150,7 @@ static LRESULT IPADDRESS_Draw (IPADDRESS_INFO *infoPtr, HDC hdc)
} }
static LRESULT IPADDRESS_Create (HWND hwnd) static LRESULT IPADDRESS_Create (HWND hwnd, LPCREATESTRUCTA lpCreate)
{ {
IPADDRESS_INFO *infoPtr; IPADDRESS_INFO *infoPtr;
RECT rcClient, edit; RECT rcClient, edit;
@ -173,6 +174,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd)
edit.bottom = rcClient.bottom - 2; edit.bottom = rcClient.bottom - 2;
infoPtr->Self = hwnd; infoPtr->Self = hwnd;
infoPtr->Notify = lpCreate->hwndParent;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
IPPART_INFO* part = &infoPtr->Part[i]; IPPART_INFO* part = &infoPtr->Part[i];
@ -508,7 +510,7 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch (uMsg) switch (uMsg)
{ {
case WM_CREATE: case WM_CREATE:
return IPADDRESS_Create (hwnd); return IPADDRESS_Create (hwnd, (LPCREATESTRUCTA)lParam);
case WM_DESTROY: case WM_DESTROY:
return IPADDRESS_Destroy (infoPtr); return IPADDRESS_Destroy (infoPtr);

View File

@ -104,6 +104,7 @@ typedef struct
RECT days; /* calendar area */ RECT days; /* calendar area */
RECT weeknums; /* week numbers at left side */ RECT weeknums; /* week numbers at left side */
RECT todayrect; /* `today: xx/xx/xx' text rect */ RECT todayrect; /* `today: xx/xx/xx' text rect */
HWND hwndNotify; /* Window to receive the notifications */
HWND hWndYearEdit; /* Window Handle of edit box to handle years */ HWND hWndYearEdit; /* Window Handle of edit box to handle years */
HWND hWndYearUpDown;/* Window Handle of updown box to handle years */ HWND hWndYearUpDown;/* Window Handle of updown box to handle years */
} MONTHCAL_INFO, *LPMONTHCAL_INFO; } MONTHCAL_INFO, *LPMONTHCAL_INFO;
@ -1304,7 +1305,7 @@ static void MONTHCAL_GoToNextMonth(HWND hwnd, MONTHCAL_INFO *infoPtr)
nmds.cDayState = infoPtr->monthRange; nmds.cDayState = infoPtr->monthRange;
nmds.prgDayState = Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE)); nmds.prgDayState = Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE));
SendMessageA(GetParent(hwnd), WM_NOTIFY, SendMessageA(infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmds.nmhdr.idFrom, (LPARAM)&nmds); (WPARAM)nmds.nmhdr.idFrom, (LPARAM)&nmds);
for(i=0; i<infoPtr->monthRange; i++) for(i=0; i<infoPtr->monthRange; i++)
infoPtr->monthdayState[i] = nmds.prgDayState[i]; infoPtr->monthdayState[i] = nmds.prgDayState[i];
@ -1335,7 +1336,7 @@ static void MONTHCAL_GoToPrevMonth(HWND hwnd, MONTHCAL_INFO *infoPtr)
nmds.prgDayState = Alloc nmds.prgDayState = Alloc
(infoPtr->monthRange * sizeof(MONTHDAYSTATE)); (infoPtr->monthRange * sizeof(MONTHDAYSTATE));
SendMessageA(GetParent(hwnd), WM_NOTIFY, SendMessageA(infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmds.nmhdr.idFrom, (LPARAM)&nmds); (WPARAM)nmds.nmhdr.idFrom, (LPARAM)&nmds);
for(i=0; i<infoPtr->monthRange; i++) for(i=0; i<infoPtr->monthRange; i++)
infoPtr->monthdayState[i] = nmds.prgDayState[i]; infoPtr->monthdayState[i] = nmds.prgDayState[i];
@ -1489,7 +1490,7 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
MONTHCAL_CopyTime(&nmsc.stSelStart, &infoPtr->minSel); MONTHCAL_CopyTime(&nmsc.stSelStart, &infoPtr->minSel);
MONTHCAL_CopyTime(&nmsc.stSelEnd, &infoPtr->maxSel); MONTHCAL_CopyTime(&nmsc.stSelEnd, &infoPtr->maxSel);
SendMessageA(GetParent(hwnd), WM_NOTIFY, SendMessageA(infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmsc.nmhdr.idFrom,(LPARAM)&nmsc); (WPARAM)nmsc.nmhdr.idFrom,(LPARAM)&nmsc);
MONTHCAL_CopyTime(&ht.st, &selArray[0]); MONTHCAL_CopyTime(&ht.st, &selArray[0]);
@ -1555,9 +1556,9 @@ MONTHCAL_LButtonUp(HWND hwnd, WPARAM wParam, LPARAM lParam)
nmhdr.hwndFrom = hwnd; nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongA( hwnd, GWL_ID); nmhdr.idFrom = GetWindowLongA( hwnd, GWL_ID);
nmhdr.code = NM_RELEASEDCAPTURE; nmhdr.code = NM_RELEASEDCAPTURE;
TRACE("Sent notification from %p to %p\n", hwnd, GetParent(hwnd)); TRACE("Sent notification from %p to %p\n", hwnd, infoPtr->hwndNotify);
SendMessageA(GetParent(hwnd), WM_NOTIFY, SendMessageA(infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr); (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
nmsc.nmhdr.hwndFrom = hwnd; nmsc.nmhdr.hwndFrom = hwnd;
@ -1566,7 +1567,7 @@ MONTHCAL_LButtonUp(HWND hwnd, WPARAM wParam, LPARAM lParam)
MONTHCAL_CopyTime(&nmsc.stSelStart, &infoPtr->minSel); MONTHCAL_CopyTime(&nmsc.stSelStart, &infoPtr->minSel);
MONTHCAL_CopyTime(&nmsc.stSelEnd, &infoPtr->maxSel); MONTHCAL_CopyTime(&nmsc.stSelEnd, &infoPtr->maxSel);
SendMessageA(GetParent(hwnd), WM_NOTIFY, SendMessageA(infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmsc.nmhdr.idFrom, (LPARAM)&nmsc); (WPARAM)nmsc.nmhdr.idFrom, (LPARAM)&nmsc);
/* redraw if necessary */ /* redraw if necessary */
@ -1881,6 +1882,8 @@ MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam)
return 0; return 0;
} }
infoPtr->hwndNotify = ((LPCREATESTRUCTW)lParam)->hwndParent;
infoPtr->hFont = GetStockObject(DEFAULT_GUI_FONT); infoPtr->hFont = GetStockObject(DEFAULT_GUI_FONT);
GetObjectA(infoPtr->hFont, sizeof(LOGFONTA), &logFont); GetObjectA(infoPtr->hFont, sizeof(LOGFONTA), &logFont);
logFont.lfWeight = FW_BOLD; logFont.lfWeight = FW_BOLD;

View File

@ -44,6 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(pager);
typedef struct typedef struct
{ {
HWND hwndChild; /* handle of the contained wnd */ HWND hwndChild; /* handle of the contained wnd */
HWND hwndNotify; /* handle of the parent wnd */
BOOL bNoResize; /* set when created with CCS_NORESIZE */ BOOL bNoResize; /* set when created with CCS_NORESIZE */
COLORREF clrBk; /* background color */ COLORREF clrBk; /* background color */
INT nBorder; /* border size for the control */ INT nBorder; /* border size for the control */
@ -325,6 +326,7 @@ PAGER_GetBkColor(HWND hwnd)
static void static void
PAGER_CalcSize (HWND hwnd, INT* size, BOOL getWidth) PAGER_CalcSize (HWND hwnd, INT* size, BOOL getWidth)
{ {
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
NMPGCALCSIZE nmpgcs; NMPGCALCSIZE nmpgcs;
ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE)); ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
nmpgcs.hdr.hwndFrom = hwnd; nmpgcs.hdr.hwndFrom = hwnd;
@ -333,7 +335,7 @@ PAGER_CalcSize (HWND hwnd, INT* size, BOOL getWidth)
nmpgcs.dwFlag = getWidth ? PGF_CALCWIDTH : PGF_CALCHEIGHT; nmpgcs.dwFlag = getWidth ? PGF_CALCWIDTH : PGF_CALCHEIGHT;
nmpgcs.iWidth = getWidth ? *size : 0; nmpgcs.iWidth = getWidth ? *size : 0;
nmpgcs.iHeight = getWidth ? 0 : *size; nmpgcs.iHeight = getWidth ? 0 : *size;
SendMessageA (GetParent (hwnd), WM_NOTIFY, SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmpgcs.hdr.idFrom, (LPARAM)&nmpgcs); (WPARAM)nmpgcs.hdr.idFrom, (LPARAM)&nmpgcs);
*size = getWidth ? nmpgcs.iWidth : nmpgcs.iHeight; *size = getWidth ? nmpgcs.iWidth : nmpgcs.iHeight;
@ -795,7 +797,7 @@ PAGER_Scroll(HWND hwnd, INT dir)
} }
nmpgScroll.iScroll -= 2*infoPtr->nButtonSize; nmpgScroll.iScroll -= 2*infoPtr->nButtonSize;
SendMessageA (GetParent(hwnd), WM_NOTIFY, SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmpgScroll.hdr.idFrom, (LPARAM)&nmpgScroll); (WPARAM)nmpgScroll.hdr.idFrom, (LPARAM)&nmpgScroll);
TRACE("[%p] PGN_SCROLL returns iScroll=%d\n", hwnd, nmpgScroll.iScroll); TRACE("[%p] PGN_SCROLL returns iScroll=%d\n", hwnd, nmpgScroll.iScroll);
@ -843,6 +845,7 @@ PAGER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* set default settings */ /* set default settings */
infoPtr->hwndChild = NULL; infoPtr->hwndChild = NULL;
infoPtr->hwndNotify = ((LPCREATESTRUCTW)lParam)->hwndParent;
infoPtr->bNoResize = dwStyle & CCS_NORESIZE; infoPtr->bNoResize = dwStyle & CCS_NORESIZE;
infoPtr->clrBk = GetSysColor(COLOR_BTNFACE); infoPtr->clrBk = GetSysColor(COLOR_BTNFACE);
infoPtr->nBorder = 0; infoPtr->nBorder = 0;
@ -1177,7 +1180,7 @@ PAGER_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
nmhdr.hwndFrom = hwnd; nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID); nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmhdr.code = NM_RELEASEDCAPTURE; nmhdr.code = NM_RELEASEDCAPTURE;
SendMessageA (GetParent(hwnd), WM_NOTIFY, SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr); (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
} }
@ -1267,7 +1270,7 @@ PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
nmhdr.hwndFrom = hwnd; nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID); nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmhdr.code = NM_RELEASEDCAPTURE; nmhdr.code = NM_RELEASEDCAPTURE;
SendMessageA (GetParent(hwnd), WM_NOTIFY, SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr); (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
} }
} }
@ -1575,7 +1578,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFY: case WM_NOTIFY:
case WM_COMMAND: case WM_COMMAND:
return SendMessageA (GetParent (hwnd), uMsg, wParam, lParam); return SendMessageA (infoPtr->hwndNotify, uMsg, wParam, lParam);
default: default:
return DefWindowProcA (hwnd, uMsg, wParam, lParam); return DefWindowProcA (hwnd, uMsg, wParam, lParam);

View File

@ -67,6 +67,7 @@ typedef struct
typedef struct typedef struct
{ {
HWND Self; HWND Self;
HWND Notify;
WORD numParts; WORD numParts;
UINT height; UINT height;
BOOL simple; BOOL simple;
@ -170,8 +171,7 @@ STATUSBAR_DrawPart (HDC hdc, const STATUSWINDOWPART *part, const STATUSWINDOWINF
dis.hDC = hdc; dis.hDC = hdc;
dis.rcItem = r; dis.rcItem = r;
dis.itemData = (INT)part->text; dis.itemData = (INT)part->text;
SendMessageW (GetParent (infoPtr->Self), WM_DRAWITEM, SendMessageW (infoPtr->Notify, WM_DRAWITEM, (WPARAM)dis.CtlID, (LPARAM)&dis);
(WPARAM)dis.CtlID, (LPARAM)&dis);
} }
else else
{ {
@ -561,7 +561,7 @@ STATUSBAR_SetMinHeight (STATUSWINDOWINFO *infoPtr, INT height)
INT width, x, y; INT width, x, y;
RECT parent_rect; RECT parent_rect;
GetClientRect (GetParent (infoPtr->Self), &parent_rect); GetClientRect (infoPtr->Notify, &parent_rect);
infoPtr->height = height + VERT_BORDER; infoPtr->height = height + VERT_BORDER;
width = parent_rect.right - parent_rect.left; width = parent_rect.right - parent_rect.left;
x = parent_rect.left; x = parent_rect.left;
@ -779,7 +779,7 @@ STATUSBAR_Simple (STATUSWINDOWINFO *infoPtr, BOOL simple)
nmhdr.hwndFrom = infoPtr->Self; nmhdr.hwndFrom = infoPtr->Self;
nmhdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID); nmhdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID);
nmhdr.code = SBN_SIMPLEMODECHANGE; nmhdr.code = SBN_SIMPLEMODECHANGE;
SendMessageW (GetParent (infoPtr->Self), WM_NOTIFY, 0, (LPARAM)&nmhdr); SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
InvalidateRect(infoPtr->Self, NULL, FALSE); InvalidateRect(infoPtr->Self, NULL, FALSE);
return TRUE; return TRUE;
} }
@ -829,13 +829,14 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
SetWindowLongW (hwnd, 0, (DWORD)infoPtr); SetWindowLongW (hwnd, 0, (DWORD)infoPtr);
infoPtr->Self = hwnd; infoPtr->Self = hwnd;
infoPtr->Notify = lpCreate->hwndParent;
infoPtr->numParts = 1; infoPtr->numParts = 1;
infoPtr->parts = 0; infoPtr->parts = 0;
infoPtr->simple = FALSE; infoPtr->simple = FALSE;
infoPtr->clrBk = CLR_DEFAULT; infoPtr->clrBk = CLR_DEFAULT;
infoPtr->hFont = 0; infoPtr->hFont = 0;
i = SendMessageW(GetParent (hwnd), WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY); i = SendMessageW(infoPtr->Notify, WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);
infoPtr->NtfUnicode = (i == NFR_UNICODE); infoPtr->NtfUnicode = (i == NFR_UNICODE);
GetClientRect (hwnd, &rect); GetClientRect (hwnd, &rect);
@ -923,7 +924,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
} }
if (!(dwStyle & CCS_NORESIZE)) { /* don't resize wnd if it doesn't want it ! */ if (!(dwStyle & CCS_NORESIZE)) { /* don't resize wnd if it doesn't want it ! */
GetClientRect (GetParent (hwnd), &rect); GetClientRect (infoPtr->Notify, &rect);
width = rect.right - rect.left; width = rect.right - rect.left;
infoPtr->height = textHeight + 4 + VERT_BORDER; infoPtr->height = textHeight + 4 + VERT_BORDER;
SetWindowPos(hwnd, 0, lpCreate->x, lpCreate->y - 1, SetWindowPos(hwnd, 0, lpCreate->x, lpCreate->y - 1,
@ -1074,7 +1075,7 @@ STATUSBAR_WMSize (STATUSWINDOWINFO *infoPtr, WORD flags)
if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE; if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE;
/* width and height don't apply */ /* width and height don't apply */
GetClientRect (GetParent(infoPtr->Self), &parent_rect); GetClientRect (infoPtr->Notify, &parent_rect);
width = parent_rect.right - parent_rect.left; width = parent_rect.right - parent_rect.left;
x = parent_rect.left; x = parent_rect.left;
y = parent_rect.bottom - infoPtr->height; y = parent_rect.bottom - infoPtr->height;
@ -1100,13 +1101,14 @@ STATUSBAR_NotifyFormat (STATUSWINDOWINFO *infoPtr, HWND from, INT cmd)
static LRESULT static LRESULT
STATUSBAR_SendNotify (HWND hwnd, UINT code) STATUSBAR_SendNotify (HWND hwnd, 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 = hwnd;
nmhdr.idFrom = GetWindowLongW (hwnd, GWL_ID); nmhdr.idFrom = GetWindowLongW (hwnd, GWL_ID);
nmhdr.code = code; nmhdr.code = code;
SendMessageW (GetParent (hwnd), WM_NOTIFY, 0, (LPARAM)&nmhdr); SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
return 0; return 0;
} }
@ -1220,7 +1222,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_NCLBUTTONUP: case WM_NCLBUTTONUP:
case WM_NCLBUTTONDOWN: case WM_NCLBUTTONDOWN:
PostMessageW (GetParent (hwnd), msg, wParam, lParam); PostMessageW (infoPtr->Notify, msg, wParam, lParam);
return 0; return 0;
case WM_NOTIFYFORMAT: case WM_NOTIFYFORMAT:

View File

@ -59,6 +59,7 @@ typedef struct
typedef struct typedef struct
{ {
HWND hwndNotify; /* notification window (parent) */
UINT uNumItem; /* number of tab items */ UINT uNumItem; /* number of tab items */
UINT uNumRows; /* number of tab rows */ UINT uNumRows; /* number of tab rows */
INT tabHeight; /* height of the tab row */ INT tabHeight; /* height of the tab row */
@ -118,13 +119,14 @@ static void TAB_DrawItemInterior(HWND hwnd, HDC hdc, INT iItem, RECT* drawRect);
static BOOL static BOOL
TAB_SendSimpleNotify (HWND hwnd, UINT code) TAB_SendSimpleNotify (HWND hwnd, UINT code)
{ {
TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd);
NMHDR nmhdr; NMHDR nmhdr;
nmhdr.hwndFrom = hwnd; nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID); nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID);
nmhdr.code = code; nmhdr.code = code;
return (BOOL) SendMessageA (GetParent (hwnd), WM_NOTIFY, return (BOOL) SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM) nmhdr.idFrom, (LPARAM) &nmhdr); (WPARAM) nmhdr.idFrom, (LPARAM) &nmhdr);
} }
@ -1526,7 +1528,7 @@ TAB_DrawItemInterior
/* /*
* send the draw message * send the draw message
*/ */
SendMessageA( GetParent(hwnd), WM_DRAWITEM, (WPARAM)id, (LPARAM)&dis ); SendMessageA( infoPtr->hwndNotify, WM_DRAWITEM, (WPARAM)id, (LPARAM)&dis );
} }
else else
{ {
@ -3001,6 +3003,7 @@ TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
SetWindowLongA(hwnd, 0, (DWORD)infoPtr); SetWindowLongA(hwnd, 0, (DWORD)infoPtr);
infoPtr->hwndNotify = ((LPCREATESTRUCTW)lParam)->hwndParent;
infoPtr->uNumItem = 0; infoPtr->uNumItem = 0;
infoPtr->uNumRows = 0; infoPtr->uNumRows = 0;
infoPtr->uHItemPadding = 6; infoPtr->uHItemPadding = 6;
@ -3044,7 +3047,7 @@ TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
nmttc.hdr.code = NM_TOOLTIPSCREATED; nmttc.hdr.code = NM_TOOLTIPSCREATED;
nmttc.hwndToolTips = infoPtr->hwndToolTip; nmttc.hwndToolTips = infoPtr->hwndToolTip;
SendMessageA (GetParent (hwnd), WM_NOTIFY, SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)GetWindowLongA(hwnd, GWL_ID), (LPARAM)&nmttc); (WPARAM)GetWindowLongA(hwnd, GWL_ID), (LPARAM)&nmttc);
} }
} }
@ -3113,6 +3116,7 @@ TAB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT WINAPI static LRESULT WINAPI
TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd);
TRACE("hwnd=%p msg=%x wParam=%x lParam=%lx\n", hwnd, uMsg, wParam, lParam); TRACE("hwnd=%p msg=%x wParam=%x lParam=%lx\n", hwnd, uMsg, wParam, lParam);
if (!TAB_GetInfoPtr(hwnd) && (uMsg != WM_CREATE)) if (!TAB_GetInfoPtr(hwnd) && (uMsg != WM_CREATE))
@ -3243,7 +3247,7 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TAB_LButtonUp (hwnd, wParam, lParam); return TAB_LButtonUp (hwnd, wParam, lParam);
case WM_NOTIFY: case WM_NOTIFY:
return SendMessageA(GetParent(hwnd), WM_NOTIFY, wParam, lParam); return SendMessageA(infoPtr->hwndNotify, WM_NOTIFY, wParam, lParam);
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN:
return TAB_RButtonDown (hwnd, wParam, lParam); return TAB_RButtonDown (hwnd, wParam, lParam);

View File

@ -4715,7 +4715,7 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->nButtonDown = -1; infoPtr->nButtonDown = -1;
infoPtr->nOldHit = -1; infoPtr->nOldHit = -1;
infoPtr->nHotItem = -2; /* It has to be initially different from nOldHit */ infoPtr->nHotItem = -2; /* It has to be initially different from nOldHit */
infoPtr->hwndNotify = GetParent (hwnd); infoPtr->hwndNotify = ((LPCREATESTRUCTW)lParam)->hwndParent;
infoPtr->bTransparent = (dwStyle & TBSTYLE_TRANSPARENT); infoPtr->bTransparent = (dwStyle & TBSTYLE_TRANSPARENT);
infoPtr->bBtnTranspnt = (dwStyle & (TBSTYLE_FLAT | TBSTYLE_LIST)); infoPtr->bBtnTranspnt = (dwStyle & (TBSTYLE_FLAT | TBSTYLE_LIST));
infoPtr->dwDTFlags = (dwStyle & TBSTYLE_LIST) ? DT_LEFT | DT_VCENTER | DT_SINGLELINE : DT_CENTER; infoPtr->dwDTFlags = (dwStyle & TBSTYLE_LIST) ? DT_LEFT | DT_VCENTER | DT_SINGLELINE : DT_CENTER;
@ -5453,7 +5453,7 @@ TOOLBAR_NotifyFormat(TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
INT i; INT i;
if (lParam == NF_REQUERY) { if (lParam == NF_REQUERY) {
i = SendMessageA(GetParent(infoPtr->hwndSelf), i = SendMessageA(infoPtr->hwndNotify,
WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY); WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
if ((i < NFR_ANSI) || (i > NFR_UNICODE)) { if ((i < NFR_ANSI) || (i > NFR_UNICODE)) {
ERR("wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n", ERR("wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n",
@ -5649,6 +5649,8 @@ TOOLBAR_SysColorChange (HWND hwnd)
static LRESULT WINAPI static LRESULT WINAPI
ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TRACE("hwnd=%p msg=%x wparam=%x lparam=%lx\n", TRACE("hwnd=%p msg=%x wparam=%x lparam=%lx\n",
hwnd, uMsg, /* SPY_GetMsgName(uMsg), */ wParam, lParam); hwnd, uMsg, /* SPY_GetMsgName(uMsg), */ wParam, lParam);
@ -6002,13 +6004,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_DRAWITEM: case WM_DRAWITEM:
case WM_MEASUREITEM: case WM_MEASUREITEM:
case WM_VKEYTOITEM: case WM_VKEYTOITEM:
{ return SendMessageA (infoPtr->hwndNotify, uMsg, wParam, lParam);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if(infoPtr != NULL)
return SendMessageA (infoPtr->hwndNotify, uMsg, wParam, lParam);
else
return SendMessageA (GetParent (hwnd), uMsg, wParam, lParam);
}
/* We see this in Outlook Express 5.x and just does DefWindowProc */ /* We see this in Outlook Express 5.x and just does DefWindowProc */
case PGM_FORWARDMOUSE: case PGM_FORWARDMOUSE:

View File

@ -1902,12 +1902,11 @@ TOOLTIPS_WindowFromPoint (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
TOOLTIPS_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLTIPS_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{ {
TOOLTIPS_INFO *infoPtr; TOOLTIPS_INFO *infoPtr;
NONCLIENTMETRICSA nclm; NONCLIENTMETRICSA nclm;
INT nResult; INT nResult;
HWND hParent;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (TOOLTIPS_INFO *)Alloc (sizeof(TOOLTIPS_INFO)); infoPtr = (TOOLTIPS_INFO *)Alloc (sizeof(TOOLTIPS_INFO));
@ -1930,21 +1929,16 @@ TOOLTIPS_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
TOOLTIPS_SetDelayTime(hwnd, TTDT_AUTOMATIC, 0L); TOOLTIPS_SetDelayTime(hwnd, TTDT_AUTOMATIC, 0L);
hParent = GetParent(hwnd); nResult = (INT) SendMessageA (lpcs->hwndParent, WM_NOTIFYFORMAT,
if (hParent) {
nResult = (INT) SendMessageA (hParent, WM_NOTIFYFORMAT,
(WPARAM)hwnd, (LPARAM)NF_QUERY); (WPARAM)hwnd, (LPARAM)NF_QUERY);
if (nResult == NFR_ANSI) { if (nResult == NFR_ANSI) {
infoPtr->bNotifyUnicode = FALSE; infoPtr->bNotifyUnicode = FALSE;
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n"); TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
} } else if (nResult == NFR_UNICODE) {
else if (nResult == NFR_UNICODE) { infoPtr->bNotifyUnicode = TRUE;
infoPtr->bNotifyUnicode = TRUE; TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");
TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n"); } else {
} TRACE (" -- WM_NOTIFYFORMAT returns: error!\n");
else {
ERR (" -- WM_NOTIFYFORMAT returns: error!\n");
}
} }
SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOZORDER | SWP_HIDEWINDOW | SWP_NOACTIVATE); SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOZORDER | SWP_HIDEWINDOW | SWP_NOACTIVATE);
@ -2371,7 +2365,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_CREATE: case WM_CREATE:
return TOOLTIPS_Create (hwnd, wParam, lParam); return TOOLTIPS_Create (hwnd, (LPCREATESTRUCTW)lParam);
case WM_DESTROY: case WM_DESTROY:
return TOOLTIPS_Destroy (hwnd, wParam, lParam); return TOOLTIPS_Destroy (hwnd, wParam, lParam);

View File

@ -4718,7 +4718,7 @@ TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam)
/* Create/Destroy *******************************************************/ /* Create/Destroy *******************************************************/
static LRESULT static LRESULT
TREEVIEW_Create(HWND hwnd) TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
{ {
RECT rcClient; RECT rcClient;
TREEVIEW_INFO *infoPtr; TREEVIEW_INFO *infoPtr;
@ -4797,7 +4797,7 @@ TREEVIEW_Create(HWND hwnd)
infoPtr->root->iLevel = -1; infoPtr->root->iLevel = -1;
infoPtr->root->visibleOrder = -1; infoPtr->root->visibleOrder = -1;
infoPtr->hwndNotify = GetParent(hwnd); infoPtr->hwndNotify = lpcs->hwndParent;
#if 0 #if 0
infoPtr->bTransparent = ( GetWindowLongA( hwnd, GWL_STYLE) & TBSTYLE_FLAT); infoPtr->bTransparent = ( GetWindowLongA( hwnd, GWL_STYLE) & TBSTYLE_FLAT);
#endif #endif
@ -5179,7 +5179,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
else else
{ {
if (uMsg == WM_CREATE) if (uMsg == WM_CREATE)
TREEVIEW_Create(hwnd); TREEVIEW_Create(hwnd, (LPCREATESTRUCTW)lParam);
else else
goto def; goto def;
} }

View File

@ -48,6 +48,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(updown);
typedef struct typedef struct
{ {
HWND Self; /* Handle to this up-down control */ HWND Self; /* Handle to this up-down control */
HWND Notify; /* Handle to the parent window */
UINT AccelCount; /* Number of elements in AccelVect */ UINT AccelCount; /* Number of elements in AccelVect */
UDACCEL* AccelVect; /* Vector containing AccelCount elements */ UDACCEL* AccelVect; /* Vector containing AccelCount elements */
INT AccelIndex; /* Current accel index, -1 if not accel'ing */ INT AccelIndex; /* Current accel index, -1 if not accel'ing */
@ -562,8 +563,7 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action)
ni.hdr.hwndFrom = infoPtr->Self; ni.hdr.hwndFrom = infoPtr->Self;
ni.hdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID); ni.hdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID);
ni.hdr.code = UDN_DELTAPOS; ni.hdr.code = UDN_DELTAPOS;
if (!SendMessageW(GetParent (infoPtr->Self), WM_NOTIFY, if (!SendMessageW(infoPtr->Notify, WM_NOTIFY, (WPARAM)ni.hdr.idFrom, (LPARAM)&ni)) {
(WPARAM)ni.hdr.idFrom, (LPARAM)&ni)) {
/* Parent said: OK to adjust */ /* Parent said: OK to adjust */
/* Now adjust value with (maybe new) delta */ /* Now adjust value with (maybe new) delta */
@ -574,10 +574,8 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action)
} }
/* Also, notify it. This message is sent in any case. */ /* Also, notify it. This message is sent in any case. */
SendMessageW( GetParent(infoPtr->Self), SendMessageW( infoPtr->Notify, dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL, MAKELONG(SB_THUMBPOSITION, infoPtr->CurVal), (LPARAM)infoPtr->Self);
MAKELONG(SB_THUMBPOSITION, infoPtr->CurVal),
(LPARAM)infoPtr->Self);
} }
/*********************************************************************** /***********************************************************************
@ -616,7 +614,7 @@ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr)
hdr.hwndFrom = infoPtr->Self; hdr.hwndFrom = infoPtr->Self;
hdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID); hdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID);
hdr.code = NM_RELEASEDCAPTURE; hdr.code = NM_RELEASEDCAPTURE;
SendMessageW(GetParent (infoPtr->Self), WM_NOTIFY, hdr.idFrom, (LPARAM)&hdr); SendMessageW(infoPtr->Notify, WM_NOTIFY, hdr.idFrom, (LPARAM)&hdr);
ReleaseCapture(); ReleaseCapture();
} }
@ -720,6 +718,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
/* initialize the info struct */ /* initialize the info struct */
infoPtr->Self = hwnd; infoPtr->Self = hwnd;
infoPtr->Notify = ((LPCREATESTRUCTA)lParam)->hwndParent;
infoPtr->AccelCount = 0; infoPtr->AccelCount = 0;
infoPtr->AccelVect = 0; infoPtr->AccelVect = 0;
infoPtr->AccelIndex = -1; infoPtr->AccelIndex = -1;
@ -798,7 +797,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
if ( (infoPtr->Flags & FLAG_MOUSEIN) && if ( (infoPtr->Flags & FLAG_MOUSEIN) &&
(infoPtr->Flags & FLAG_ARROW) ) { (infoPtr->Flags & FLAG_ARROW) ) {
SendMessageW( GetParent(hwnd), SendMessageW( infoPtr->Notify,
dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL, dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
MAKELONG(SB_ENDSCROLL, infoPtr->CurVal), MAKELONG(SB_ENDSCROLL, infoPtr->CurVal),
(LPARAM)hwnd); (LPARAM)hwnd);