Commit cad17ff7 authored by Eric Kohl's avatar Eric Kohl Committed by Alexandre Julliard

Replaced direct access to the WND structure by corresponding calls to

Win32 functions.
parent fa8ae2f4
/*
* Animation control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
......@@ -19,7 +19,7 @@
#include "animate.h"
#include "debug.h"
#define ANIMATE_GetInfoPtr(wndPtr) ((ANIMATE_INFO *)wndPtr->wExtra[0])
#define ANIMATE_GetInfoPtr(hwnd) ((ANIMATE_INFO *)GetWindowLongA (hwnd, 0))
static BOOL
......@@ -99,9 +99,9 @@ ANIMATE_GetAviInfo (infoPtr)
static LRESULT
ANIMATE_OpenA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ANIMATE_OpenA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hwnd);
HINSTANCE hInstance = (HINSTANCE)wParam;
ANIMATE_Free (infoPtr);
......@@ -153,9 +153,9 @@ ANIMATE_OpenA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
ANIMATE_Play (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ANIMATE_Play (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr); */
/* ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hwnd); */
INT nFrom = (INT)LOWORD(lParam);
INT nTo = (INT)HIWORD(lParam);
INT nRepeat = (INT)wParam;
......@@ -185,9 +185,9 @@ ANIMATE_Play (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
ANIMATE_Stop (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ANIMATE_Stop (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr); */
/* ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hwnd); */
#if 0
/* nothing opened */
......@@ -201,23 +201,20 @@ ANIMATE_Stop (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
ANIMATE_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ANIMATE_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
ANIMATE_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (ANIMATE_INFO *)COMCTL32_Alloc (sizeof(ANIMATE_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
if (!infoPtr) {
ERR (animate, "could not allocate info memory!\n");
return 0;
}
if ((ANIMATE_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (animate, "pointer assignment error!\n");
return 0;
}
/* store pointer to info structure */
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
/* set default settings */
......@@ -227,9 +224,9 @@ ANIMATE_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
ANIMATE_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ANIMATE_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hwnd);
/* free avi data */
......@@ -244,9 +241,9 @@ ANIMATE_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
#if 0
static LRESULT
ANIMATE_EraseBackground (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ANIMATE_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(wndPtr);
ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hwnd);
/*
HBRUSH32 hBrush = CreateSolidBrush32 (infoPtr->clrBk);
RECT32 rect;
......@@ -264,31 +261,29 @@ ANIMATE_EraseBackground (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
ANIMATE_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case ACM_OPENA:
return ANIMATE_OpenA (wndPtr, wParam, lParam);
return ANIMATE_OpenA (hwnd, wParam, lParam);
/* case ACM_OPEN32W: */
/* return ANIMATE_Open32W (wndPtr, wParam, lParam); */
/* return ANIMATE_Open32W (hwnd, wParam, lParam); */
case ACM_PLAY:
return ANIMATE_Play (wndPtr, wParam, lParam);
return ANIMATE_Play (hwnd, wParam, lParam);
case ACM_STOP:
return ANIMATE_Stop (wndPtr, wParam, lParam);
return ANIMATE_Stop (hwnd, wParam, lParam);
case WM_CREATE:
return ANIMATE_Create (wndPtr, wParam, lParam);
return ANIMATE_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return ANIMATE_Destroy (wndPtr, wParam, lParam);
return ANIMATE_Destroy (hwnd, wParam, lParam);
/* case WM_ERASEBKGND: */
/* return ANIMATE_EraseBackground (wndPtr, wParam, lParam); */
/* return ANIMATE_EraseBackground (hwnd, wParam, lParam); */
/* case WM_NCCREATE: */
/* case WM_NCHITTEST: */
......
/*
* ComboBoxEx control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
......@@ -23,16 +23,16 @@
#define ID_CB_EDIT 1001
#define COMBOEX_GetInfoPtr(wndPtr) ((COMBOEX_INFO *)wndPtr->wExtra[0])
#define COMBOEX_GetInfoPtr(wndPtr) ((COMBOEX_INFO *)GetWindowLongA (hwnd, 0))
/* << COMBOEX_DeleteItem >> */
__inline__ static LRESULT
COMBOEX_GetComboControl (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_GetComboControl (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd);
TRACE (comboex, "\n");
......@@ -41,11 +41,11 @@ COMBOEX_GetComboControl (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
COMBOEX_GetEditControl (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_GetEditControl (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd);
if ((wndPtr->dwStyle & CBS_DROPDOWNLIST) != CBS_DROPDOWN)
if ((GetWindowLongA (hwnd, GWL_STYLE) & CBS_DROPDOWNLIST) != CBS_DROPDOWN)
return 0;
TRACE (comboex, "-- 0x%x\n", GetDlgItem (infoPtr->hwndCombo, ID_CB_EDIT));
......@@ -55,18 +55,18 @@ COMBOEX_GetEditControl (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
COMBOEX_GetExtendedStyle (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_GetExtendedStyle (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd);
return (LRESULT)infoPtr->dwExtStyle;
}
__inline__ static LRESULT
COMBOEX_GetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_GetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd);
TRACE (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
......@@ -77,9 +77,9 @@ COMBOEX_GetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
COMBOEX_InsertItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr); */
/* COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd); */
FIXME (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
......@@ -89,9 +89,9 @@ COMBOEX_InsertItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
COMBOEX_SetExtendedStyle (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_SetExtendedStyle (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd);
DWORD dwTemp;
TRACE (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
......@@ -111,9 +111,9 @@ COMBOEX_SetExtendedStyle (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
COMBOEX_SetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_SetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd);
HIMAGELIST himlTemp;
TRACE (comboex, "(0x%08x 0x%08lx)\n", wParam, lParam);
......@@ -126,9 +126,9 @@ COMBOEX_SetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
COMBOEX_SetItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr); */
/* COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd); */
FIXME (comboex, "(%p): stub\n", (LPVOID)lParam);
......@@ -140,9 +140,9 @@ COMBOEX_SetItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
COMBOEX_Forward (WND *wndPtr, UINT uMsg, WPARAM wParam, LPARAM lParam)
COMBOEX_Forward (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd);
FIXME (comboex, "(0x%x 0x%x 0x%lx): stub\n", uMsg, wParam, lParam);
......@@ -154,48 +154,41 @@ COMBOEX_Forward (WND *wndPtr, UINT uMsg, WPARAM wParam, LPARAM lParam)
static LRESULT
COMBOEX_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr;
DWORD dwComboStyle;
/* allocate memory for info structure */
infoPtr = (COMBOEX_INFO *)COMCTL32_Alloc (sizeof(COMBOEX_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (listview, "could not allocate info memory!\n");
return 0;
}
if ((COMBOEX_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (listview, "pointer assignment error!\n");
return 0;
}
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
/* initialize info structure */
/* create combo box */
dwComboStyle =
wndPtr->dwStyle & (CBS_SIMPLE|CBS_DROPDOWN|CBS_DROPDOWNLIST|WS_CHILD);
dwComboStyle = GetWindowLongA (hwnd, GWL_STYLE) &
(CBS_SIMPLE|CBS_DROPDOWN|CBS_DROPDOWNLIST|WS_CHILD);
infoPtr->hwndCombo =
CreateWindowA ("ComboBox", "",
infoPtr->hwndCombo = CreateWindowA ("ComboBox", "",
WS_CHILD | WS_VISIBLE | CBS_OWNERDRAWFIXED | dwComboStyle,
0, 0, 0, 0, wndPtr->hwndSelf, (HMENU)1,
wndPtr->hInstance, NULL);
0, 0, 0, 0, hwnd, (HMENU)1,
GetWindowLongA (hwnd, GWL_HINSTANCE), NULL);
return 0;
}
static LRESULT
COMBOEX_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd);
if (infoPtr->hwndCombo)
......@@ -212,12 +205,12 @@ COMBOEX_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
COMBOEX_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMBOEX_Size (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwnd);
RECT rect;
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
MoveWindow (infoPtr->hwndCombo, 0, 0, rect.right -rect.left,
rect.bottom - rect.top, TRUE);
......@@ -229,23 +222,21 @@ COMBOEX_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
/* case CBEM_DELETEITEM: */
case CBEM_GETCOMBOCONTROL:
return COMBOEX_GetComboControl (wndPtr, wParam, lParam);
return COMBOEX_GetComboControl (hwnd, wParam, lParam);
case CBEM_GETEDITCONTROL:
return COMBOEX_GetEditControl (wndPtr, wParam, lParam);
return COMBOEX_GetEditControl (hwnd, wParam, lParam);
case CBEM_GETEXTENDEDSTYLE:
return COMBOEX_GetExtendedStyle (wndPtr, wParam, lParam);
return COMBOEX_GetExtendedStyle (hwnd, wParam, lParam);
case CBEM_GETIMAGELIST:
return COMBOEX_GetImageList (wndPtr, wParam, lParam);
return COMBOEX_GetImageList (hwnd, wParam, lParam);
/* case CBEM_GETITEM32A:
case CBEM_GETITEM32W:
......@@ -254,18 +245,18 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
*/
case CBEM_INSERTITEMA:
return COMBOEX_InsertItemA (wndPtr, wParam, lParam);
return COMBOEX_InsertItemA (hwnd, wParam, lParam);
/* case CBEM_INSERTITEM32W: */
case CBEM_SETEXTENDEDSTYLE:
return COMBOEX_SetExtendedStyle (wndPtr, wParam, lParam);
return COMBOEX_SetExtendedStyle (hwnd, wParam, lParam);
case CBEM_SETIMAGELIST:
return COMBOEX_SetImageList (wndPtr, wParam, lParam);
return COMBOEX_SetImageList (hwnd, wParam, lParam);
case CBEM_SETITEMA:
return COMBOEX_SetItemA (wndPtr, wParam, lParam);
return COMBOEX_SetItemA (hwnd, wParam, lParam);
/* case CBEM_SETITEM32W:
case CBEM_SETUNICODEFORMAT:
......@@ -291,17 +282,17 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case CB_SETITEMDATA:
case CB_SETITEMHEIGHT:
case CB_SHOWDROPDOWN:
return COMBOEX_Forward (wndPtr, uMsg, wParam, lParam);
return COMBOEX_Forward (hwnd, uMsg, wParam, lParam);
case WM_CREATE:
return COMBOEX_Create (wndPtr, wParam, lParam);
return COMBOEX_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return COMBOEX_Destroy (wndPtr, wParam, lParam);
return COMBOEX_Destroy (hwnd, wParam, lParam);
case WM_SIZE:
return COMBOEX_Size (wndPtr, wParam, lParam);
return COMBOEX_Size (hwnd, wParam, lParam);
default:
if (uMsg >= WM_USER)
......
/*
* Date and time picker control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
......@@ -20,7 +20,7 @@
#include "debug.h"
#define DATETIME_GetInfoPtr(wndPtr) ((DATETIME_INFO *)wndPtr->wExtra[0])
#define DATETIME_GetInfoPtr(hwnd) ((DATETIME_INFO *)GetWindowLongA (hwnd, 0))
......@@ -28,23 +28,19 @@
static LRESULT
DATETIME_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
DATETIME_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (DATETIME_INFO *)COMCTL32_Alloc (sizeof(DATETIME_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (datetime, "could not allocate info memory!\n");
return 0;
}
if ((DATETIME_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (datetime, "pointer assignment error!\n");
return 0;
}
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
/* initialize info structure */
......@@ -55,9 +51,9 @@ DATETIME_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
DATETIME_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
DATETIME_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr(wndPtr);
DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd);
/* free datetime info data */
COMCTL32_Free (infoPtr);
......@@ -71,8 +67,6 @@ DATETIME_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
......@@ -121,10 +115,10 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
case WM_CREATE:
return DATETIME_Create (wndPtr, wParam, lParam);
return DATETIME_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return DATETIME_Destroy (wndPtr, wParam, lParam);
return DATETIME_Destroy (hwnd, wParam, lParam);
default:
if (uMsg >= WM_USER)
......
/*
* Flat Scrollbar control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
* Copyright 1998 Alex Priem
*
* NOTES
......@@ -21,7 +21,7 @@
#include "debug.h"
#define FlatSB_GetInfoPtr(wndPtr) ((FLATSB_INFO*)wndPtr->wExtra[0])
#define FlatSB_GetInfoPtr(hwnd) ((FLATSB_INFO*)GetWindowLongA (hwnd, 0))
BOOL WINAPI
......@@ -111,14 +111,14 @@ HRESULT WINAPI UninitializeFlatSB(HWND hwnd)
static LRESULT
FlatSB_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
FlatSB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
return 0;
}
static LRESULT
FlatSB_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
FlatSB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
return 0;
}
......@@ -129,16 +129,14 @@ FlatSB_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case WM_CREATE:
return FlatSB_Create (wndPtr, wParam, lParam);
return FlatSB_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return FlatSB_Destroy (wndPtr, wParam, lParam);
return FlatSB_Destroy (hwnd, wParam, lParam);
default:
if (uMsg >= WM_USER)
......
......@@ -33,13 +33,13 @@
#define VERT_BORDER 4
#define DIVIDER_WIDTH 10
#define HEADER_GetInfoPtr(wndPtr) ((HEADER_INFO *)wndPtr->wExtra[0])
#define HEADER_GetInfoPtr(hwnd) ((HEADER_INFO *)GetWindowLongA(hwnd,0))
static INT
HEADER_DrawItem (WND *wndPtr, HDC hdc, INT iItem, BOOL bHotTrack)
HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *phdi = &infoPtr->items[iItem];
RECT r;
INT oldBkMode;
......@@ -48,7 +48,7 @@ HEADER_DrawItem (WND *wndPtr, HDC hdc, INT iItem, BOOL bHotTrack)
if (r.right - r.left == 0)
return phdi->rect.right;
if (wndPtr->dwStyle & HDS_BUTTONS) {
if (GetWindowLongA (hwnd, GWL_STYLE) & HDS_BUTTONS) {
if (phdi->bDown) {
DrawEdge (hdc, &r, BDR_RAISEDOUTER,
BF_RECT | BF_FLAT | BF_MIDDLE | BF_ADJUST);
......@@ -65,16 +65,16 @@ HEADER_DrawItem (WND *wndPtr, HDC hdc, INT iItem, BOOL bHotTrack)
if (phdi->fmt & HDF_OWNERDRAW) {
DRAWITEMSTRUCT dis;
dis.CtlType = ODT_HEADER;
dis.CtlID = wndPtr->wIDmenu;
dis.CtlID = GetWindowLongA (hwnd, GWL_ID);
dis.itemID = iItem;
dis.itemAction = ODA_DRAWENTIRE;
dis.itemState = phdi->bDown ? ODS_SELECTED : 0;
dis.hwndItem = wndPtr->hwndSelf;
dis.hwndItem = hwnd;
dis.hDC = hdc;
dis.rcItem = r;
dis.itemData = phdi->lParam;
SendMessageA (GetParent (wndPtr->hwndSelf), WM_DRAWITEM,
(WPARAM)wndPtr->wIDmenu, (LPARAM)&dis);
SendMessageA (GetParent (hwnd), WM_DRAWITEM,
(WPARAM)dis.CtlID, (LPARAM)&dis);
}
else {
UINT uTextJustify = DT_LEFT;
......@@ -189,21 +189,22 @@ HEADER_DrawItem (WND *wndPtr, HDC hdc, INT iItem, BOOL bHotTrack)
SetBkMode(hdc, oldBkMode);
}
}
return phdi->rect.right;
}
static void
HEADER_Refresh (WND *wndPtr, HDC hdc)
HEADER_Refresh (HWND hwnd, HDC hdc)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HFONT hFont, hOldFont;
RECT rect;
HBRUSH hbrBk;
INT i, x;
/* get rect for the bar, adjusted for the border */
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject (SYSTEM_FONT);
hOldFont = SelectObject (hdc, hFont);
......@@ -214,12 +215,12 @@ HEADER_Refresh (WND *wndPtr, HDC hdc)
x = rect.left;
for (i = 0; i < infoPtr->uNumItem; i++) {
x = HEADER_DrawItem (wndPtr, hdc, i, FALSE);
x = HEADER_DrawItem (hwnd, hdc, i, FALSE);
}
if ((x <= rect.right) && (infoPtr->uNumItem > 0)) {
rect.left = x;
if (wndPtr->dwStyle & HDS_BUTTONS)
if (GetWindowLongA (hwnd, GWL_STYLE) & HDS_BUTTONS)
DrawEdge (hdc, &rect, EDGE_RAISED, BF_TOP|BF_LEFT|BF_BOTTOM|BF_SOFT);
else
DrawEdge (hdc, &rect, EDGE_ETCHED, BF_BOTTOM);
......@@ -230,22 +231,22 @@ HEADER_Refresh (WND *wndPtr, HDC hdc)
static void
HEADER_RefreshItem (WND *wndPtr, HDC hdc, INT iItem)
HEADER_RefreshItem (HWND hwnd, HDC hdc, INT iItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HFONT hFont, hOldFont;
hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject (SYSTEM_FONT);
hOldFont = SelectObject (hdc, hFont);
HEADER_DrawItem (wndPtr, hdc, iItem, FALSE);
HEADER_DrawItem (hwnd, hdc, iItem, FALSE);
SelectObject (hdc, hOldFont);
}
static void
HEADER_SetItemBounds (WND *wndPtr)
HEADER_SetItemBounds (HWND hwnd)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *phdi;
RECT rect;
int i, x;
......@@ -253,7 +254,7 @@ HEADER_SetItemBounds (WND *wndPtr)
if (infoPtr->uNumItem == 0)
return;
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
x = rect.left;
for (i = 0; i < infoPtr->uNumItem; i++) {
......@@ -268,9 +269,9 @@ HEADER_SetItemBounds (WND *wndPtr)
static void
HEADER_ForceItemBounds (WND *wndPtr, INT cy)
HEADER_ForceItemBounds (HWND hwnd, INT cy)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *phdi;
int i, x;
......@@ -290,14 +291,14 @@ HEADER_ForceItemBounds (WND *wndPtr, INT cy)
static void
HEADER_InternalHitTest (WND *wndPtr, LPPOINT lpPt, UINT *pFlags, INT *pItem)
HEADER_InternalHitTest (HWND hwnd, LPPOINT lpPt, UINT *pFlags, INT *pItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
RECT rect, rcTest;
INT iCount, width;
BOOL bNoWidth;
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
*pFlags = 0;
bNoWidth = FALSE;
......@@ -411,13 +412,13 @@ HEADER_InternalHitTest (WND *wndPtr, LPPOINT lpPt, UINT *pFlags, INT *pItem)
static void
HEADER_DrawTrackLine (WND *wndPtr, HDC hdc, INT x)
HEADER_DrawTrackLine (HWND hwnd, HDC hdc, INT x)
{
RECT rect;
HPEN hOldPen;
INT oldRop;
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
hOldPen = SelectObject (hdc, GetStockObject (BLACK_PEN));
oldRop = SetROP2 (hdc, R2_XORPEN);
......@@ -429,28 +430,28 @@ HEADER_DrawTrackLine (WND *wndPtr, HDC hdc, INT x)
static BOOL
HEADER_SendSimpleNotify (WND *wndPtr, UINT code)
HEADER_SendSimpleNotify (HWND hwnd, UINT code)
{
NMHDR nmhdr;
nmhdr.hwndFrom = wndPtr->hwndSelf;
nmhdr.idFrom = wndPtr->wIDmenu;
nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmhdr.code = code;
return (BOOL)SendMessageA (GetParent (wndPtr->hwndSelf), WM_NOTIFY,
return (BOOL)SendMessageA (GetParent (hwnd), WM_NOTIFY,
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
}
static BOOL
HEADER_SendHeaderNotify (WND *wndPtr, UINT code, INT iItem)
HEADER_SendHeaderNotify (HWND hwnd, UINT code, INT iItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
NMHEADERA nmhdr;
HDITEMA nmitem;
nmhdr.hdr.hwndFrom = wndPtr->hwndSelf;
nmhdr.hdr.idFrom = wndPtr->wIDmenu;
nmhdr.hdr.hwndFrom = hwnd;
nmhdr.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmhdr.hdr.code = code;
nmhdr.iItem = iItem;
nmhdr.iButton = 0;
......@@ -467,30 +468,30 @@ HEADER_SendHeaderNotify (WND *wndPtr, UINT code, INT iItem)
nmitem.iOrder = infoPtr->items[iItem].iOrder;
nmitem.iImage = infoPtr->items[iItem].iImage;
return (BOOL)SendMessageA (GetParent (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM)wndPtr->wIDmenu, (LPARAM)&nmhdr);
return (BOOL)SendMessageA (GetParent (hwnd), WM_NOTIFY,
(WPARAM)nmhdr.hdr.idFrom, (LPARAM)&nmhdr);
}
static BOOL
HEADER_SendClickNotify (WND *wndPtr, UINT code, INT iItem)
HEADER_SendClickNotify (HWND hwnd, UINT code, INT iItem)
{
NMHEADERA nmhdr;
nmhdr.hdr.hwndFrom = wndPtr->hwndSelf;
nmhdr.hdr.idFrom = wndPtr->wIDmenu;
nmhdr.hdr.hwndFrom = hwnd;
nmhdr.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmhdr.hdr.code = code;
nmhdr.iItem = iItem;
nmhdr.iButton = 0;
nmhdr.pitem = NULL;
return (BOOL)SendMessageA (GetParent (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM)wndPtr->wIDmenu, (LPARAM)&nmhdr);
return (BOOL)SendMessageA (GetParent (hwnd), WM_NOTIFY,
(WPARAM)nmhdr.hdr.idFrom, (LPARAM)&nmhdr);
}
static LRESULT
HEADER_CreateDragImage (WND *wndPtr, WPARAM wParam)
HEADER_CreateDragImage (HWND hwnd, WPARAM wParam)
{
FIXME (header, "empty stub!\n");
return 0;
......@@ -498,9 +499,9 @@ HEADER_CreateDragImage (WND *wndPtr, WPARAM wParam)
static LRESULT
HEADER_DeleteItem (WND *wndPtr, WPARAM wParam)
HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd);
INT iItem = (INT)wParam;
HDC hdc;
......@@ -541,29 +542,29 @@ HEADER_DeleteItem (WND *wndPtr, WPARAM wParam)
COMCTL32_Free (oldItems);
}
HEADER_SetItemBounds (wndPtr);
HEADER_SetItemBounds (hwnd);
hdc = GetDC (wndPtr->hwndSelf);
HEADER_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
HEADER_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
HEADER_GetImageList (WND *wndPtr)
HEADER_GetImageList (HWND hwnd)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
return (LRESULT)infoPtr->himl;
}
static LRESULT
HEADER_GetItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_GetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HDITEMA *phdi = (HDITEMA*)lParam;
INT nItem = (INT)wParam;
HEADER_ITEM *lpItem;
......@@ -609,9 +610,9 @@ HEADER_GetItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HEADER_GetItemW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_GetItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HDITEMW *phdi = (HDITEMW*)lParam;
INT nItem = (INT)wParam;
HEADER_ITEM *lpItem;
......@@ -657,17 +658,17 @@ HEADER_GetItemW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
HEADER_GetItemCount (WND *wndPtr)
HEADER_GetItemCount (HWND hwnd)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
return infoPtr->uNumItem;
}
static LRESULT
HEADER_GetItemRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_GetItemRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
INT iItem = (INT)wParam;
LPRECT lpRect = (LPRECT)lParam;
......@@ -687,28 +688,28 @@ HEADER_GetItemRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
HEADER_GetUnicodeFormat (WND *wndPtr)
HEADER_GetUnicodeFormat (HWND hwnd)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
return infoPtr->bUnicode;
}
static LRESULT
HEADER_HitTest (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_HitTest (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
LPHDHITTESTINFO phti = (LPHDHITTESTINFO)lParam;
HEADER_InternalHitTest (wndPtr, &phti->pt, &phti->flags, &phti->iItem);
HEADER_InternalHitTest (hwnd, &phti->pt, &phti->flags, &phti->iItem);
return phti->flags;
}
static LRESULT
HEADER_InsertItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HDITEMA *phdi = (HDITEMA*)lParam;
INT nItem = (INT)wParam;
HEADER_ITEM *lpItem;
......@@ -786,20 +787,20 @@ HEADER_InsertItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if (phdi->mask & HDI_ORDER)
lpItem->iOrder = phdi->iOrder;
HEADER_SetItemBounds (wndPtr);
HEADER_SetItemBounds (hwnd);
hdc = GetDC (wndPtr->hwndSelf);
HEADER_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
HEADER_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return nItem;
}
static LRESULT
HEADER_InsertItemW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HDITEMW *phdi = (HDITEMW*)lParam;
INT nItem = (INT)wParam;
HEADER_ITEM *lpItem;
......@@ -870,28 +871,28 @@ HEADER_InsertItemW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if (phdi->mask & HDI_ORDER)
lpItem->iOrder = phdi->iOrder;
HEADER_SetItemBounds (wndPtr);
HEADER_SetItemBounds (hwnd);
hdc = GetDC (wndPtr->hwndSelf);
HEADER_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
HEADER_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return nItem;
}
static LRESULT
HEADER_Layout (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_Layout (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
LPHDLAYOUT lpLayout = (LPHDLAYOUT)lParam;
lpLayout->pwpos->hwnd = wndPtr->hwndSelf;
lpLayout->pwpos->hwnd = hwnd;
lpLayout->pwpos->hwndInsertAfter = 0;
lpLayout->pwpos->x = lpLayout->prc->left;
lpLayout->pwpos->y = lpLayout->prc->top;
lpLayout->pwpos->cx = lpLayout->prc->right - lpLayout->prc->left;
if (wndPtr->dwStyle & HDS_HIDDEN)
if (GetWindowLongA (hwnd, GWL_STYLE) & HDS_HIDDEN)
lpLayout->pwpos->cy = 0;
else
lpLayout->pwpos->cy = infoPtr->nHeight;
......@@ -901,7 +902,7 @@ HEADER_Layout (WND *wndPtr, WPARAM wParam, LPARAM lParam)
lpLayout->pwpos->x, lpLayout->pwpos->y,
lpLayout->pwpos->cx, lpLayout->pwpos->cy);
HEADER_ForceItemBounds (wndPtr, lpLayout->pwpos->cy);
HEADER_ForceItemBounds (hwnd, lpLayout->pwpos->cy);
/* hack */
#ifdef __HDM_LAYOUT_HACK__
......@@ -914,9 +915,9 @@ HEADER_Layout (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HEADER_SetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_SetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HIMAGELIST himlOld;
himlOld = infoPtr->himl;
......@@ -929,9 +930,9 @@ HEADER_SetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HEADER_SetItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HDITEMA *phdi = (HDITEMA*)lParam;
INT nItem = (INT)wParam;
HEADER_ITEM *lpItem;
......@@ -944,7 +945,7 @@ HEADER_SetItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE (header, "[nItem=%d]\n", nItem);
if (HEADER_SendHeaderNotify (wndPtr, HDN_ITEMCHANGINGA, nItem))
if (HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGINGA, nItem))
return FALSE;
lpItem = (HEADER_ITEM*)&infoPtr->items[nItem];
......@@ -982,21 +983,21 @@ HEADER_SetItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if (phdi->mask & HDI_ORDER)
lpItem->iOrder = phdi->iOrder;
HEADER_SendHeaderNotify (wndPtr, HDN_ITEMCHANGEDA, nItem);
HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA, nItem);
HEADER_SetItemBounds (wndPtr);
hdc = GetDC (wndPtr->hwndSelf);
HEADER_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HEADER_SetItemBounds (hwnd);
hdc = GetDC (hwnd);
HEADER_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
HEADER_SetItemW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_SetItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HDITEMW *phdi = (HDITEMW*)lParam;
INT nItem = (INT)wParam;
HEADER_ITEM *lpItem;
......@@ -1009,7 +1010,7 @@ HEADER_SetItemW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE (header, "[nItem=%d]\n", nItem);
if (HEADER_SendHeaderNotify (wndPtr, HDN_ITEMCHANGINGA, nItem))
if (HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGINGA, nItem))
return FALSE;
lpItem = (HEADER_ITEM*)&infoPtr->items[nItem];
......@@ -1047,12 +1048,12 @@ HEADER_SetItemW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if (phdi->mask & HDI_ORDER)
lpItem->iOrder = phdi->iOrder;
HEADER_SendHeaderNotify (wndPtr, HDN_ITEMCHANGEDA, nItem);
HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA, nItem);
HEADER_SetItemBounds (wndPtr);
hdc = GetDC (wndPtr->hwndSelf);
HEADER_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HEADER_SetItemBounds (hwnd);
hdc = GetDC (hwnd);
HEADER_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
......@@ -1062,9 +1063,9 @@ HEADER_SetItemW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
HEADER_SetUnicodeFormat (WND *wndPtr, WPARAM wParam)
HEADER_SetUnicodeFormat (HWND hwnd, WPARAM wParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
BOOL bTemp = infoPtr->bUnicode;
infoPtr->bUnicode = (BOOL)wParam;
......@@ -1074,7 +1075,7 @@ HEADER_SetUnicodeFormat (WND *wndPtr, WPARAM wParam)
static LRESULT
HEADER_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr;
TEXTMETRICA tm;
......@@ -1082,7 +1083,7 @@ HEADER_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HDC hdc;
infoPtr = (HEADER_INFO *)COMCTL32_Alloc (sizeof(HEADER_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
infoPtr->uNumItem = 0;
infoPtr->nHeight = 20;
......@@ -1096,7 +1097,7 @@ HEADER_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->iMoveItem = 0;
infoPtr->himl = 0;
infoPtr->iHotItem = -1;
infoPtr->bUnicode = IsWindowUnicode (wndPtr->hwndSelf);
infoPtr->bUnicode = IsWindowUnicode (hwnd);
hdc = GetDC (0);
hOldFont = SelectObject (hdc, GetStockObject (SYSTEM_FONT));
......@@ -1110,9 +1111,9 @@ HEADER_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HEADER_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *lpItem;
INT nItem;
......@@ -1135,16 +1136,16 @@ HEADER_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static __inline__ LRESULT
HEADER_GetFont (WND *wndPtr)
HEADER_GetFont (HWND hwnd)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
return (LRESULT)infoPtr->hFont;
}
static LRESULT
HEADER_LButtonDblClk (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_LButtonDblClk (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
POINT pt;
UINT flags;
......@@ -1152,21 +1153,22 @@ HEADER_LButtonDblClk (WND *wndPtr, WPARAM wParam, LPARAM lParam)
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
HEADER_InternalHitTest (wndPtr, &pt, &flags, &nItem);
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
if ((wndPtr->dwStyle & HDS_BUTTONS) && (flags == HHT_ONHEADER))
HEADER_SendHeaderNotify (wndPtr, HDN_ITEMDBLCLICKA, nItem);
if ((GetWindowLongA (hwnd, GWL_STYLE) & HDS_BUTTONS) && (flags == HHT_ONHEADER))
HEADER_SendHeaderNotify (hwnd, HDN_ITEMDBLCLICKA, nItem);
else if ((flags == HHT_ONDIVIDER) || (flags == HHT_ONDIVOPEN))
HEADER_SendHeaderNotify (wndPtr, HDN_DIVIDERDBLCLICKA, nItem);
HEADER_SendHeaderNotify (hwnd, HDN_DIVIDERDBLCLICKA, nItem);
return 0;
}
static LRESULT
HEADER_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
POINT pt;
UINT flags;
INT nItem;
......@@ -1174,10 +1176,10 @@ HEADER_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
HEADER_InternalHitTest (wndPtr, &pt, &flags, &nItem);
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
if ((wndPtr->dwStyle & HDS_BUTTONS) && (flags == HHT_ONHEADER)) {
SetCapture (wndPtr->hwndSelf);
if ((dwStyle & HDS_BUTTONS) && (flags == HHT_ONHEADER)) {
SetCapture (hwnd);
infoPtr->bCaptured = TRUE;
infoPtr->bPressed = TRUE;
infoPtr->iMoveItem = nItem;
......@@ -1185,26 +1187,26 @@ HEADER_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->items[nItem].bDown = TRUE;
/* Send WM_CUSTOMDRAW */
hdc = GetDC (wndPtr->hwndSelf);
HEADER_RefreshItem (wndPtr, hdc, nItem);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
HEADER_RefreshItem (hwnd, hdc, nItem);
ReleaseDC (hwnd, hdc);
TRACE (header, "Pressed item %d!\n", nItem);
}
else if ((flags == HHT_ONDIVIDER) || (flags == HHT_ONDIVOPEN)) {
if (!(HEADER_SendHeaderNotify (wndPtr, HDN_BEGINTRACKA, nItem))) {
SetCapture (wndPtr->hwndSelf);
if (!(HEADER_SendHeaderNotify (hwnd, HDN_BEGINTRACKA, nItem))) {
SetCapture (hwnd);
infoPtr->bCaptured = TRUE;
infoPtr->bTracking = TRUE;
infoPtr->iMoveItem = nItem;
infoPtr->nOldWidth = infoPtr->items[nItem].cxy;
infoPtr->xTrackOffset = infoPtr->items[nItem].rect.right - pt.x;
if (!(wndPtr->dwStyle & HDS_FULLDRAG)) {
if (!(dwStyle & HDS_FULLDRAG)) {
infoPtr->xOldTrack = infoPtr->items[nItem].rect.right;
hdc = GetDC (wndPtr->hwndSelf);
HEADER_DrawTrackLine (wndPtr, hdc, infoPtr->xOldTrack);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack);
ReleaseDC (hwnd, hdc);
}
TRACE (header, "Begin tracking item %d!\n", nItem);
......@@ -1216,9 +1218,10 @@ HEADER_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HEADER_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
POINT pt;
UINT flags;
INT nItem, nWidth;
......@@ -1226,16 +1229,16 @@ HEADER_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
HEADER_InternalHitTest (wndPtr, &pt, &flags, &nItem);
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
if (infoPtr->bPressed) {
if ((nItem == infoPtr->iMoveItem) && (flags == HHT_ONHEADER)) {
infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
hdc = GetDC (wndPtr->hwndSelf);
HEADER_RefreshItem (wndPtr, hdc, infoPtr->iMoveItem);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
HEADER_RefreshItem (hwnd, hdc, infoPtr->iMoveItem);
ReleaseDC (hwnd, hdc);
HEADER_SendClickNotify (wndPtr, HDN_ITEMCLICKA, infoPtr->iMoveItem);
HEADER_SendClickNotify (hwnd, HDN_ITEMCLICKA, infoPtr->iMoveItem);
}
TRACE (header, "Released item %d!\n", infoPtr->iMoveItem);
infoPtr->bPressed = FALSE;
......@@ -1244,33 +1247,33 @@ HEADER_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE (header, "End tracking item %d!\n", infoPtr->iMoveItem);
infoPtr->bTracking = FALSE;
HEADER_SendHeaderNotify (wndPtr, HDN_ENDTRACKA, infoPtr->iMoveItem);
HEADER_SendHeaderNotify (hwnd, HDN_ENDTRACKA, infoPtr->iMoveItem);
if (!(wndPtr->dwStyle & HDS_FULLDRAG)) {
hdc = GetDC (wndPtr->hwndSelf);
HEADER_DrawTrackLine (wndPtr, hdc, infoPtr->xOldTrack);
ReleaseDC (wndPtr->hwndSelf, hdc);
if (HEADER_SendHeaderNotify (wndPtr, HDN_ITEMCHANGINGA, infoPtr->iMoveItem))
if (!(dwStyle & HDS_FULLDRAG)) {
hdc = GetDC (hwnd);
HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack);
ReleaseDC (hwnd, hdc);
if (HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGINGA, infoPtr->iMoveItem))
infoPtr->items[infoPtr->iMoveItem].cxy = infoPtr->nOldWidth;
else {
nWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset;
if (nWidth < 0)
nWidth = 0;
infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
HEADER_SendHeaderNotify (wndPtr, HDN_ITEMCHANGEDA, infoPtr->iMoveItem);
HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA, infoPtr->iMoveItem);
}
HEADER_SetItemBounds (wndPtr);
hdc = GetDC (wndPtr->hwndSelf);
HEADER_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HEADER_SetItemBounds (hwnd);
hdc = GetDC (hwnd);
HEADER_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
}
if (infoPtr->bCaptured) {
infoPtr->bCaptured = FALSE;
ReleaseCapture ();
HEADER_SendSimpleNotify (wndPtr, NM_RELEASEDCAPTURE);
HEADER_SendSimpleNotify (hwnd, NM_RELEASEDCAPTURE);
}
return 0;
......@@ -1278,9 +1281,10 @@ HEADER_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HEADER_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
POINT pt;
UINT flags;
INT nItem, nWidth;
......@@ -1288,16 +1292,16 @@ HEADER_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
HEADER_InternalHitTest (wndPtr, &pt, &flags, &nItem);
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
if ((wndPtr->dwStyle & HDS_BUTTONS) && (wndPtr->dwStyle & HDS_HOTTRACK)) {
if ((dwStyle & HDS_BUTTONS) && (dwStyle & HDS_HOTTRACK)) {
if (flags & (HHT_ONHEADER | HHT_ONDIVIDER | HHT_ONDIVOPEN))
infoPtr->iHotItem = nItem;
else
infoPtr->iHotItem = -1;
hdc = GetDC (wndPtr->hwndSelf);
HEADER_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
HEADER_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
if (infoPtr->bCaptured) {
......@@ -1306,47 +1310,47 @@ HEADER_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->items[infoPtr->iMoveItem].bDown = TRUE;
else
infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
hdc = GetDC (wndPtr->hwndSelf);
HEADER_RefreshItem (wndPtr, hdc, infoPtr->iMoveItem);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
HEADER_RefreshItem (hwnd, hdc, infoPtr->iMoveItem);
ReleaseDC (hwnd, hdc);
TRACE (header, "Moving pressed item %d!\n", infoPtr->iMoveItem);
}
else if (infoPtr->bTracking) {
if (wndPtr->dwStyle & HDS_FULLDRAG) {
if (HEADER_SendHeaderNotify (wndPtr, HDN_ITEMCHANGINGA, infoPtr->iMoveItem))
if (dwStyle & HDS_FULLDRAG) {
if (HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGINGA, infoPtr->iMoveItem))
infoPtr->items[infoPtr->iMoveItem].cxy = infoPtr->nOldWidth;
else {
nWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset;
if (nWidth < 0)
nWidth = 0;
infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
HEADER_SendHeaderNotify (wndPtr, HDN_ITEMCHANGEDA,
HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA,
infoPtr->iMoveItem);
}
HEADER_SetItemBounds (wndPtr);
hdc = GetDC (wndPtr->hwndSelf);
HEADER_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HEADER_SetItemBounds (hwnd);
hdc = GetDC (hwnd);
HEADER_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
else {
hdc = GetDC (wndPtr->hwndSelf);
HEADER_DrawTrackLine (wndPtr, hdc, infoPtr->xOldTrack);
hdc = GetDC (hwnd);
HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack);
infoPtr->xOldTrack = pt.x + infoPtr->xTrackOffset;
if (infoPtr->xOldTrack < infoPtr->items[infoPtr->iMoveItem].rect.left)
infoPtr->xOldTrack = infoPtr->items[infoPtr->iMoveItem].rect.left;
infoPtr->items[infoPtr->iMoveItem].cxy =
infoPtr->xOldTrack - infoPtr->items[infoPtr->iMoveItem].rect.left;
HEADER_DrawTrackLine (wndPtr, hdc, infoPtr->xOldTrack);
ReleaseDC (wndPtr->hwndSelf, hdc);
HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack);
ReleaseDC (hwnd, hdc);
}
HEADER_SendHeaderNotify (wndPtr, HDN_TRACKA, infoPtr->iMoveItem);
HEADER_SendHeaderNotify (hwnd, HDN_TRACKA, infoPtr->iMoveItem);
TRACE (header, "Tracking item %d!\n", infoPtr->iMoveItem);
}
}
if ((wndPtr->dwStyle & HDS_BUTTONS) && (wndPtr->dwStyle & HDS_HOTTRACK)) {
if ((dwStyle & HDS_BUTTONS) && (dwStyle & HDS_HOTTRACK)) {
FIXME (header, "hot track support!\n");
}
......@@ -1355,30 +1359,30 @@ HEADER_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HEADER_Paint (WND *wndPtr, WPARAM wParam)
HEADER_Paint (HWND hwnd, WPARAM wParam)
{
HDC hdc;
PAINTSTRUCT ps;
hdc = wParam==0 ? BeginPaint (wndPtr->hwndSelf, &ps) : (HDC)wParam;
HEADER_Refresh (wndPtr, hdc);
hdc = wParam==0 ? BeginPaint (hwnd, &ps) : (HDC)wParam;
HEADER_Refresh (hwnd, hdc);
if(!wParam)
EndPaint (wndPtr->hwndSelf, &ps);
EndPaint (hwnd, &ps);
return 0;
}
static LRESULT
HEADER_RButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_RButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
return HEADER_SendSimpleNotify (wndPtr, NM_RCLICK);
return HEADER_SendSimpleNotify (hwnd, NM_RCLICK);
}
static LRESULT
HEADER_SetCursor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_SetCursor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
POINT pt;
UINT flags;
INT nItem;
......@@ -1386,9 +1390,9 @@ HEADER_SetCursor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE (header, "code=0x%X id=0x%X\n", LOWORD(lParam), HIWORD(lParam));
GetCursorPos (&pt);
ScreenToClient (wndPtr->hwndSelf, &pt);
ScreenToClient (hwnd, &pt);
HEADER_InternalHitTest (wndPtr, &pt, &flags, &nItem);
HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem);
if (flags == HHT_ONDIVIDER)
SetCursor (infoPtr->hcurDivider);
......@@ -1402,9 +1406,9 @@ HEADER_SetCursor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HEADER_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HEADER_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
TEXTMETRICA tm;
HFONT hFont, hOldFont;
HDC hdc;
......@@ -1421,10 +1425,10 @@ HEADER_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ReleaseDC (0, hdc);
if (lParam) {
HEADER_ForceItemBounds (wndPtr, infoPtr->nHeight);
hdc = GetDC (wndPtr->hwndSelf);
HEADER_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HEADER_ForceItemBounds (hwnd, infoPtr->nHeight);
hdc = GetDC (hwnd);
HEADER_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -1434,67 +1438,65 @@ HEADER_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (msg) {
case HDM_CREATEDRAGIMAGE:
return HEADER_CreateDragImage (wndPtr, wParam);
return HEADER_CreateDragImage (hwnd, wParam);
case HDM_DELETEITEM:
return HEADER_DeleteItem (wndPtr, wParam);
return HEADER_DeleteItem (hwnd, wParam);
case HDM_GETIMAGELIST:
return HEADER_GetImageList (wndPtr);
return HEADER_GetImageList (hwnd);
case HDM_GETITEMA:
return HEADER_GetItemA (wndPtr, wParam, lParam);
return HEADER_GetItemA (hwnd, wParam, lParam);
case HDM_GETITEMW:
return HEADER_GetItemW (wndPtr, wParam, lParam);
return HEADER_GetItemW (hwnd, wParam, lParam);
case HDM_GETITEMCOUNT:
return HEADER_GetItemCount (wndPtr);
return HEADER_GetItemCount (hwnd);
case HDM_GETITEMRECT:
return HEADER_GetItemRect (wndPtr, wParam, lParam);
return HEADER_GetItemRect (hwnd, wParam, lParam);
/* case HDM_GETORDERARRAY: */
case HDM_GETUNICODEFORMAT:
return HEADER_GetUnicodeFormat (wndPtr);
return HEADER_GetUnicodeFormat (hwnd);
case HDM_HITTEST:
return HEADER_HitTest (wndPtr, wParam, lParam);
return HEADER_HitTest (hwnd, wParam, lParam);
case HDM_INSERTITEMA:
return HEADER_InsertItemA (wndPtr, wParam, lParam);
return HEADER_InsertItemA (hwnd, wParam, lParam);
case HDM_INSERTITEMW:
return HEADER_InsertItemW (wndPtr, wParam, lParam);
return HEADER_InsertItemW (hwnd, wParam, lParam);
case HDM_LAYOUT:
return HEADER_Layout (wndPtr, wParam, lParam);
return HEADER_Layout (hwnd, wParam, lParam);
case HDM_SETIMAGELIST:
return HEADER_SetImageList (wndPtr, wParam, lParam);
return HEADER_SetImageList (hwnd, wParam, lParam);
case HDM_SETITEMA:
return HEADER_SetItemA (wndPtr, wParam, lParam);
return HEADER_SetItemA (hwnd, wParam, lParam);
case HDM_SETITEMW:
return HEADER_SetItemW (wndPtr, wParam, lParam);
return HEADER_SetItemW (hwnd, wParam, lParam);
/* case HDM_SETORDERARRAY: */
case HDM_SETUNICODEFORMAT:
return HEADER_SetUnicodeFormat (wndPtr, wParam);
return HEADER_SetUnicodeFormat (hwnd, wParam);
case WM_CREATE:
return HEADER_Create (wndPtr, wParam, lParam);
return HEADER_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return HEADER_Destroy (wndPtr, wParam, lParam);
return HEADER_Destroy (hwnd, wParam, lParam);
case WM_ERASEBKGND:
return 1;
......@@ -1503,33 +1505,33 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return DLGC_WANTTAB | DLGC_WANTARROWS;
case WM_GETFONT:
return HEADER_GetFont (wndPtr);
return HEADER_GetFont (hwnd);
case WM_LBUTTONDBLCLK:
return HEADER_LButtonDblClk (wndPtr, wParam, lParam);
return HEADER_LButtonDblClk (hwnd, wParam, lParam);
case WM_LBUTTONDOWN:
return HEADER_LButtonDown (wndPtr, wParam, lParam);
return HEADER_LButtonDown (hwnd, wParam, lParam);
case WM_LBUTTONUP:
return HEADER_LButtonUp (wndPtr, wParam, lParam);
return HEADER_LButtonUp (hwnd, wParam, lParam);
case WM_MOUSEMOVE:
return HEADER_MouseMove (wndPtr, wParam, lParam);
return HEADER_MouseMove (hwnd, wParam, lParam);
/* case WM_NOTIFYFORMAT: */
case WM_PAINT:
return HEADER_Paint (wndPtr, wParam);
return HEADER_Paint (hwnd, wParam);
case WM_RBUTTONUP:
return HEADER_RButtonUp (wndPtr, wParam, lParam);
return HEADER_RButtonUp (hwnd, wParam, lParam);
case WM_SETCURSOR:
return HEADER_SetCursor (wndPtr, wParam, lParam);
return HEADER_SetCursor (hwnd, wParam, lParam);
case WM_SETFONT:
return HEADER_SetFont (wndPtr, wParam, lParam);
return HEADER_SetFont (hwnd, wParam, lParam);
default:
if (msg >= WM_USER)
......
/*
* Hotkey control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
*
* NOTES
* Development in progress. An author is needed! Any volunteers?
......@@ -19,7 +19,7 @@
#include "debug.h"
#define HOTKEY_GetInfoPtr(wndPtr) ((HOTKEY_INFO *)wndPtr->wExtra[0])
#define HOTKEY_GetInfoPtr(hwnd) ((HOTKEY_INFO *)GetWindowLongA (hwnd, 0))
/* << HOTHEY_GetHotKey >> */
......@@ -32,7 +32,7 @@
static LRESULT
HOTKEY_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr;
TEXTMETRICA tm;
......@@ -40,35 +40,25 @@ HOTKEY_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
/* allocate memory for info structure */
infoPtr = (HOTKEY_INFO *)COMCTL32_Alloc (sizeof(HOTKEY_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (listview, "could not allocate info memory!\n");
return 0;
}
if ((HOTKEY_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (listview, "pointer assignment error!\n");
return 0;
}
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
/* initialize info structure */
/* get default font height */
hdc = GetDC (wndPtr->hwndSelf);
hdc = GetDC (hwnd);
GetTextMetricsA (hdc, &tm);
infoPtr->nHeight = tm.tmHeight;
ReleaseDC (wndPtr->hwndSelf, hdc);
ReleaseDC (hwnd, hdc);
return 0;
}
static LRESULT
HOTKEY_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd);
......@@ -80,18 +70,18 @@ HOTKEY_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HOTKEY_EraseBackground (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd); */
HBRUSH hBrush;
RECT rc;
hBrush =
(HBRUSH)SendMessageA (wndPtr->parent->hwndSelf, WM_CTLCOLOREDIT,
wParam, (LPARAM)wndPtr->hwndSelf);
(HBRUSH)SendMessageA (GetParent (hwnd), WM_CTLCOLOREDIT,
wParam, (LPARAM)hwnd);
if (hBrush)
hBrush = (HBRUSH)GetStockObject (WHITE_BRUSH);
GetClientRect (wndPtr->hwndSelf, &rc);
GetClientRect (hwnd, &rc);
FillRect ((HDC)wParam, &rc, hBrush);
......@@ -100,18 +90,18 @@ HOTKEY_EraseBackground (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
HOTKEY_GetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_GetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd);
return infoPtr->hFont;
}
static LRESULT
HOTKEY_KeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd); */
switch (wParam) {
case VK_RETURN:
......@@ -120,7 +110,7 @@ HOTKEY_KeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
case VK_DELETE:
case VK_ESCAPE:
case VK_BACK:
return DefWindowProcA (wndPtr->hwndSelf, WM_KEYDOWN, wParam, lParam);
return DefWindowProcA (hwnd, WM_KEYDOWN, wParam, lParam);
case VK_SHIFT:
case VK_CONTROL:
......@@ -138,9 +128,9 @@ HOTKEY_KeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HOTKEY_KeyUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_KeyUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd); */
FIXME (hotkey, " %d\n", wParam);
......@@ -149,9 +139,9 @@ HOTKEY_KeyUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HOTKEY_KillFocus (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_KillFocus (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd);
infoPtr->bFocus = FALSE;
DestroyCaret ();
......@@ -161,22 +151,22 @@ HOTKEY_KillFocus (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HOTKEY_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd); */
SetFocus (wndPtr->hwndSelf);
SetFocus (hwnd);
return 0;
}
__inline__ static LRESULT
HOTKEY_NCCreate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
wndPtr->dwExStyle |= WS_EX_CLIENTEDGE;
return DefWindowProcA (wndPtr->hwndSelf, WM_NCCREATE, wParam, lParam);
DWORD dwExStyle = GetWindowLongA (hwnd, GWL_EXSTYLE);
SetWindowLongA (hwnd, GWL_EXSTYLE, dwExStyle | WS_EX_CLIENTEDGE);
return DefWindowProcA (hwnd, WM_NCCREATE, wParam, lParam);
}
......@@ -184,18 +174,18 @@ HOTKEY_NCCreate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
HOTKEY_SetFocus (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_SetFocus (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd);
infoPtr->bFocus = TRUE;
CreateCaret (wndPtr->hwndSelf, (HBITMAP)0, 1, infoPtr->nHeight);
CreateCaret (hwnd, (HBITMAP)0, 1, infoPtr->nHeight);
SetCaretPos (1, 1);
ShowCaret (wndPtr->hwndSelf);
ShowCaret (hwnd);
return 0;
......@@ -203,16 +193,16 @@ HOTKEY_SetFocus (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
HOTKEY_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr);
HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd);
TEXTMETRICA tm;
HDC hdc;
HFONT hOldFont = 0;
infoPtr->hFont = (HFONT)wParam;
hdc = GetDC (wndPtr->hwndSelf);
hdc = GetDC (hwnd);
if (infoPtr->hFont)
hOldFont = SelectObject (hdc, infoPtr->hFont);
......@@ -221,7 +211,7 @@ HOTKEY_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if (infoPtr->hFont)
SelectObject (hdc, hOldFont);
ReleaseDC (wndPtr->hwndSelf, hdc);
ReleaseDC (hwnd, hdc);
if (LOWORD(lParam)) {
......@@ -234,9 +224,9 @@ HOTKEY_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT WINE_UNUSED
HOTKEY_SysKeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_SysKeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd); */
switch (wParam) {
case VK_RETURN:
......@@ -245,7 +235,7 @@ HOTKEY_SysKeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
case VK_DELETE:
case VK_ESCAPE:
case VK_BACK:
return DefWindowProcA (wndPtr->hwndSelf, WM_SYSKEYDOWN, wParam, lParam);
return DefWindowProcA (hwnd, WM_SYSKEYDOWN, wParam, lParam);
case VK_SHIFT:
case VK_CONTROL:
......@@ -263,9 +253,9 @@ HOTKEY_SysKeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT WINE_UNUSED
HOTKEY_SysKeyUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
HOTKEY_SysKeyUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr(wndPtr); */
/* HOTKEY_INFO *infoPtr = HOTKEY_GetInfoPtr (hwnd); */
FIXME (hotkey, " %d\n", wParam);
......@@ -277,8 +267,6 @@ HOTKEY_SysKeyUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
HOTKEY_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
/* case HKM_GETHOTKEY: */
......@@ -288,44 +276,44 @@ HOTKEY_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case WM_CHAR: */
case WM_CREATE:
return HOTKEY_Create (wndPtr, wParam, lParam);
return HOTKEY_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return HOTKEY_Destroy (wndPtr, wParam, lParam);
return HOTKEY_Destroy (hwnd, wParam, lParam);
case WM_ERASEBKGND:
return HOTKEY_EraseBackground (wndPtr, wParam, lParam);
return HOTKEY_EraseBackground (hwnd, wParam, lParam);
case WM_GETDLGCODE:
return DLGC_WANTCHARS | DLGC_WANTARROWS;
case WM_GETFONT:
return HOTKEY_GetFont (wndPtr, wParam, lParam);
return HOTKEY_GetFont (hwnd, wParam, lParam);
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
return HOTKEY_KeyDown (wndPtr, wParam, lParam);
return HOTKEY_KeyDown (hwnd, wParam, lParam);
case WM_KEYUP:
case WM_SYSKEYUP:
return HOTKEY_KeyUp (wndPtr, wParam, lParam);
return HOTKEY_KeyUp (hwnd, wParam, lParam);
case WM_KILLFOCUS:
return HOTKEY_KillFocus (wndPtr, wParam, lParam);
return HOTKEY_KillFocus (hwnd, wParam, lParam);
case WM_LBUTTONDOWN:
return HOTKEY_LButtonDown (wndPtr, wParam, lParam);
return HOTKEY_LButtonDown (hwnd, wParam, lParam);
case WM_NCCREATE:
return HOTKEY_NCCreate (wndPtr, wParam, lParam);
return HOTKEY_NCCreate (hwnd, wParam, lParam);
/* case WM_PAINT: */
case WM_SETFOCUS:
return HOTKEY_SetFocus (wndPtr, wParam, lParam);
return HOTKEY_SetFocus (hwnd, wParam, lParam);
case WM_SETFONT:
return HOTKEY_SetFont (wndPtr, wParam, lParam);
return HOTKEY_SetFont (hwnd, wParam, lParam);
/* case WM_SYSCHAR: */
......
/* IP Address control
/*
* IP Address control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
* Copyright 1998 Alex Priem <alexp@sci.kun.nl>
*
* NOTES
......@@ -29,13 +30,13 @@
#include "debug.h"
#define IPADDRESS_GetInfoPtr(wndPtr) ((IPADDRESS_INFO *)wndPtr->wExtra[0])
#define IPADDRESS_GetInfoPtr(hwnd) ((IPADDRESS_INFO *)GetWindowLongA (hwnd, 0))
static BOOL
IPADDRESS_SendNotify (WND *wndPtr, UINT command);
IPADDRESS_SendNotify (HWND hwnd, UINT command);
static BOOL
IPADDRESS_SendIPAddressNotify (WND *wndPtr, UINT field, BYTE newValue);
IPADDRESS_SendIPAddressNotify (HWND hwnd, UINT field, BYTE newValue);
/* property name of tooltip window handle */
......@@ -49,14 +50,14 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static VOID
IPADDRESS_Refresh (WND *wndPtr, HDC hdc)
IPADDRESS_Refresh (HWND hwnd, HDC hdc)
{
RECT rcClient;
HBRUSH hbr;
COLORREF clr=GetSysColor (COLOR_3DDKSHADOW);
int i,x,fieldsize;
GetClientRect (wndPtr->hwndSelf, &rcClient);
GetClientRect (hwnd, &rcClient);
hbr = CreateSolidBrush (RGB(255,255,255));
DrawEdge (hdc, &rcClient, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
FillRect (hdc, &rcClient, hbr);
......@@ -81,7 +82,7 @@ IPADDRESS_Refresh (WND *wndPtr, HDC hdc)
static LRESULT
IPADDRESS_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
IPADDRESS_INFO *infoPtr;
RECT rcClient, edit;
......@@ -90,14 +91,9 @@ IPADDRESS_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr = (IPADDRESS_INFO *)COMCTL32_Alloc (sizeof(IPADDRESS_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
if (infoPtr == NULL) {
ERR (ipaddress, "could not allocate info memory!\n");
return 0;
}
GetClientRect (wndPtr->hwndSelf, &rcClient);
GetClientRect (hwnd, &rcClient);
fieldsize=(rcClient.right-rcClient.left) /4;
......@@ -105,12 +101,12 @@ IPADDRESS_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
edit.bottom=rcClient.bottom-2;
lpipsi=(LPIP_SUBCLASS_INFO)
GetPropA ((HWND)wndPtr->hwndSelf,IP_SUBCLASS_PROP);
GetPropA ((HWND)hwnd, IP_SUBCLASS_PROP);
if (lpipsi == NULL) {
lpipsi= (LPIP_SUBCLASS_INFO) COMCTL32_Alloc (sizeof(IP_SUBCLASS_INFO));
lpipsi->wndPtr=wndPtr;
lpipsi->hwnd = hwnd;
lpipsi->uRefCount++;
SetPropA ((HWND)wndPtr->hwndSelf, IP_SUBCLASS_PROP,
SetPropA ((HWND)hwnd, IP_SUBCLASS_PROP,
(HANDLE)lpipsi);
/* infoPtr->lpipsi= lpipsi; */
} else
......@@ -124,7 +120,7 @@ IPADDRESS_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
lpipsi->hwndIP[i]= CreateWindowA ("edit", NULL,
WS_CHILD | WS_VISIBLE | ES_LEFT,
edit.left, edit.top, edit.right-edit.left, edit.bottom-edit.top,
wndPtr->hwndSelf, (HMENU) 1, wndPtr->hInstance, NULL);
hwnd, (HMENU) 1, GetWindowLongA (hwnd, GWL_HINSTANCE), NULL);
lpipsi->wpOrigProc[i]= (WNDPROC)
SetWindowLongA (lpipsi->hwndIP[i],GWL_WNDPROC, (LONG)
IPADDRESS_SubclassProc);
......@@ -139,12 +135,12 @@ IPADDRESS_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
IPADDRESS_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
int i;
IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr(wndPtr);
IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr (hwnd);
LPIP_SUBCLASS_INFO lpipsi=(LPIP_SUBCLASS_INFO)
GetPropA ((HWND)wndPtr->hwndSelf,IP_SUBCLASS_PROP);
GetPropA ((HWND)hwnd, IP_SUBCLASS_PROP);
for (i=0; i<=3; i++) {
SetWindowLongA ((HWND)lpipsi->hwndIP[i], GWL_WNDPROC,
......@@ -157,100 +153,99 @@ IPADDRESS_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
IPADDRESS_KillFocus (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_KillFocus (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
TRACE (ipaddress,"\n");
hdc = GetDC (wndPtr->hwndSelf);
IPADDRESS_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
IPADDRESS_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
IPADDRESS_SendIPAddressNotify (wndPtr, 0, 0); /* FIXME: should use -1 */
IPADDRESS_SendNotify (wndPtr, EN_KILLFOCUS);
InvalidateRect (wndPtr->hwndSelf, NULL, TRUE);
IPADDRESS_SendIPAddressNotify (hwnd, 0, 0); /* FIXME: should use -1 */
IPADDRESS_SendNotify (hwnd, EN_KILLFOCUS);
InvalidateRect (hwnd, NULL, TRUE);
return 0;
}
static LRESULT
IPADDRESS_Paint (WND *wndPtr, WPARAM wParam)
IPADDRESS_Paint (HWND hwnd, WPARAM wParam)
{
HDC hdc;
PAINTSTRUCT ps;
hdc = wParam==0 ? BeginPaint (wndPtr->hwndSelf, &ps) : (HDC)wParam;
IPADDRESS_Refresh (wndPtr, hdc);
hdc = wParam==0 ? BeginPaint (hwnd, &ps) : (HDC)wParam;
IPADDRESS_Refresh (hwnd, hdc);
if(!wParam)
EndPaint (wndPtr->hwndSelf, &ps);
EndPaint (hwnd, &ps);
return 0;
}
static LRESULT
IPADDRESS_SetFocus (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_SetFocus (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
TRACE (ipaddress,"\n");
hdc = GetDC (wndPtr->hwndSelf);
IPADDRESS_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
IPADDRESS_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return 0;
}
static LRESULT
IPADDRESS_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_Size (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr(wndPtr); */
/* IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr (hwnd); */
TRACE (ipaddress,"\n");
return 0;
}
static BOOL
IPADDRESS_SendNotify (WND *wndPtr, UINT command)
IPADDRESS_SendNotify (HWND hwnd, UINT command)
{
TRACE (ipaddress, "%x\n",command);
return (BOOL)SendMessageA (GetParent (wndPtr->hwndSelf), WM_COMMAND,
MAKEWPARAM (wndPtr->wIDmenu,command), (LPARAM) wndPtr->hwndSelf);
return (BOOL)SendMessageA (GetParent (hwnd), WM_COMMAND,
MAKEWPARAM (GetWindowLongA (hwnd, GWL_ID),command), (LPARAM)hwnd);
}
static BOOL
IPADDRESS_SendIPAddressNotify (WND *wndPtr, UINT field, BYTE newValue)
IPADDRESS_SendIPAddressNotify (HWND hwnd, UINT field, BYTE newValue)
{
NMIPADDRESS nmip;
TRACE (ipaddress, "%x %x\n",field,newValue);
nmip.hdr.hwndFrom = wndPtr->hwndSelf;
nmip.hdr.idFrom = wndPtr->wIDmenu;
nmip.hdr.hwndFrom = hwnd;
nmip.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmip.hdr.code = IPN_FIELDCHANGED;
nmip.iField=field;
nmip.iValue=newValue;
return (BOOL)SendMessageA (GetParent (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM)wndPtr->wIDmenu, (LPARAM)&nmip);
return (BOOL)SendMessageA (GetParent (hwnd), WM_NOTIFY,
(WPARAM)nmip.hdr.idFrom, (LPARAM)&nmip);
}
static LRESULT
IPADDRESS_ClearAddress (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_ClearAddress (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
int i;
HDC hdc;
char buf[1];
LPIP_SUBCLASS_INFO lpipsi=(LPIP_SUBCLASS_INFO)
GetPropA ((HWND)wndPtr->hwndSelf,IP_SUBCLASS_PROP);
GetPropA ((HWND)hwnd,IP_SUBCLASS_PROP);
TRACE (ipaddress,"\n");
......@@ -258,39 +253,41 @@ IPADDRESS_ClearAddress (WND *wndPtr, WPARAM wParam, LPARAM lParam)
for (i=0; i<=3; i++)
SetWindowTextA (lpipsi->hwndIP[i],buf);
hdc = GetDC (wndPtr->hwndSelf);
IPADDRESS_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
IPADDRESS_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return 0;
}
static LRESULT
IPADDRESS_IsBlank (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_IsBlank (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
int i;
char buf[20];
LPIP_SUBCLASS_INFO lpipsi=(LPIP_SUBCLASS_INFO)
GetPropA ((HWND)wndPtr->hwndSelf,IP_SUBCLASS_PROP);
GetPropA ((HWND)hwnd, IP_SUBCLASS_PROP);
TRACE (ipaddress,"\n");
for (i=0; i<=3; i++) {
GetWindowTextA (lpipsi->hwndIP[i],buf,5);
if (buf[0]) return 0;
if (buf[0])
return 0;
}
return 1;
}
static LRESULT
IPADDRESS_GetAddress (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_GetAddress (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
char field[20];
int i,valid,fieldvalue;
DWORD ip_addr;
IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr(wndPtr);
IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr (hwnd);
LPIP_SUBCLASS_INFO lpipsi=(LPIP_SUBCLASS_INFO)
GetPropA ((HWND)wndPtr->hwndSelf,IP_SUBCLASS_PROP);
GetPropA ((HWND)hwnd, IP_SUBCLASS_PROP);
TRACE (ipaddress,"\n");
......@@ -316,11 +313,11 @@ IPADDRESS_GetAddress (WND *wndPtr, WPARAM wParam, LPARAM lParam)
return valid;
}
static LRESULT
IPADDRESS_SetRange (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
IPADDRESS_SetRange (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr(wndPtr);
IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr (hwnd);
INT index;
TRACE (ipaddress,"\n");
......@@ -334,12 +331,12 @@ IPADDRESS_SetRange (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
static LRESULT
IPADDRESS_SetAddress (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_SetAddress (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr (hwnd);
HDC hdc;
IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr(wndPtr);
LPIP_SUBCLASS_INFO lpipsi=(LPIP_SUBCLASS_INFO)
GetPropA ((HWND)wndPtr->hwndSelf,IP_SUBCLASS_PROP);
GetPropA ((HWND)hwnd, IP_SUBCLASS_PROP);
int i,ip_address,value;
char buf[20];
......@@ -352,14 +349,14 @@ IPADDRESS_SetAddress (WND *wndPtr, WPARAM wParam, LPARAM lParam)
{
sprintf (buf,"%d",value);
SetWindowTextA (lpipsi->hwndIP[i],buf);
IPADDRESS_SendNotify (wndPtr, EN_CHANGE);
IPADDRESS_SendNotify (hwnd, EN_CHANGE);
}
ip_address/=256;
}
hdc = GetDC (wndPtr->hwndSelf); /* & send notifications */
IPADDRESS_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd); /* & send notifications */
IPADDRESS_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
......@@ -368,11 +365,11 @@ IPADDRESS_SetAddress (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
IPADDRESS_SetFocusToField (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_SetFocusToField (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr(wndPtr); */
/* IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr (hwnd); */
LPIP_SUBCLASS_INFO lpipsi=(LPIP_SUBCLASS_INFO)
GetPropA ((HWND)wndPtr->hwndSelf,IP_SUBCLASS_PROP);
GetPropA ((HWND)hwnd, IP_SUBCLASS_PROP);
INT index;
index=(INT) wParam;
......@@ -386,13 +383,13 @@ IPADDRESS_SetFocusToField (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
IPADDRESS_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
IPADDRESS_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACE (ipaddress, "\n");
SetFocus (wndPtr->hwndSelf);
IPADDRESS_SendNotify (wndPtr, EN_SETFOCUS);
IPADDRESS_SetFocusToField (wndPtr, 0, 0);
SetFocus (hwnd);
IPADDRESS_SendNotify (hwnd, EN_SETFOCUS);
IPADDRESS_SetFocusToField (hwnd, 0, 0);
return TRUE;
}
......@@ -500,51 +497,49 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case IPM_CLEARADDRESS:
return IPADDRESS_ClearAddress (wndPtr, wParam, lParam);
return IPADDRESS_ClearAddress (hwnd, wParam, lParam);
case IPM_SETADDRESS:
return IPADDRESS_SetAddress (wndPtr, wParam, lParam);
return IPADDRESS_SetAddress (hwnd, wParam, lParam);
case IPM_GETADDRESS:
return IPADDRESS_GetAddress (wndPtr, wParam, lParam);
return IPADDRESS_GetAddress (hwnd, wParam, lParam);
case IPM_SETRANGE:
return IPADDRESS_SetRange (wndPtr, wParam, lParam);
return IPADDRESS_SetRange (hwnd, wParam, lParam);
case IPM_SETFOCUS:
return IPADDRESS_SetFocusToField (wndPtr, wParam, lParam);
return IPADDRESS_SetFocusToField (hwnd, wParam, lParam);
case IPM_ISBLANK:
return IPADDRESS_IsBlank (wndPtr, wParam, lParam);
return IPADDRESS_IsBlank (hwnd, wParam, lParam);
case WM_CREATE:
return IPADDRESS_Create (wndPtr, wParam, lParam);
return IPADDRESS_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return IPADDRESS_Destroy (wndPtr, wParam, lParam);
return IPADDRESS_Destroy (hwnd, wParam, lParam);
case WM_GETDLGCODE:
return DLGC_WANTARROWS | DLGC_WANTCHARS;
case WM_KILLFOCUS:
return IPADDRESS_KillFocus (wndPtr, wParam, lParam);
return IPADDRESS_KillFocus (hwnd, wParam, lParam);
case WM_LBUTTONDOWN:
return IPADDRESS_LButtonDown (wndPtr, wParam, lParam);
return IPADDRESS_LButtonDown (hwnd, wParam, lParam);
case WM_PAINT:
return IPADDRESS_Paint (wndPtr, wParam);
return IPADDRESS_Paint (hwnd, wParam);
case WM_SETFOCUS:
return IPADDRESS_SetFocus (wndPtr, wParam, lParam);
return IPADDRESS_SetFocus (hwnd, wParam, lParam);
case WM_SIZE:
return IPADDRESS_Size (wndPtr, wParam, lParam);
return IPADDRESS_Size (hwnd, wParam, lParam);
default:
if (uMsg >= WM_USER)
......
/*
* Month calendar control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
......@@ -20,7 +20,7 @@
#include "debug.h"
#define MONTHCAL_GetInfoPtr(wndPtr) ((MONTHCAL_INFO *)wndPtr->wExtra[0])
#define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)GetWindowLongA (hwnd, 0))
......@@ -28,23 +28,14 @@
static LRESULT
MONTHCAL_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
MONTHCAL_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (MONTHCAL_INFO *)COMCTL32_Alloc (sizeof(MONTHCAL_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
if (infoPtr == NULL) {
ERR (monthcal, "could not allocate info memory!\n");
return 0;
}
if ((MONTHCAL_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (monthcal, "pointer assignment error!\n");
return 0;
}
/* initialize info structure */
......@@ -55,9 +46,9 @@ MONTHCAL_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
MONTHCAL_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
MONTHCAL_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(wndPtr);
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr (hwnd);
......@@ -76,17 +67,15 @@ MONTHCAL_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
MONTHCAL_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case WM_CREATE:
return MONTHCAL_Create (wndPtr, wParam, lParam);
return MONTHCAL_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return MONTHCAL_Destroy (wndPtr, wParam, lParam);
return MONTHCAL_Destroy (hwnd, wParam, lParam);
default:
if (uMsg >= WM_USER)
......
/*
* Native Font control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
......@@ -19,29 +19,20 @@
#include "debug.h"
#define NATIVEFONT_GetInfoPtr(wndPtr) ((NATIVEFONT_INFO *)wndPtr->wExtra[0])
#define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO *)GetWindowLongA (hwnd, 0))
static LRESULT
NATIVEFONT_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
NATIVEFONT_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
NATIVEFONT_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (NATIVEFONT_INFO *)COMCTL32_Alloc (sizeof(NATIVEFONT_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
if (infoPtr == NULL) {
ERR (listview, "could not allocate info memory!\n");
return 0;
}
if ((NATIVEFONT_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (listview, "pointer assignment error!\n");
return 0;
}
/* initialize info structure */
......@@ -51,9 +42,9 @@ NATIVEFONT_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
NATIVEFONT_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
NATIVEFONT_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
NATIVEFONT_INFO *infoPtr = NATIVEFONT_GetInfoPtr(wndPtr);
NATIVEFONT_INFO *infoPtr = NATIVEFONT_GetInfoPtr (hwnd);
......@@ -69,16 +60,14 @@ NATIVEFONT_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case WM_CREATE:
return NATIVEFONT_Create (wndPtr, wParam, lParam);
return NATIVEFONT_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return NATIVEFONT_Destroy (wndPtr, wParam, lParam);
return NATIVEFONT_Destroy (hwnd, wParam, lParam);
default:
ERR (nativefont, "unknown msg %04x wp=%08x lp=%08lx\n",
......
/*
* Pager control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
*
* NOTES
* This is just a dummy control. An author is needed! Any volunteers?
......@@ -19,13 +19,13 @@
#include "debug.h"
#define PAGER_GetInfoPtr(wndPtr) ((PAGER_INFO *)wndPtr->wExtra[0])
#define PAGER_GetInfoPtr(hwnd) ((PAGER_INFO *)GetWindowLongA(hwnd, 0))
static __inline__ LRESULT
PAGER_ForwardMouse (WND *wndPtr, WPARAM wParam)
PAGER_ForwardMouse (HWND hwnd, WPARAM wParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
infoPtr->bForward = (BOOL)wParam;
......@@ -34,36 +34,36 @@ PAGER_ForwardMouse (WND *wndPtr, WPARAM wParam)
static __inline__ LRESULT
PAGER_GetBkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_GetBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
return (LRESULT)infoPtr->clrBk;
}
static __inline__ LRESULT
PAGER_GetBorder (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_GetBorder (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
return (LRESULT)infoPtr->nBorder;
}
static __inline__ LRESULT
PAGER_GetButtonSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_GetButtonSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
return (LRESULT)infoPtr->nButtonSize;
}
static LRESULT
PAGER_GetButtonState (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_GetButtonState (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr); */
/* PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); */
FIXME (pager, "empty stub!\n");
......@@ -75,32 +75,31 @@ PAGER_GetButtonState (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static __inline__ LRESULT
PAGER_GetPos (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_GetPos (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
return infoPtr->nPos;
}
static LRESULT
PAGER_RecalcSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_RecalcSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
NMPGCALCSIZE nmpgcs;
if (infoPtr->hwndChild) {
ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
nmpgcs.hdr.hwndFrom = wndPtr->hwndSelf;
nmpgcs.hdr.idFrom = wndPtr->wIDmenu;
nmpgcs.hdr.hwndFrom = hwnd;
nmpgcs.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmpgcs.hdr.code = PGN_CALCSIZE;
nmpgcs.dwFlag =
(wndPtr->dwStyle & PGS_HORZ) ? PGF_CALCWIDTH : PGF_CALCHEIGHT;
SendMessageA (GetParent (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM)wndPtr->wIDmenu, (LPARAM)&nmpgcs);
nmpgcs.dwFlag = (dwStyle & PGS_HORZ) ? PGF_CALCWIDTH : PGF_CALCHEIGHT;
SendMessageA (GetParent (hwnd), WM_NOTIFY,
(WPARAM)nmpgcs.hdr.idFrom, (LPARAM)&nmpgcs);
infoPtr->nChildSize =
(wndPtr->dwStyle & PGS_HORZ) ? nmpgcs.iWidth : nmpgcs.iHeight;
infoPtr->nChildSize = (dwStyle & PGS_HORZ) ? nmpgcs.iWidth : nmpgcs.iHeight;
FIXME (pager, "Child size %d\n", infoPtr->nChildSize);
......@@ -113,9 +112,9 @@ PAGER_RecalcSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static __inline__ LRESULT
PAGER_SetBkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_SetBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
COLORREF clrTemp = infoPtr->clrBk;
infoPtr->clrBk = (COLORREF)lParam;
......@@ -127,9 +126,9 @@ PAGER_SetBkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static __inline__ LRESULT
PAGER_SetBorder (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_SetBorder (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
INT nTemp = infoPtr->nBorder;
infoPtr->nBorder = (INT)lParam;
......@@ -141,9 +140,9 @@ PAGER_SetBorder (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static __inline__ LRESULT
PAGER_SetButtonSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_SetButtonSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
INT nTemp = infoPtr->nButtonSize;
infoPtr->nButtonSize = (INT)lParam;
......@@ -157,9 +156,9 @@ PAGER_SetButtonSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static __inline__ LRESULT
PAGER_SetChild (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_SetChild (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
infoPtr->hwndChild = IsWindow ((HWND)lParam) ? (HWND)lParam : 0;
......@@ -167,7 +166,7 @@ PAGER_SetChild (WND *wndPtr, WPARAM wParam, LPARAM lParam)
/* FIXME: redraw */
if (infoPtr->hwndChild) {
SetParent (infoPtr->hwndChild, wndPtr->hwndSelf);
SetParent (infoPtr->hwndChild, hwnd);
SetWindowPos (infoPtr->hwndChild, HWND_TOP,
0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
}
......@@ -177,9 +176,9 @@ PAGER_SetChild (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static __inline__ LRESULT
PAGER_SetPos (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_SetPos (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
infoPtr->nPos = (INT)lParam;
......@@ -194,23 +193,13 @@ PAGER_SetPos (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
PAGER_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (PAGER_INFO *)COMCTL32_Alloc (sizeof(PAGER_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (pager, "could not allocate info memory!\n");
return 0;
}
if ((PAGER_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (pager, "pointer assignment error!\n");
return 0;
}
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
/* set default settings */
infoPtr->hwndChild = (HWND)NULL;
......@@ -225,9 +214,9 @@ PAGER_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
PAGER_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
......@@ -240,13 +229,13 @@ PAGER_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
PAGER_EraseBackground (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
HBRUSH hBrush = CreateSolidBrush (infoPtr->clrBk);
RECT rect;
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
FillRect ((HDC)wParam, &rect, hBrush);
DeleteObject (hBrush);
......@@ -256,9 +245,9 @@ PAGER_EraseBackground (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
PAGER_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr); */
/* PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); */
TRACE (pager, "stub!\n");
......@@ -270,12 +259,12 @@ PAGER_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
PAGER_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
PAGER_Size (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
RECT rect;
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
if (infoPtr->hwndChild) {
SetWindowPos (infoPtr->hwndChild, HWND_TOP, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
......@@ -294,69 +283,67 @@ PAGER_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case PGM_FORWARDMOUSE:
return PAGER_ForwardMouse (wndPtr, wParam);
return PAGER_ForwardMouse (hwnd, wParam);
case PGM_GETBKCOLOR:
return PAGER_GetBkColor (wndPtr, wParam, lParam);
return PAGER_GetBkColor (hwnd, wParam, lParam);
case PGM_GETBORDER:
return PAGER_GetBorder (wndPtr, wParam, lParam);
return PAGER_GetBorder (hwnd, wParam, lParam);
case PGM_GETBUTTONSIZE:
return PAGER_GetButtonSize (wndPtr, wParam, lParam);
return PAGER_GetButtonSize (hwnd, wParam, lParam);
case PGM_GETBUTTONSTATE:
return PAGER_GetButtonState (wndPtr, wParam, lParam);
return PAGER_GetButtonState (hwnd, wParam, lParam);
/* case PGM_GETDROPTARGET: */
case PGM_GETPOS:
return PAGER_SetPos (wndPtr, wParam, lParam);
return PAGER_SetPos (hwnd, wParam, lParam);
case PGM_RECALCSIZE:
return PAGER_RecalcSize (wndPtr, wParam, lParam);
return PAGER_RecalcSize (hwnd, wParam, lParam);
case PGM_SETBKCOLOR:
return PAGER_SetBkColor (wndPtr, wParam, lParam);
return PAGER_SetBkColor (hwnd, wParam, lParam);
case PGM_SETBORDER:
return PAGER_SetBorder (wndPtr, wParam, lParam);
return PAGER_SetBorder (hwnd, wParam, lParam);
case PGM_SETBUTTONSIZE:
return PAGER_SetButtonSize (wndPtr, wParam, lParam);
return PAGER_SetButtonSize (hwnd, wParam, lParam);
case PGM_SETCHILD:
return PAGER_SetChild (wndPtr, wParam, lParam);
return PAGER_SetChild (hwnd, wParam, lParam);
case PGM_SETPOS:
return PAGER_SetPos (wndPtr, wParam, lParam);
return PAGER_SetPos (hwnd, wParam, lParam);
case WM_CREATE:
return PAGER_Create (wndPtr, wParam, lParam);
return PAGER_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return PAGER_Destroy (wndPtr, wParam, lParam);
return PAGER_Destroy (hwnd, wParam, lParam);
case WM_ERASEBKGND:
return PAGER_EraseBackground (wndPtr, wParam, lParam);
return PAGER_EraseBackground (hwnd, wParam, lParam);
case WM_MOUSEMOVE:
return PAGER_MouseMove (wndPtr, wParam, lParam);
return PAGER_MouseMove (hwnd, wParam, lParam);
case WM_NOTIFY:
case WM_COMMAND:
return SendMessageA (wndPtr->parent->hwndSelf, uMsg, wParam, lParam);
return SendMessageA (GetParent (hwnd), uMsg, wParam, lParam);
/* case WM_PAINT: */
/* return PAGER_Paint (wndPtr, wParam); */
/* return PAGER_Paint (hwnd, wParam); */
case WM_SIZE:
return PAGER_Size (wndPtr, wParam, lParam);
return PAGER_Size (hwnd, wParam, lParam);
default:
if (uMsg >= WM_USER)
......
/*
* Rebar control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
*
* NOTES
* An author is needed! Any volunteers?
......@@ -36,7 +36,7 @@
#define GRIPPER_WIDTH 13
#define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)wndPtr->wExtra[0])
#define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)GetWindowLongA (hwnd, 0))
static VOID
......@@ -79,9 +79,9 @@ REBAR_DrawBand (HDC hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
static VOID
REBAR_Refresh (WND *wndPtr, HDC hdc)
REBAR_Refresh (HWND hwnd, HDC hdc)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
REBAR_BAND *lpBand;
UINT i;
......@@ -89,7 +89,8 @@ REBAR_Refresh (WND *wndPtr, HDC hdc)
lpBand = &infoPtr->bands[i];
if ((lpBand->fStyle & RBBS_HIDDEN) ||
((wndPtr->dwStyle & CCS_VERT) && (lpBand->fStyle & RBBS_NOVERT)))
((GetWindowLongA (hwnd, GWL_STYLE) & CCS_VERT) &&
(lpBand->fStyle & RBBS_NOVERT)))
continue;
REBAR_DrawBand (hdc, infoPtr, lpBand);
......@@ -179,7 +180,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
static VOID
REBAR_CalcVertBand (WND *wndPtr, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
REBAR_CalcVertBand (HWND hwnd, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
{
lpBand->fDraw = 0;
......@@ -243,7 +244,7 @@ REBAR_CalcVertBand (WND *wndPtr, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
(infoPtr->uNumBands > 1))) {
lpBand->fDraw |= DRAW_GRIPPER;
if (wndPtr->dwStyle & RBS_VERTICALGRIPPER) {
if (GetWindowLongA (hwnd, GWL_STYLE) & RBS_VERTICALGRIPPER) {
/* adjust band width */
lpBand->rcBand.right += GRIPPER_WIDTH;
lpBand->uMinHeight += GRIPPER_WIDTH;
......@@ -278,9 +279,10 @@ REBAR_CalcVertBand (WND *wndPtr, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
static VOID
REBAR_Layout (WND *wndPtr, LPRECT lpRect)
REBAR_Layout (HWND hwnd, LPRECT lpRect)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
REBAR_BAND *lpBand;
RECT rcClient;
INT x, y, cx, cy;
......@@ -289,12 +291,12 @@ REBAR_Layout (WND *wndPtr, LPRECT lpRect)
if (lpRect)
rcClient = *lpRect;
else
GetClientRect (wndPtr->hwndSelf, &rcClient);
GetClientRect (hwnd, &rcClient);
x = 0;
y = 0;
if (wndPtr->dwStyle & CCS_VERT) {
if (dwStyle & CCS_VERT) {
cx = 20; /* FIXME: fixed height */
cy = rcClient.bottom - rcClient.top;
}
......@@ -307,11 +309,11 @@ REBAR_Layout (WND *wndPtr, LPRECT lpRect)
lpBand = &infoPtr->bands[i];
if ((lpBand->fStyle & RBBS_HIDDEN) ||
((wndPtr->dwStyle & CCS_VERT) && (lpBand->fStyle & RBBS_NOVERT)))
((dwStyle & CCS_VERT) && (lpBand->fStyle & RBBS_NOVERT)))
continue;
if (wndPtr->dwStyle & CCS_VERT) {
if (dwStyle & CCS_VERT) {
if (lpBand->fStyle & RBBS_VARIABLEHEIGHT)
cx = lpBand->cyMaxChild;
else if (lpBand->fStyle & RBBIM_CHILDSIZE)
......@@ -340,8 +342,8 @@ REBAR_Layout (WND *wndPtr, LPRECT lpRect)
lpBand->uMinHeight = cy;
}
if (wndPtr->dwStyle & CCS_VERT) {
REBAR_CalcVertBand (wndPtr, infoPtr, lpBand);
if (dwStyle & CCS_VERT) {
REBAR_CalcVertBand (hwnd, infoPtr, lpBand);
x += lpBand->uMinHeight;
}
else {
......@@ -350,7 +352,7 @@ REBAR_Layout (WND *wndPtr, LPRECT lpRect)
}
}
if (wndPtr->dwStyle & CCS_VERT) {
if (dwStyle & CCS_VERT) {
infoPtr->calcSize.cx = x;
infoPtr->calcSize.cy = rcClient.bottom - rcClient.top;
}
......@@ -362,9 +364,9 @@ REBAR_Layout (WND *wndPtr, LPRECT lpRect)
static VOID
REBAR_ForceResize (WND *wndPtr)
REBAR_ForceResize (HWND hwnd)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
RECT rc;
TRACE (rebar, " to [%d x %d]!\n",
......@@ -377,21 +379,22 @@ REBAR_ForceResize (WND *wndPtr)
rc.right = infoPtr->calcSize.cx;
rc.bottom = infoPtr->calcSize.cy;
if (wndPtr->dwStyle & WS_BORDER) {
if (GetWindowLongA (hwnd, GWL_STYLE) & WS_BORDER) {
InflateRect (&rc, sysMetrics[SM_CXEDGE], sysMetrics[SM_CYEDGE]);
}
SetWindowPos (wndPtr->hwndSelf, 0, 0, 0,
SetWindowPos (hwnd, 0, 0, 0,
rc.right - rc.left, rc.bottom - rc.top,
SWP_NOMOVE | SWP_NOZORDER | SWP_SHOWWINDOW);
}
static VOID
REBAR_MoveChildWindows (WND *wndPtr)
REBAR_MoveChildWindows (HWND hwnd)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
REBAR_BAND *lpBand;
CHAR szClassName[40];
UINT i;
for (i = 0; i < infoPtr->uNumBands; i++) {
......@@ -402,7 +405,8 @@ REBAR_MoveChildWindows (WND *wndPtr)
if (lpBand->hwndChild) {
TRACE (rebar, "hwndChild = %x\n", lpBand->hwndChild);
if (WIDGETS_IsControl (WIN_FindWndPtr(lpBand->hwndChild), BIC32_COMBO)) {
GetClassNameA (lpBand->hwndChild, szClassName, 40);
if (!lstrcmpA (szClassName, "ComboBox")) {
INT nEditHeight, yPos;
RECT rc;
......@@ -422,7 +426,7 @@ REBAR_MoveChildWindows (WND *wndPtr)
SWP_SHOWWINDOW);
}
#if 0
else if () {
else if (!lstrcmpA (szClassName, WC_COMBOBOXEXA)) {
/* special placement code for extended combo box */
......@@ -441,14 +445,14 @@ REBAR_MoveChildWindows (WND *wndPtr)
static void
REBAR_InternalHitTest (WND *wndPtr, LPPOINT lpPt, UINT *pFlags, INT *pBand)
REBAR_InternalHitTest (HWND hwnd, LPPOINT lpPt, UINT *pFlags, INT *pBand)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
REBAR_BAND *lpBand;
RECT rect;
INT iCount;
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
*pFlags = RBHT_NOWHERE;
if (PtInRect (&rect, *lpPt))
......@@ -521,9 +525,9 @@ REBAR_InternalHitTest (WND *wndPtr, LPPOINT lpPt, UINT *pFlags, INT *pBand)
static LRESULT
REBAR_DeleteBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_DeleteBand (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
UINT uBand = (UINT)wParam;
if (uBand >= infoPtr->uNumBands)
......@@ -556,9 +560,9 @@ REBAR_DeleteBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMCTL32_Free (oldBands);
}
REBAR_Layout (wndPtr, NULL);
REBAR_ForceResize (wndPtr);
REBAR_MoveChildWindows (wndPtr);
REBAR_Layout (hwnd, NULL);
REBAR_ForceResize (hwnd);
REBAR_MoveChildWindows (hwnd);
return TRUE;
}
......@@ -569,9 +573,9 @@ REBAR_DeleteBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_GetBandBorders (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_GetBandBorders (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
/* LPRECT32 lpRect = (LPRECT32)lParam; */
REBAR_BAND *lpBand;
......@@ -581,7 +585,7 @@ REBAR_GetBandBorders (WND *wndPtr, WPARAM wParam, LPARAM lParam)
return 0;
lpBand = &infoPtr->bands[(UINT)wParam];
if (wndPtr->dwStyle & RBS_BANDBORDERS) {
if (GetWindowLongA (hwnd, GWL_STYLE) & RBS_BANDBORDERS) {
}
else {
......@@ -593,9 +597,9 @@ REBAR_GetBandBorders (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
REBAR_GetBandCount (WND *wndPtr)
REBAR_GetBandCount (HWND hwnd)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
TRACE (rebar, "band count %u!\n", infoPtr->uNumBands);
......@@ -604,9 +608,9 @@ REBAR_GetBandCount (WND *wndPtr)
static LRESULT
REBAR_GetBandInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_GetBandInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
LPREBARBANDINFOA lprbbi = (LPREBARBANDINFOA)lParam;
REBAR_BAND *lpBand;
......@@ -675,9 +679,9 @@ REBAR_GetBandInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_GetBandInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_GetBandInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
LPREBARBANDINFOW lprbbi = (LPREBARBANDINFOW)lParam;
REBAR_BAND *lpBand;
......@@ -746,15 +750,15 @@ REBAR_GetBandInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_GetBarHeight (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_GetBarHeight (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
INT nHeight;
REBAR_Layout (wndPtr, NULL);
REBAR_Layout (hwnd, NULL);
nHeight = infoPtr->calcSize.cy;
if (wndPtr->dwStyle & WS_BORDER)
if (GetWindowLongA (hwnd, GWL_STYLE) & WS_BORDER)
nHeight += (2 * sysMetrics[SM_CYEDGE]);
FIXME (rebar, "height = %d\n", nHeight);
......@@ -764,9 +768,9 @@ REBAR_GetBarHeight (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_GetBarInfo (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_GetBarInfo (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
LPREBARINFO lpInfo = (LPREBARINFO)lParam;
if (lpInfo == NULL)
......@@ -787,9 +791,9 @@ REBAR_GetBarInfo (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
REBAR_GetBkColor (WND *wndPtr)
REBAR_GetBkColor (HWND hwnd)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
TRACE (rebar, "background color 0x%06lx!\n", infoPtr->clrBk);
......@@ -802,7 +806,7 @@ REBAR_GetBkColor (WND *wndPtr)
static LRESULT
REBAR_GetPalette (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_GetPalette (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
FIXME (rebar, "empty stub!\n");
......@@ -811,9 +815,9 @@ REBAR_GetPalette (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_GetRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_GetRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
INT iBand = (INT)wParam;
LPRECT lprc = (LPRECT)lParam;
REBAR_BAND *lpBand;
......@@ -839,9 +843,9 @@ REBAR_GetRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
REBAR_GetRowCount (WND *wndPtr)
REBAR_GetRowCount (HWND hwnd)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
FIXME (rebar, "%u : semi stub!\n", infoPtr->uNumBands);
......@@ -850,9 +854,9 @@ REBAR_GetRowCount (WND *wndPtr)
static LRESULT
REBAR_GetRowHeight (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_GetRowHeight (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr); */
/* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd); */
FIXME (rebar, "-- height = 20: semi stub!\n");
......@@ -861,9 +865,9 @@ REBAR_GetRowHeight (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
REBAR_GetTextColor (WND *wndPtr)
REBAR_GetTextColor (HWND hwnd)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
TRACE (rebar, "text color 0x%06lx!\n", infoPtr->clrText);
......@@ -872,41 +876,40 @@ REBAR_GetTextColor (WND *wndPtr)
__inline__ static LRESULT
REBAR_GetToolTips (WND *wndPtr)
REBAR_GetToolTips (HWND hwnd)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
return infoPtr->hwndToolTip;
}
__inline__ static LRESULT
REBAR_GetUnicodeFormat (WND *wndPtr)
REBAR_GetUnicodeFormat (HWND hwnd)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
return infoPtr->bUnicode;
}
static LRESULT
REBAR_HitTest (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_HitTest (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr); */
/* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd); */
LPRBHITTESTINFO lprbht = (LPRBHITTESTINFO)lParam;
if (!lprbht)
return -1;
REBAR_InternalHitTest (wndPtr, &lprbht->pt,
&lprbht->flags, &lprbht->iBand);
REBAR_InternalHitTest (hwnd, &lprbht->pt, &lprbht->flags, &lprbht->iBand);
return lprbht->iBand;
}
static LRESULT
REBAR_IdToIndex (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_IdToIndex (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
UINT i;
if (infoPtr == NULL)
......@@ -930,9 +933,9 @@ REBAR_IdToIndex (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_InsertBandA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_InsertBandA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
LPREBARBANDINFOA lprbbi = (LPREBARBANDINFOA)lParam;
UINT uIndex = (UINT)wParam;
REBAR_BAND *lpBand;
......@@ -1008,7 +1011,7 @@ REBAR_InsertBandA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE (rebar, "hwndChild = %x\n", lprbbi->hwndChild);
lpBand->hwndChild = lprbbi->hwndChild;
lpBand->hwndPrevParent =
SetParent (lpBand->hwndChild, wndPtr->hwndSelf);
SetParent (lpBand->hwndChild, hwnd);
}
if (lprbbi->fMask & RBBIM_CHILDSIZE) {
......@@ -1050,18 +1053,18 @@ REBAR_InsertBandA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
REBAR_Layout (wndPtr, NULL);
REBAR_ForceResize (wndPtr);
REBAR_MoveChildWindows (wndPtr);
REBAR_Layout (hwnd, NULL);
REBAR_ForceResize (hwnd);
REBAR_MoveChildWindows (hwnd);
return TRUE;
}
static LRESULT
REBAR_InsertBandW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_InsertBandW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
LPREBARBANDINFOW lprbbi = (LPREBARBANDINFOW)lParam;
UINT uIndex = (UINT)wParam;
REBAR_BAND *lpBand;
......@@ -1137,7 +1140,7 @@ REBAR_InsertBandW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE (rebar, "hwndChild = %x\n", lprbbi->hwndChild);
lpBand->hwndChild = lprbbi->hwndChild;
lpBand->hwndPrevParent =
SetParent (lpBand->hwndChild, wndPtr->hwndSelf);
SetParent (lpBand->hwndChild, hwnd);
}
if (lprbbi->fMask & RBBIM_CHILDSIZE) {
......@@ -1179,18 +1182,18 @@ REBAR_InsertBandW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
REBAR_Layout (wndPtr, NULL);
REBAR_ForceResize (wndPtr);
REBAR_MoveChildWindows (wndPtr);
REBAR_Layout (hwnd, NULL);
REBAR_ForceResize (hwnd);
REBAR_MoveChildWindows (hwnd);
return TRUE;
}
static LRESULT
REBAR_MaximizeBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_MaximizeBand (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr); */
/* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd); */
FIXME (rebar, "(uBand = %u fIdeal = %s)\n",
(UINT)wParam, lParam ? "TRUE" : "FALSE");
......@@ -1201,9 +1204,9 @@ REBAR_MaximizeBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_MinimizeBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_MinimizeBand (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr); */
/* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd); */
FIXME (rebar, "(uBand = %u)\n", (UINT)wParam);
......@@ -1213,9 +1216,9 @@ REBAR_MinimizeBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_MoveBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_MoveBand (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr); */
/* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd); */
FIXME (rebar, "(iFrom = %u iTof = %u)\n",
(UINT)wParam, (UINT)lParam);
......@@ -1226,9 +1229,9 @@ REBAR_MoveBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_SetBandInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_SetBandInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
LPREBARBANDINFOA lprbbi = (LPREBARBANDINFOA)lParam;
REBAR_BAND *lpBand;
......@@ -1271,7 +1274,7 @@ REBAR_SetBandInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if (lprbbi->hwndChild) {
lpBand->hwndChild = lprbbi->hwndChild;
lpBand->hwndPrevParent =
SetParent (lpBand->hwndChild, wndPtr->hwndSelf);
SetParent (lpBand->hwndChild, hwnd);
}
else {
TRACE (rebar, "child: 0x%x prev parent: 0x%x\n",
......@@ -1310,18 +1313,18 @@ REBAR_SetBandInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
lpBand->cxHeader = lprbbi->cxHeader;
}
REBAR_Layout (wndPtr, NULL);
REBAR_ForceResize (wndPtr);
REBAR_MoveChildWindows (wndPtr);
REBAR_Layout (hwnd, NULL);
REBAR_ForceResize (hwnd);
REBAR_MoveChildWindows (hwnd);
return TRUE;
}
static LRESULT
REBAR_SetBandInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_SetBandInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
LPREBARBANDINFOW lprbbi = (LPREBARBANDINFOW)lParam;
REBAR_BAND *lpBand;
......@@ -1364,7 +1367,7 @@ REBAR_SetBandInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if (lprbbi->hwndChild) {
lpBand->hwndChild = lprbbi->hwndChild;
lpBand->hwndPrevParent =
SetParent (lpBand->hwndChild, wndPtr->hwndSelf);
SetParent (lpBand->hwndChild, hwnd);
}
else {
TRACE (rebar, "child: 0x%x prev parent: 0x%x\n",
......@@ -1403,18 +1406,18 @@ REBAR_SetBandInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
lpBand->cxHeader = lprbbi->cxHeader;
}
REBAR_Layout (wndPtr, NULL);
REBAR_ForceResize (wndPtr);
REBAR_MoveChildWindows (wndPtr);
REBAR_Layout (hwnd, NULL);
REBAR_ForceResize (hwnd);
REBAR_MoveChildWindows (hwnd);
return TRUE;
}
static LRESULT
REBAR_SetBarInfo (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_SetBarInfo (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
LPREBARINFO lpInfo = (LPREBARINFO)lParam;
if (lpInfo == NULL)
......@@ -1442,9 +1445,9 @@ REBAR_SetBarInfo (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_SetBkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_SetBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
COLORREF clrTemp;
clrTemp = infoPtr->clrBk;
......@@ -1461,9 +1464,9 @@ REBAR_SetBkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_SetParent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_SetParent (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
HWND hwndTemp = infoPtr->hwndNotify;
infoPtr->hwndNotify = (HWND)wParam;
......@@ -1473,9 +1476,9 @@ REBAR_SetParent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_SetTextColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_SetTextColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
COLORREF clrTemp;
clrTemp = infoPtr->clrText;
......@@ -1491,9 +1494,9 @@ REBAR_SetTextColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
REBAR_SetUnicodeFormat (WND *wndPtr, WPARAM wParam)
REBAR_SetUnicodeFormat (HWND hwnd, WPARAM wParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
BOOL bTemp = infoPtr->bUnicode;
infoPtr->bUnicode = (BOOL)wParam;
return bTemp;
......@@ -1501,9 +1504,9 @@ REBAR_SetUnicodeFormat (WND *wndPtr, WPARAM wParam)
static LRESULT
REBAR_ShowBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_ShowBand (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
REBAR_BAND *lpBand;
if (((INT)wParam < 0) || ((INT)wParam > infoPtr->uNumBands))
......@@ -1524,18 +1527,18 @@ REBAR_ShowBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ShowWindow (lpBand->hwndChild, SW_SHOW);
}
REBAR_Layout (wndPtr, NULL);
REBAR_ForceResize (wndPtr);
REBAR_MoveChildWindows (wndPtr);
REBAR_Layout (hwnd, NULL);
REBAR_ForceResize (hwnd);
REBAR_MoveChildWindows (hwnd);
return TRUE;
}
static LRESULT
REBAR_SizeToRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_SizeToRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
LPRECT lpRect = (LPRECT)lParam;
if (lpRect == NULL)
......@@ -1546,7 +1549,7 @@ REBAR_SizeToRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
#if 0
SetWindowPos (wndPtr->hwndSelf, 0, lpRect->left, lpRect->top,
SetWindowPos (hwnd, 0, lpRect->left, lpRect->top,
lpRect->right - lpRect->left, lpRect->bottom - lpRect->top,
SWP_NOZORDER);
#endif
......@@ -1554,30 +1557,20 @@ REBAR_SizeToRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->calcSize.cx = lpRect->right - lpRect->left;
infoPtr->calcSize.cy = lpRect->bottom - lpRect->top;
REBAR_ForceResize (wndPtr);
REBAR_ForceResize (hwnd);
return TRUE;
}
static LRESULT
REBAR_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (REBAR_INFO *)COMCTL32_Alloc (sizeof(REBAR_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (rebar, "could not allocate info memory!\n");
return 0;
}
if ((REBAR_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (rebar, "pointer assignment error!\n");
return 0;
}
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
/* initialize info structure */
infoPtr->clrBk = CLR_NONE;
......@@ -1589,14 +1582,13 @@ REBAR_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->hcurVert = LoadCursorA (0, IDC_SIZENSA);
infoPtr->hcurDrag = LoadCursorA (0, IDC_SIZEA);
infoPtr->bUnicode = IsWindowUnicode (wndPtr->hwndSelf);
infoPtr->bUnicode = IsWindowUnicode (hwnd);
if (wndPtr->dwStyle & RBS_AUTOSIZE)
if (GetWindowLongA (hwnd, GWL_STYLE) & RBS_AUTOSIZE)
FIXME (rebar, "style RBS_AUTOSIZE set!\n");
#if 0
SendMessageA (wndPtr->parent->hwndSelf, WM_NOTIFYFORMAT,
(WPARAM)wndPtr->hwndSelf, NF_QUERY);
SendMessageA (hwnd, WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);
#endif
TRACE (rebar, "created!\n");
......@@ -1605,9 +1597,9 @@ REBAR_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
REBAR_BAND *lpBand;
INT i;
......@@ -1652,9 +1644,9 @@ REBAR_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_GetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_GetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
return (LRESULT)infoPtr->hFont;
}
......@@ -1662,9 +1654,9 @@ REBAR_GetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
#if 0
static LRESULT
REBAR_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
return 0;
}
......@@ -1672,9 +1664,9 @@ REBAR_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
REBAR_NCCalcSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_NCCalcSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
if (wndPtr->dwStyle & WS_BORDER) {
if (GetWindowLongA (hwnd, GWL_STYLE) & WS_BORDER) {
((LPRECT)lParam)->left += sysMetrics[SM_CXEDGE];
((LPRECT)lParam)->top += sysMetrics[SM_CYEDGE];
((LPRECT)lParam)->right -= sysMetrics[SM_CXEDGE];
......@@ -1686,29 +1678,25 @@ REBAR_NCCalcSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_NCPaint (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_NCPaint (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HWND hwnd = wndPtr->hwndSelf;
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
RECT rcWindow;
HDC hdc;
if ( wndPtr->dwStyle & WS_MINIMIZE ||
!WIN_IsWindowDrawable( wndPtr, 0 )) return 0; /* Nothing to do */
if (dwStyle & WS_MINIMIZE)
return 0; /* Nothing to do */
DefWindowProcA (hwnd, WM_NCPAINT, wParam, lParam);
if (!(hdc = GetDCEx( hwnd, 0, DCX_USESTYLE | DCX_WINDOW ))) return 0;
if (ExcludeVisRect16( hdc, wndPtr->rectClient.left-wndPtr->rectWindow.left,
wndPtr->rectClient.top-wndPtr->rectWindow.top,
wndPtr->rectClient.right-wndPtr->rectWindow.left,
wndPtr->rectClient.bottom-wndPtr->rectWindow.top )
== NULLREGION){
ReleaseDC( hwnd, hdc );
if (!(hdc = GetDCEx( hwnd, 0, DCX_USESTYLE | DCX_WINDOW )))
return 0;
}
if (!(wndPtr->flags & WIN_MANAGED) && (wndPtr->dwStyle & WS_BORDER))
DrawEdge (hdc, &wndPtr->rectWindow, EDGE_ETCHED, BF_RECT);
if (dwStyle & WS_BORDER) {
GetWindowRect (hwnd, &rcWindow);
OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top);
DrawEdge (hdc, &rcWindow, EDGE_ETCHED, BF_RECT);
}
ReleaseDC( hwnd, hdc );
......@@ -1717,36 +1705,37 @@ REBAR_NCPaint (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_Paint (WND *wndPtr, WPARAM wParam)
REBAR_Paint (HWND hwnd, WPARAM wParam)
{
HDC hdc;
PAINTSTRUCT ps;
hdc = wParam==0 ? BeginPaint (wndPtr->hwndSelf, &ps) : (HDC)wParam;
REBAR_Refresh (wndPtr, hdc);
hdc = wParam==0 ? BeginPaint (hwnd, &ps) : (HDC)wParam;
REBAR_Refresh (hwnd, hdc);
if (!wParam)
EndPaint (wndPtr->hwndSelf, &ps);
EndPaint (hwnd, &ps);
return 0;
}
static LRESULT
REBAR_SetCursor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_SetCursor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
POINT pt;
UINT flags;
TRACE (rebar, "code=0x%X id=0x%X\n", LOWORD(lParam), HIWORD(lParam));
GetCursorPos (&pt);
ScreenToClient (wndPtr->hwndSelf, &pt);
ScreenToClient (hwnd, &pt);
REBAR_InternalHitTest (wndPtr, &pt, &flags, NULL);
REBAR_InternalHitTest (hwnd, &pt, &flags, NULL);
if (flags == RBHT_GRABBER) {
if ((wndPtr->dwStyle & CCS_VERT) &&
!(wndPtr->dwStyle & RBS_VERTICALGRIPPER))
if ((dwStyle & CCS_VERT) &&
!(dwStyle & RBS_VERTICALGRIPPER))
SetCursor (infoPtr->hcurVert);
else
SetCursor (infoPtr->hcurHorz);
......@@ -1759,9 +1748,9 @@ REBAR_SetCursor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
REBAR_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
/* TEXTMETRIC32A tm; */
HFONT hFont /*, hOldFont */;
......@@ -1780,10 +1769,10 @@ REBAR_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
*/
if (lParam) {
/*
REBAR_Layout (wndPtr);
hdc = GetDC32 (wndPtr->hwndSelf);
REBAR_Refresh (wndPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
REBAR_Layout (hwnd);
hdc = GetDC32 (hwnd);
REBAR_Refresh (hwnd, hdc);
ReleaseDC32 (hwnd, hdc);
*/
}
......@@ -1791,9 +1780,10 @@ REBAR_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
static LRESULT
REBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
REBAR_Size (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
/* DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE); */
RECT rcParent;
/* INT32 x, y, cx, cy; */
......@@ -1806,12 +1796,12 @@ REBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE (rebar, "sizing rebar!\n");
/* get parent rectangle */
GetClientRect (GetParent (wndPtr->hwndSelf), &rcParent);
GetClientRect (GetParent (hwnd), &rcParent);
/*
REBAR_Layout (wndPtr, &rcParent);
REBAR_Layout (hwnd, &rcParent);
if (wndPtr->dwStyle & CCS_VERT) {
if (wndPtr->dwStyle & CCS_LEFT == CCS_LEFT) {
if (dwStyle & CCS_VERT) {
if (dwStyle & CCS_LEFT == CCS_LEFT) {
x = rcParent.left;
y = rcParent.top;
cx = infoPtr->calcSize.cx;
......@@ -1825,7 +1815,7 @@ REBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
}
else {
if (wndPtr->dwStyle & CCS_TOP) {
if (dwStyle & CCS_TOP) {
x = rcParent.left;
y = rcParent.top;
cx = infoPtr->calcSize.cx;
......@@ -1839,12 +1829,12 @@ REBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
}
SetWindowPos32 (wndPtr->hwndSelf, 0, x, y, cx, cy,
SetWindowPos32 (hwnd, 0, x, y, cx, cy,
SWP_NOZORDER | SWP_SHOWWINDOW);
*/
REBAR_Layout (wndPtr, NULL);
REBAR_ForceResize (wndPtr);
REBAR_MoveChildWindows (wndPtr);
REBAR_Layout (hwnd, NULL);
REBAR_ForceResize (hwnd);
REBAR_MoveChildWindows (hwnd);
return 0;
}
......@@ -1853,155 +1843,153 @@ REBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
/* case RB_BEGINDRAG: */
case RB_DELETEBAND:
return REBAR_DeleteBand (wndPtr, wParam, lParam);
return REBAR_DeleteBand (hwnd, wParam, lParam);
/* case RB_DRAGMOVE: */
/* case RB_ENDDRAG: */
case RB_GETBANDBORDERS:
return REBAR_GetBandBorders (wndPtr, wParam, lParam);
return REBAR_GetBandBorders (hwnd, wParam, lParam);
case RB_GETBANDCOUNT:
return REBAR_GetBandCount (wndPtr);
return REBAR_GetBandCount (hwnd);
/* case RB_GETBANDINFO32: */ /* outdated, just for compatibility */
case RB_GETBANDINFOA:
return REBAR_GetBandInfoA (wndPtr, wParam, lParam);
return REBAR_GetBandInfoA (hwnd, wParam, lParam);
case RB_GETBANDINFOW:
return REBAR_GetBandInfoW (wndPtr, wParam, lParam);
return REBAR_GetBandInfoW (hwnd, wParam, lParam);
case RB_GETBARHEIGHT:
return REBAR_GetBarHeight (wndPtr, wParam, lParam);
return REBAR_GetBarHeight (hwnd, wParam, lParam);
case RB_GETBARINFO:
return REBAR_GetBarInfo (wndPtr, wParam, lParam);
return REBAR_GetBarInfo (hwnd, wParam, lParam);
case RB_GETBKCOLOR:
return REBAR_GetBkColor (wndPtr);
return REBAR_GetBkColor (hwnd);
/* case RB_GETCOLORSCHEME: */
/* case RB_GETDROPTARGET: */
case RB_GETPALETTE:
return REBAR_GetPalette (wndPtr, wParam, lParam);
return REBAR_GetPalette (hwnd, wParam, lParam);
case RB_GETRECT:
return REBAR_GetRect (wndPtr, wParam, lParam);
return REBAR_GetRect (hwnd, wParam, lParam);
case RB_GETROWCOUNT:
return REBAR_GetRowCount (wndPtr);
return REBAR_GetRowCount (hwnd);
case RB_GETROWHEIGHT:
return REBAR_GetRowHeight (wndPtr, wParam, lParam);
return REBAR_GetRowHeight (hwnd, wParam, lParam);
case RB_GETTEXTCOLOR:
return REBAR_GetTextColor (wndPtr);
return REBAR_GetTextColor (hwnd);
case RB_GETTOOLTIPS:
return REBAR_GetToolTips (wndPtr);
return REBAR_GetToolTips (hwnd);
case RB_GETUNICODEFORMAT:
return REBAR_GetUnicodeFormat (wndPtr);
return REBAR_GetUnicodeFormat (hwnd);
case RB_HITTEST:
return REBAR_HitTest (wndPtr, wParam, lParam);
return REBAR_HitTest (hwnd, wParam, lParam);
case RB_IDTOINDEX:
return REBAR_IdToIndex (wndPtr, wParam, lParam);
return REBAR_IdToIndex (hwnd, wParam, lParam);
case RB_INSERTBANDA:
return REBAR_InsertBandA (wndPtr, wParam, lParam);
return REBAR_InsertBandA (hwnd, wParam, lParam);
case RB_INSERTBANDW:
return REBAR_InsertBandW (wndPtr, wParam, lParam);
return REBAR_InsertBandW (hwnd, wParam, lParam);
case RB_MAXIMIZEBAND:
return REBAR_MaximizeBand (wndPtr, wParam, lParam);
return REBAR_MaximizeBand (hwnd, wParam, lParam);
case RB_MINIMIZEBAND:
return REBAR_MinimizeBand (wndPtr, wParam, lParam);
return REBAR_MinimizeBand (hwnd, wParam, lParam);
case RB_MOVEBAND:
return REBAR_MoveBand (wndPtr, wParam, lParam);
return REBAR_MoveBand (hwnd, wParam, lParam);
case RB_SETBANDINFOA:
return REBAR_SetBandInfoA (wndPtr, wParam, lParam);
return REBAR_SetBandInfoA (hwnd, wParam, lParam);
case RB_SETBANDINFOW:
return REBAR_SetBandInfoW (wndPtr, wParam, lParam);
return REBAR_SetBandInfoW (hwnd, wParam, lParam);
case RB_SETBARINFO:
return REBAR_SetBarInfo (wndPtr, wParam, lParam);
return REBAR_SetBarInfo (hwnd, wParam, lParam);
case RB_SETBKCOLOR:
return REBAR_SetBkColor (wndPtr, wParam, lParam);
return REBAR_SetBkColor (hwnd, wParam, lParam);
/* case RB_SETCOLORSCHEME: */
/* case RB_SETPALETTE: */
/* return REBAR_GetPalette (wndPtr, wParam, lParam); */
/* return REBAR_GetPalette (hwnd, wParam, lParam); */
case RB_SETPARENT:
return REBAR_SetParent (wndPtr, wParam, lParam);
return REBAR_SetParent (hwnd, wParam, lParam);
case RB_SETTEXTCOLOR:
return REBAR_SetTextColor (wndPtr, wParam, lParam);
return REBAR_SetTextColor (hwnd, wParam, lParam);
/* case RB_SETTOOLTIPS: */
case RB_SETUNICODEFORMAT:
return REBAR_SetUnicodeFormat (wndPtr, wParam);
return REBAR_SetUnicodeFormat (hwnd, wParam);
case RB_SHOWBAND:
return REBAR_ShowBand (wndPtr, wParam, lParam);
return REBAR_ShowBand (hwnd, wParam, lParam);
case RB_SIZETORECT:
return REBAR_SizeToRect (wndPtr, wParam, lParam);
return REBAR_SizeToRect (hwnd, wParam, lParam);
case WM_COMMAND:
return SendMessageA (wndPtr->parent->hwndSelf, uMsg, wParam, lParam);
return SendMessageA (GetParent (hwnd), uMsg, wParam, lParam);
case WM_CREATE:
return REBAR_Create (wndPtr, wParam, lParam);
return REBAR_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return REBAR_Destroy (wndPtr, wParam, lParam);
return REBAR_Destroy (hwnd, wParam, lParam);
case WM_GETFONT:
return REBAR_GetFont (wndPtr, wParam, lParam);
return REBAR_GetFont (hwnd, wParam, lParam);
/* case WM_MOUSEMOVE: */
/* return REBAR_MouseMove (wndPtr, wParam, lParam); */
/* return REBAR_MouseMove (hwnd, wParam, lParam); */
case WM_NCCALCSIZE:
return REBAR_NCCalcSize (wndPtr, wParam, lParam);
return REBAR_NCCalcSize (hwnd, wParam, lParam);
case WM_NCPAINT:
return REBAR_NCPaint (wndPtr, wParam, lParam);
return REBAR_NCPaint (hwnd, wParam, lParam);
case WM_NOTIFY:
return SendMessageA (wndPtr->parent->hwndSelf, uMsg, wParam, lParam);
return SendMessageA (GetParent (hwnd), uMsg, wParam, lParam);
case WM_PAINT:
return REBAR_Paint (wndPtr, wParam);
return REBAR_Paint (hwnd, wParam);
case WM_SETCURSOR:
return REBAR_SetCursor (wndPtr, wParam, lParam);
return REBAR_SetCursor (hwnd, wParam, lParam);
case WM_SETFONT:
return REBAR_SetFont (wndPtr, wParam, lParam);
return REBAR_SetFont (hwnd, wParam, lParam);
case WM_SIZE:
return REBAR_Size (wndPtr, wParam, lParam);
return REBAR_Size (hwnd, wParam, lParam);
/* case WM_TIMER: */
......
......@@ -2,7 +2,7 @@
* Interface code to StatusWindow widget/control
*
* Copyright 1996 Bruce Milner
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
*/
#include "commctrl.h"
......@@ -29,7 +29,7 @@
#define VERT_BORDER 2
#define HORZ_GAP 2
#define STATUSBAR_GetInfoPtr(wndPtr) ((STATUSWINDOWINFO *)wndPtr->wExtra[0])
#define STATUSBAR_GetInfoPtr(hwnd) ((STATUSWINDOWINFO *)GetWindowLongA (hwnd, 0))
static void
......@@ -114,13 +114,13 @@ STATUSBAR_DrawPart (HDC hdc, STATUSWINDOWPART *part)
static VOID
STATUSBAR_RefreshPart (WND *wndPtr, STATUSWINDOWPART *part, HDC hdc)
STATUSBAR_RefreshPart (HWND hwnd, STATUSWINDOWPART *part, HDC hdc)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
HBRUSH hbrBk;
HFONT hOldFont;
if (!IsWindowVisible(wndPtr->hwndSelf))
if (!IsWindowVisible (hwnd))
return;
if (self->clrBk != CLR_DEFAULT)
......@@ -134,14 +134,14 @@ STATUSBAR_RefreshPart (WND *wndPtr, STATUSWINDOWPART *part, HDC hdc)
if (part->style == SBT_OWNERDRAW) {
DRAWITEMSTRUCT dis;
dis.CtlID = wndPtr->wIDmenu;
dis.CtlID = GetWindowLongA (hwnd, GWL_ID);
dis.itemID = -1;
dis.hwndItem = wndPtr->hwndSelf;
dis.hwndItem = hwnd;
dis.hDC = hdc;
dis.rcItem = part->bound;
dis.itemData = (INT)part->text;
SendMessageA (GetParent (wndPtr->hwndSelf), WM_DRAWITEM,
(WPARAM)wndPtr->wIDmenu, (LPARAM)&dis);
SendMessageA (GetParent (hwnd), WM_DRAWITEM,
(WPARAM)dis.CtlID, (LPARAM)&dis);
}
else
STATUSBAR_DrawPart (hdc, part);
......@@ -151,65 +151,65 @@ STATUSBAR_RefreshPart (WND *wndPtr, STATUSWINDOWPART *part, HDC hdc)
if (self->clrBk != CLR_DEFAULT)
DeleteObject (hbrBk);
if (wndPtr->dwStyle & SBARS_SIZEGRIP) {
if (GetWindowLongA (hwnd, GWL_STYLE) & SBARS_SIZEGRIP) {
RECT rect;
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
STATUSBAR_DrawSizeGrip (hdc, &rect);
}
}
static BOOL
STATUSBAR_Refresh (WND *wndPtr, HDC hdc)
STATUSBAR_Refresh (HWND hwnd, HDC hdc)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
int i;
RECT rect;
HBRUSH hbrBk;
HFONT hOldFont;
if (!IsWindowVisible(wndPtr->hwndSelf))
if (!IsWindowVisible(hwnd))
return (TRUE);
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
if (self->clrBk != CLR_DEFAULT)
hbrBk = CreateSolidBrush (self->clrBk);
if (infoPtr->clrBk != CLR_DEFAULT)
hbrBk = CreateSolidBrush (infoPtr->clrBk);
else
hbrBk = GetSysColorBrush (COLOR_3DFACE);
FillRect(hdc, &rect, hbrBk);
hOldFont = SelectObject (hdc, self->hFont ? self->hFont : self->hDefaultFont);
hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
if (self->simple) {
STATUSBAR_DrawPart (hdc, &self->part0);
if (infoPtr->simple) {
STATUSBAR_DrawPart (hdc, &infoPtr->part0);
}
else {
for (i = 0; i < self->numParts; i++) {
if (self->parts[i].style == SBT_OWNERDRAW) {
for (i = 0; i < infoPtr->numParts; i++) {
if (infoPtr->parts[i].style == SBT_OWNERDRAW) {
DRAWITEMSTRUCT dis;
dis.CtlID = wndPtr->wIDmenu;
dis.CtlID = GetWindowLongA (hwnd, GWL_ID);
dis.itemID = -1;
dis.hwndItem = wndPtr->hwndSelf;
dis.hwndItem = hwnd;
dis.hDC = hdc;
dis.rcItem = self->parts[i].bound;
dis.itemData = (INT)self->parts[i].text;
SendMessageA (GetParent (wndPtr->hwndSelf), WM_DRAWITEM,
(WPARAM)wndPtr->wIDmenu, (LPARAM)&dis);
dis.rcItem = infoPtr->parts[i].bound;
dis.itemData = (INT)infoPtr->parts[i].text;
SendMessageA (GetParent (hwnd), WM_DRAWITEM,
(WPARAM)dis.CtlID, (LPARAM)&dis);
}
else
STATUSBAR_DrawPart (hdc, &self->parts[i]);
STATUSBAR_DrawPart (hdc, &infoPtr->parts[i]);
}
}
SelectObject (hdc, hOldFont);
if (self->clrBk != CLR_DEFAULT)
if (infoPtr->clrBk != CLR_DEFAULT)
DeleteObject (hbrBk);
if (wndPtr->dwStyle & SBARS_SIZEGRIP)
if (GetWindowLongA(hwnd, GWL_STYLE) & SBARS_SIZEGRIP)
STATUSBAR_DrawSizeGrip (hdc, &rect);
return TRUE;
......@@ -217,15 +217,15 @@ STATUSBAR_Refresh (WND *wndPtr, HDC hdc)
static void
STATUSBAR_SetPartBounds (WND *wndPtr)
STATUSBAR_SetPartBounds (HWND hwnd)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
STATUSWINDOWPART *part;
RECT rect, *r;
int i;
/* get our window size */
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
rect.top += VERT_BORDER;
......@@ -251,7 +251,7 @@ STATUSBAR_SetPartBounds (WND *wndPtr)
TTTOOLINFOA ti;
ti.cbSize = sizeof(TTTOOLINFOA);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = i;
ti.rect = *r;
SendMessageA (self->hwndToolTip, TTM_NEWTOOLRECTA,
......@@ -293,13 +293,14 @@ STATUSBAR_GetBorders (LPARAM lParam)
static LRESULT
STATUSBAR_GetIcon (WND *wndPtr, WPARAM wParam)
STATUSBAR_GetIcon (HWND hwnd, WPARAM wParam)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
INT nPart;
nPart = (INT)wParam & 0x00ff;
if ((nPart < -1) || (nPart >= self->numParts)) return 0;
if ((nPart < -1) || (nPart >= self->numParts))
return 0;
if (nPart == -1)
return (self->part0.hIcon);
......@@ -309,29 +310,29 @@ STATUSBAR_GetIcon (WND *wndPtr, WPARAM wParam)
static LRESULT
STATUSBAR_GetParts (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_GetParts (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
LPINT parts;
INT num_parts;
int i;
INT i;
num_parts = (INT) wParam;
parts = (LPINT) lParam;
if (parts) {
return (self->numParts);
return (infoPtr->numParts);
for (i = 0; i < num_parts; i++) {
parts[i] = self->parts[i].x;
parts[i] = infoPtr->parts[i].x;
}
}
return (self->numParts);
return (infoPtr->numParts);
}
static LRESULT
STATUSBAR_GetRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_GetRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
int part_num;
LPRECT rect;
......@@ -346,9 +347,9 @@ STATUSBAR_GetRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
STATUSBAR_GetTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_GetTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
STATUSWINDOWPART *part;
INT nPart;
LRESULT result;
......@@ -372,18 +373,18 @@ STATUSBAR_GetTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
STATUSBAR_GetTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_GetTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
STATUSWINDOWPART *part;
INT nPart;
LRESULT result;
nPart = ((INT)wParam) & 0x00ff;
if (self->simple)
part = &self->part0;
if (infoPtr->simple)
part = &infoPtr->part0;
else
part = &self->parts[nPart];
part = &infoPtr->parts[nPart];
if (part->style == SBT_OWNERDRAW)
result = (LRESULT)part->text;
......@@ -398,9 +399,9 @@ STATUSBAR_GetTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
STATUSBAR_GetTextLength (WND *wndPtr, WPARAM wParam)
STATUSBAR_GetTextLength (HWND hwnd, WPARAM wParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
STATUSWINDOWPART *part;
INT part_num;
DWORD result;
......@@ -423,14 +424,14 @@ STATUSBAR_GetTextLength (WND *wndPtr, WPARAM wParam)
static LRESULT
STATUSBAR_GetTipTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_GetTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
if (infoPtr->hwndToolTip) {
TTTOOLINFOA ti;
ti.cbSize = sizeof(TTTOOLINFOA);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = LOWORD(wParam);
SendMessageA (infoPtr->hwndToolTip, TTM_GETTEXTA, 0, (LPARAM)&ti);
......@@ -443,14 +444,14 @@ STATUSBAR_GetTipTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
STATUSBAR_GetTipTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_GetTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
if (infoPtr->hwndToolTip) {
TTTOOLINFOW ti;
ti.cbSize = sizeof(TTTOOLINFOW);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = LOWORD(wParam);
SendMessageW (infoPtr->hwndToolTip, TTM_GETTEXTW, 0, (LPARAM)&ti);
......@@ -463,72 +464,72 @@ STATUSBAR_GetTipTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
STATUSBAR_GetUnicodeFormat (WND *wndPtr)
STATUSBAR_GetUnicodeFormat (HWND hwnd)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
return infoPtr->bUnicode;
}
__inline__ static LRESULT
STATUSBAR_IsSimple (WND *wndPtr)
STATUSBAR_IsSimple (HWND hwnd)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
return infoPtr->simple;
}
static LRESULT
STATUSBAR_SetBkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_SetBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
COLORREF oldBkColor;
HDC hdc;
oldBkColor = self->clrBk;
self->clrBk = (COLORREF)lParam;
hdc = GetDC (wndPtr->hwndSelf);
STATUSBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
STATUSBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return oldBkColor;
}
static LRESULT
STATUSBAR_SetIcon (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_SetIcon (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
INT nPart = (INT)wParam & 0x00ff;
HDC hdc;
if ((nPart < -1) || (nPart >= self->numParts))
return FALSE;
hdc = GetDC (wndPtr->hwndSelf);
hdc = GetDC (hwnd);
if (nPart == -1) {
self->part0.hIcon = (HICON)lParam;
if (self->simple)
STATUSBAR_RefreshPart (wndPtr, &self->part0, hdc);
STATUSBAR_RefreshPart (hwnd, &self->part0, hdc);
}
else {
self->parts[nPart].hIcon = (HICON)lParam;
if (!(self->simple))
STATUSBAR_RefreshPart (wndPtr, &self->parts[nPart], hdc);
STATUSBAR_RefreshPart (hwnd, &self->parts[nPart], hdc);
}
ReleaseDC (wndPtr->hwndSelf, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
STATUSBAR_SetMinHeight (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_SetMinHeight (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
if (IsWindowVisible (wndPtr->hwndSelf)) {
HWND parent = GetParent (wndPtr->hwndSelf);
if (IsWindowVisible (hwnd)) {
HWND parent = GetParent (hwnd);
INT width, x, y;
RECT parent_rect;
......@@ -537,10 +538,10 @@ STATUSBAR_SetMinHeight (WND *wndPtr, WPARAM wParam, LPARAM lParam)
width = parent_rect.right - parent_rect.left;
x = parent_rect.left;
y = parent_rect.bottom - self->height;
MoveWindow (wndPtr->hwndSelf, parent_rect.left,
MoveWindow (hwnd, parent_rect.left,
parent_rect.bottom - self->height,
width, self->height, TRUE);
STATUSBAR_SetPartBounds (wndPtr);
STATUSBAR_SetPartBounds (hwnd);
}
return TRUE;
......@@ -548,9 +549,9 @@ STATUSBAR_SetMinHeight (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
STATUSBAR_SetParts (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_SetParts (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
STATUSWINDOWPART *tmp;
HDC hdc;
LPINT parts;
......@@ -594,7 +595,7 @@ STATUSBAR_SetParts (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
ti.cbSize = sizeof(TTTOOLINFOA);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
for (i = nTipCount; i < self->numParts; i++) {
TRACE (statusbar, "add tool %d\n", i);
ti.uId = i;
......@@ -614,20 +615,20 @@ STATUSBAR_SetParts (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
}
STATUSBAR_SetPartBounds (wndPtr);
STATUSBAR_SetPartBounds (hwnd);
hdc = GetDC (wndPtr->hwndSelf);
STATUSBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
STATUSBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
STATUSBAR_SetTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_SetTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
STATUSWINDOWPART *part;
int part_num;
int style;
......@@ -659,18 +660,18 @@ STATUSBAR_SetTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
}
hdc = GetDC (wndPtr->hwndSelf);
STATUSBAR_RefreshPart (wndPtr, part, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
STATUSBAR_RefreshPart (hwnd, part, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
STATUSBAR_SetTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_SetTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
STATUSWINDOWPART *part;
INT part_num, style, len;
LPWSTR text;
......@@ -700,24 +701,24 @@ STATUSBAR_SetTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
}
hdc = GetDC (wndPtr->hwndSelf);
STATUSBAR_RefreshPart (wndPtr, part, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
STATUSBAR_RefreshPart (hwnd, part, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
STATUSBAR_SetTipTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_SetTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
TRACE (statusbar, "part %d: \"%s\"\n", (INT)wParam, (LPSTR)lParam);
if (infoPtr->hwndToolTip) {
TTTOOLINFOA ti;
ti.cbSize = sizeof(TTTOOLINFOA);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = (INT)wParam;
ti.hinst = 0;
ti.lpszText = (LPSTR)lParam;
......@@ -730,15 +731,15 @@ STATUSBAR_SetTipTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
STATUSBAR_SetTipTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_SetTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
TRACE (statusbar, "part %d: \"%s\"\n", (INT)wParam, (LPSTR)lParam);
if (infoPtr->hwndToolTip) {
TTTOOLINFOW ti;
ti.cbSize = sizeof(TTTOOLINFOW);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = (INT)wParam;
ti.hinst = 0;
ti.lpszText = (LPWSTR)lParam;
......@@ -751,9 +752,9 @@ STATUSBAR_SetTipTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
STATUSBAR_SetUnicodeFormat (WND *wndPtr, WPARAM wParam)
STATUSBAR_SetUnicodeFormat (HWND hwnd, WPARAM wParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
BOOL bTemp = infoPtr->bUnicode;
TRACE (statusbar, "(0x%x)\n", (BOOL)wParam);
......@@ -764,31 +765,30 @@ STATUSBAR_SetUnicodeFormat (WND *wndPtr, WPARAM wParam)
static LRESULT
STATUSBAR_Simple (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_Simple (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
HDC hdc;
NMHDR nmhdr;
infoPtr->simple = (BOOL)wParam;
/* send notification */
nmhdr.hwndFrom = wndPtr->hwndSelf;
nmhdr.idFrom = wndPtr->wIDmenu;
nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmhdr.code = SBN_SIMPLEMODECHANGE;
SendMessageA (GetParent (wndPtr->hwndSelf), WM_NOTIFY,
0, (LPARAM)&nmhdr);
SendMessageA (GetParent (hwnd), WM_NOTIFY, 0, (LPARAM)&nmhdr);
hdc = GetDC (wndPtr->hwndSelf);
STATUSBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
STATUSBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
STATUSBAR_WMCreate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_WMCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
LPCREATESTRUCTA lpCreate = (LPCREATESTRUCTA)lParam;
NONCLIENTMETRICSA nclm;
......@@ -798,14 +798,14 @@ STATUSBAR_WMCreate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSWINDOWINFO *self;
self = (STATUSWINDOWINFO*)COMCTL32_Alloc (sizeof(STATUSWINDOWINFO));
wndPtr->wExtra[0] = (DWORD)self;
SetWindowLongA (hwnd, 0, (DWORD)self);
self->numParts = 1;
self->parts = 0;
self->simple = FALSE;
self->clrBk = CLR_DEFAULT;
self->hFont = 0;
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
nclm.cbSize = sizeof(NONCLIENTMETRICSA);
SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
......@@ -826,7 +826,7 @@ STATUSBAR_WMCreate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
self->parts[0].style = 0;
self->parts[0].hIcon = 0;
if (IsWindowUnicode (wndPtr->hwndSelf)) {
if (IsWindowUnicode (hwnd)) {
self->bUnicode = TRUE;
if ((len = lstrlenW ((LPCWSTR)lpCreate->lpszName))) {
self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
......@@ -851,42 +851,42 @@ STATUSBAR_WMCreate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ReleaseDC(0, hdc);
}
if (wndPtr->dwStyle & SBT_TOOLTIPS) {
if (GetWindowLongA (hwnd, GWL_STYLE) & SBT_TOOLTIPS) {
self->hwndToolTip =
CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
wndPtr->hwndSelf, 0,
wndPtr->hInstance, NULL);
hwnd, 0,
GetWindowLongA (hwnd, GWL_HINSTANCE), NULL);
if (self->hwndToolTip) {
NMTOOLTIPSCREATED nmttc;
nmttc.hdr.hwndFrom = wndPtr->hwndSelf;
nmttc.hdr.idFrom = wndPtr->wIDmenu;
nmttc.hdr.hwndFrom = hwnd;
nmttc.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmttc.hdr.code = NM_TOOLTIPSCREATED;
nmttc.hwndToolTips = self->hwndToolTip;
SendMessageA (GetParent (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM)wndPtr->wIDmenu, (LPARAM)&nmttc);
SendMessageA (GetParent (hwnd), WM_NOTIFY,
(WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc);
}
}
GetClientRect (GetParent (wndPtr->hwndSelf), &rect);
GetClientRect (GetParent (hwnd), &rect);
width = rect.right - rect.left;
self->height = self->textHeight + 4 + VERT_BORDER;
MoveWindow (wndPtr->hwndSelf, lpCreate->x, lpCreate->y-1,
MoveWindow (hwnd, lpCreate->x, lpCreate->y-1,
width, self->height, FALSE);
STATUSBAR_SetPartBounds (wndPtr);
STATUSBAR_SetPartBounds (hwnd);
return 0;
}
static LRESULT
STATUSBAR_WMDestroy (WND *wndPtr)
STATUSBAR_WMDestroy (HWND hwnd)
{
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
int i;
for (i = 0; i < self->numParts; i++) {
......@@ -912,17 +912,17 @@ STATUSBAR_WMDestroy (WND *wndPtr)
static __inline__ LRESULT
STATUSBAR_WMGetFont (WND *wndPtr)
STATUSBAR_WMGetFont (HWND hwnd)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
return infoPtr->hFont;
}
static LRESULT
STATUSBAR_WMGetText (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_WMGetText (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
INT len;
if (!(infoPtr->parts[0].text))
......@@ -941,29 +941,29 @@ STATUSBAR_WMGetText (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
STATUSBAR_WMMouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_WMMouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
if (infoPtr->hwndToolTip)
STATUSBAR_RelayEvent (infoPtr->hwndToolTip, wndPtr->hwndSelf,
STATUSBAR_RelayEvent (infoPtr->hwndToolTip, hwnd,
WM_MOUSEMOVE, wParam, lParam);
return 0;
}
static LRESULT
STATUSBAR_WMNCHitTest (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_WMNCHitTest (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
if (wndPtr->dwStyle & SBARS_SIZEGRIP) {
if (GetWindowLongA (hwnd, GWL_STYLE) & SBARS_SIZEGRIP) {
RECT rect;
POINT pt;
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
ScreenToClient (wndPtr->hwndSelf, &pt);
ScreenToClient (hwnd, &pt);
rect.left = rect.right - 13;
rect.top += 2;
......@@ -972,53 +972,51 @@ STATUSBAR_WMNCHitTest (WND *wndPtr, WPARAM wParam, LPARAM lParam)
return HTBOTTOMRIGHT;
}
return DefWindowProcA (wndPtr->hwndSelf, WM_NCHITTEST, wParam, lParam);
return DefWindowProcA (hwnd, WM_NCHITTEST, wParam, lParam);
}
static __inline__ LRESULT
STATUSBAR_WMNCLButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_WMNCLButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PostMessageA (wndPtr->parent->hwndSelf, WM_NCLBUTTONDOWN,
wParam, lParam);
PostMessageA (GetParent (hwnd), WM_NCLBUTTONDOWN, wParam, lParam);
return 0;
}
static __inline__ LRESULT
STATUSBAR_WMNCLButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_WMNCLButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PostMessageA (wndPtr->parent->hwndSelf, WM_NCLBUTTONUP,
wParam, lParam);
PostMessageA (GetParent (hwnd), WM_NCLBUTTONUP, wParam, lParam);
return 0;
}
static LRESULT
STATUSBAR_WMPaint (WND *wndPtr, WPARAM wParam)
STATUSBAR_WMPaint (HWND hwnd, WPARAM wParam)
{
HDC hdc;
PAINTSTRUCT ps;
hdc = wParam==0 ? BeginPaint (wndPtr->hwndSelf, &ps) : (HDC)wParam;
STATUSBAR_Refresh (wndPtr, hdc);
hdc = wParam==0 ? BeginPaint (hwnd, &ps) : (HDC)wParam;
STATUSBAR_Refresh (hwnd, hdc);
if (!wParam)
EndPaint (wndPtr->hwndSelf, &ps);
EndPaint (hwnd, &ps);
return 0;
}
static LRESULT
STATUSBAR_WMSetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_WMSetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
infoPtr->hFont = (HFONT)wParam;
if (LOWORD(lParam) == TRUE) {
HDC hdc = GetDC (wndPtr->hwndSelf);
STATUSBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HDC hdc = GetDC (hwnd);
STATUSBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -1026,9 +1024,9 @@ STATUSBAR_WMSetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
STATUSBAR_WMSetText (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_WMSetText (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
STATUSWINDOWPART *part;
int len;
HDC hdc;
......@@ -1054,18 +1052,18 @@ STATUSBAR_WMSetText (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
}
hdc = GetDC (wndPtr->hwndSelf);
STATUSBAR_RefreshPart (wndPtr, part, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
STATUSBAR_RefreshPart (hwnd, part, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
STATUSBAR_WMSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
STATUSBAR_WMSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (wndPtr);
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
INT width, x, y, flags;
RECT parent_rect;
HWND parent;
......@@ -1079,30 +1077,29 @@ STATUSBAR_WMSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if (flags == SIZE_RESTORED) {
/* width and height don't apply */
parent = GetParent (wndPtr->hwndSelf);
parent = GetParent (hwnd);
GetClientRect (parent, &parent_rect);
width = parent_rect.right - parent_rect.left;
x = parent_rect.left;
y = parent_rect.bottom - infoPtr->height;
MoveWindow (wndPtr->hwndSelf, parent_rect.left,
MoveWindow (hwnd, parent_rect.left,
parent_rect.bottom - infoPtr->height,
width, infoPtr->height, TRUE);
STATUSBAR_SetPartBounds (wndPtr);
STATUSBAR_SetPartBounds (hwnd);
}
return 0;
}
static LRESULT
STATUSBAR_SendNotify (WND *wndPtr, UINT code)
STATUSBAR_SendNotify (HWND hwnd, UINT code)
{
NMHDR nmhdr;
nmhdr.hwndFrom = wndPtr->hwndSelf;
nmhdr.idFrom = wndPtr->wIDmenu;
nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmhdr.code = code;
SendMessageA (GetParent (wndPtr->hwndSelf), WM_NOTIFY,
0, (LPARAM)&nmhdr);
SendMessageA (GetParent (hwnd), WM_NOTIFY, 0, (LPARAM)&nmhdr);
return 0;
}
......@@ -1111,124 +1108,122 @@ STATUSBAR_SendNotify (WND *wndPtr, UINT code)
LRESULT WINAPI
StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr (hwnd);
switch (msg) {
case SB_GETBORDERS:
return STATUSBAR_GetBorders (lParam);
case SB_GETICON:
return STATUSBAR_GetIcon (wndPtr, wParam);
return STATUSBAR_GetIcon (hwnd, wParam);
case SB_GETPARTS:
return STATUSBAR_GetParts (wndPtr, wParam, lParam);
return STATUSBAR_GetParts (hwnd, wParam, lParam);
case SB_GETRECT:
return STATUSBAR_GetRect (wndPtr, wParam, lParam);
return STATUSBAR_GetRect (hwnd, wParam, lParam);
case SB_GETTEXTA:
return STATUSBAR_GetTextA (wndPtr, wParam, lParam);
return STATUSBAR_GetTextA (hwnd, wParam, lParam);
case SB_GETTEXTW:
return STATUSBAR_GetTextW (wndPtr, wParam, lParam);
return STATUSBAR_GetTextW (hwnd, wParam, lParam);
case SB_GETTEXTLENGTHA:
case SB_GETTEXTLENGTHW:
return STATUSBAR_GetTextLength (wndPtr, wParam);
return STATUSBAR_GetTextLength (hwnd, wParam);
case SB_GETTIPTEXTA:
return STATUSBAR_GetTipTextA (wndPtr, wParam, lParam);
return STATUSBAR_GetTipTextA (hwnd, wParam, lParam);
case SB_GETTIPTEXTW:
return STATUSBAR_GetTipTextW (wndPtr, wParam, lParam);
return STATUSBAR_GetTipTextW (hwnd, wParam, lParam);
case SB_GETUNICODEFORMAT:
return STATUSBAR_GetUnicodeFormat (wndPtr);
return STATUSBAR_GetUnicodeFormat (hwnd);
case SB_ISSIMPLE:
return STATUSBAR_IsSimple (wndPtr);
return STATUSBAR_IsSimple (hwnd);
case SB_SETBKCOLOR:
return STATUSBAR_SetBkColor (wndPtr, wParam, lParam);
return STATUSBAR_SetBkColor (hwnd, wParam, lParam);
case SB_SETICON:
return STATUSBAR_SetIcon (wndPtr, wParam, lParam);
return STATUSBAR_SetIcon (hwnd, wParam, lParam);
case SB_SETMINHEIGHT:
return STATUSBAR_SetMinHeight (wndPtr, wParam, lParam);
return STATUSBAR_SetMinHeight (hwnd, wParam, lParam);
case SB_SETPARTS:
return STATUSBAR_SetParts (wndPtr, wParam, lParam);
return STATUSBAR_SetParts (hwnd, wParam, lParam);
case SB_SETTEXTA:
return STATUSBAR_SetTextA (wndPtr, wParam, lParam);
return STATUSBAR_SetTextA (hwnd, wParam, lParam);
case SB_SETTEXTW:
return STATUSBAR_SetTextW (wndPtr, wParam, lParam);
return STATUSBAR_SetTextW (hwnd, wParam, lParam);
case SB_SETTIPTEXTA:
return STATUSBAR_SetTipTextA (wndPtr, wParam, lParam);
return STATUSBAR_SetTipTextA (hwnd, wParam, lParam);
case SB_SETTIPTEXTW:
return STATUSBAR_SetTipTextW (wndPtr, wParam, lParam);
return STATUSBAR_SetTipTextW (hwnd, wParam, lParam);
case SB_SETUNICODEFORMAT:
return STATUSBAR_SetUnicodeFormat (wndPtr, wParam);
return STATUSBAR_SetUnicodeFormat (hwnd, wParam);
case SB_SIMPLE:
return STATUSBAR_Simple (wndPtr, wParam, lParam);
return STATUSBAR_Simple (hwnd, wParam, lParam);
case WM_CREATE:
return STATUSBAR_WMCreate (wndPtr, wParam, lParam);
return STATUSBAR_WMCreate (hwnd, wParam, lParam);
case WM_DESTROY:
return STATUSBAR_WMDestroy (wndPtr);
return STATUSBAR_WMDestroy (hwnd);
case WM_GETFONT:
return STATUSBAR_WMGetFont (wndPtr);
return STATUSBAR_WMGetFont (hwnd);
case WM_GETTEXT:
return STATUSBAR_WMGetText (wndPtr, wParam, lParam);
return STATUSBAR_WMGetText (hwnd, wParam, lParam);
case WM_GETTEXTLENGTH:
return STATUSBAR_GetTextLength (wndPtr, 0);
return STATUSBAR_GetTextLength (hwnd, 0);
case WM_LBUTTONDBLCLK:
return STATUSBAR_SendNotify (wndPtr, NM_DBLCLK);
return STATUSBAR_SendNotify (hwnd, NM_DBLCLK);
case WM_LBUTTONUP:
return STATUSBAR_SendNotify (wndPtr, NM_CLICK);
return STATUSBAR_SendNotify (hwnd, NM_CLICK);
case WM_MOUSEMOVE:
return STATUSBAR_WMMouseMove (wndPtr, wParam, lParam);
return STATUSBAR_WMMouseMove (hwnd, wParam, lParam);
case WM_NCHITTEST:
return STATUSBAR_WMNCHitTest (wndPtr, wParam, lParam);
return STATUSBAR_WMNCHitTest (hwnd, wParam, lParam);
case WM_NCLBUTTONDOWN:
return STATUSBAR_WMNCLButtonDown (wndPtr, wParam, lParam);
return STATUSBAR_WMNCLButtonDown (hwnd, wParam, lParam);
case WM_NCLBUTTONUP:
return STATUSBAR_WMNCLButtonUp (wndPtr, wParam, lParam);
return STATUSBAR_WMNCLButtonUp (hwnd, wParam, lParam);
case WM_PAINT:
return STATUSBAR_WMPaint (wndPtr, wParam);
return STATUSBAR_WMPaint (hwnd, wParam);
case WM_RBUTTONDBLCLK:
return STATUSBAR_SendNotify (wndPtr, NM_RDBLCLK);
return STATUSBAR_SendNotify (hwnd, NM_RDBLCLK);
case WM_RBUTTONUP:
return STATUSBAR_SendNotify (wndPtr, NM_RCLICK);
return STATUSBAR_SendNotify (hwnd, NM_RCLICK);
case WM_SETFONT:
return STATUSBAR_WMSetFont (wndPtr, wParam, lParam);
return STATUSBAR_WMSetFont (hwnd, wParam, lParam);
case WM_SETTEXT:
return STATUSBAR_WMSetText (wndPtr, wParam, lParam);
return STATUSBAR_WMSetText (hwnd, wParam, lParam);
case WM_SIZE:
return STATUSBAR_WMSize (wndPtr, wParam, lParam);
return STATUSBAR_WMSize (hwnd, wParam, lParam);
default:
if (msg >= WM_USER)
......
......@@ -43,7 +43,7 @@
#define TOOLBAR_GetInfoPtr(wndPtr) ((TOOLBAR_INFO *)wndPtr->wExtra[0])
#define TOOLBAR_GetInfoPtr(wndPtr) ((TOOLBAR_INFO *)GetWindowLongA(hwnd,0))
static void
......@@ -168,17 +168,18 @@ TOOLBAR_DrawMasked (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
static void
TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC hdc)
TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
BOOL bFlat = (wndPtr->dwStyle & TBSTYLE_FLAT);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
RECT rc;
if (btnPtr->fsState & TBSTATE_HIDDEN) return;
if (btnPtr->fsState & TBSTATE_HIDDEN)
return;
rc = btnPtr->rect;
if (btnPtr->fsStyle & TBSTYLE_SEP) {
if ((bFlat) && (btnPtr->idCommand == 0))
if ((dwStyle & TBSTYLE_FLAT) && (btnPtr->idCommand == 0))
TOOLBAR_DrawFlatSeparator (&btnPtr->rect, hdc);
return;
}
......@@ -188,7 +189,7 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC hdc)
DrawEdge (hdc, &rc, EDGE_RAISED,
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
if (bFlat) {
if (dwStyle & TBSTYLE_FLAT) {
/* if (infoPtr->himlDis) */
ImageList_Draw (infoPtr->himlDis, btnPtr->iBitmap, hdc,
rc.left+1, rc.top+1, ILD_NORMAL);
......@@ -204,8 +205,7 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC hdc)
/* pressed TBSTYLE_BUTTON */
if (btnPtr->fsState & TBSTATE_PRESSED) {
DrawEdge (hdc, &rc, EDGE_SUNKEN,
BF_RECT | BF_MIDDLE | BF_ADJUST);
DrawEdge (hdc, &rc, EDGE_SUNKEN, BF_RECT | BF_MIDDLE | BF_ADJUST);
ImageList_Draw (infoPtr->himlStd, btnPtr->iBitmap, hdc,
rc.left+2, rc.top+2, ILD_NORMAL);
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState);
......@@ -215,7 +215,7 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC hdc)
/* checked TBSTYLE_CHECK*/
if ((btnPtr->fsStyle & TBSTYLE_CHECK) &&
(btnPtr->fsState & TBSTATE_CHECKED)) {
if (bFlat)
if (dwStyle & TBSTYLE_FLAT)
DrawEdge (hdc, &rc, BDR_SUNKENOUTER,
BF_RECT | BF_MIDDLE | BF_ADJUST);
else
......@@ -223,7 +223,7 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC hdc)
BF_RECT | BF_MIDDLE | BF_ADJUST);
TOOLBAR_DrawPattern (hdc, &rc);
if (bFlat)
if (dwStyle & TBSTYLE_FLAT)
ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
rc.left+2, rc.top+2, ILD_NORMAL);
else
......@@ -248,7 +248,7 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC hdc)
DrawEdge (hdc, &rc, EDGE_RAISED,
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
if (bFlat)
if (dwStyle & TBSTYLE_FLAT)
ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
rc.left+1, rc.top+1, ILD_NORMAL);
else
......@@ -260,23 +260,23 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC hdc)
static void
TOOLBAR_Refresh (WND *wndPtr, HDC hdc)
TOOLBAR_Refresh (HWND hwnd, HDC hdc)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
INT i;
/* draw buttons */
btnPtr = infoPtr->buttons;
for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++)
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
}
static void
TOOLBAR_CalcStrings (WND *wndPtr, LPSIZE lpSize)
TOOLBAR_CalcStrings (HWND hwnd, LPSIZE lpSize)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
INT i;
HDC hdc;
......@@ -310,9 +310,10 @@ TOOLBAR_CalcStrings (WND *wndPtr, LPSIZE lpSize)
static void
TOOLBAR_CalcToolbar (WND *wndPtr)
TOOLBAR_CalcToolbar (HWND hwnd)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
TBUTTON_INFO *btnPtr;
INT i, nRows;
INT x, y, cx, cy;
......@@ -326,7 +327,7 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
#endif
/* --- end new --- */
TOOLBAR_CalcStrings (wndPtr, &sizeString);
TOOLBAR_CalcStrings (hwnd, &sizeString);
if (sizeString.cy > 0)
infoPtr->nButtonHeight = sizeString.cy + infoPtr->nBitmapHeight + 6;
......@@ -345,7 +346,7 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
nRows = 0;
/* calculate the size of each button according to it's style */
/* TOOLBAR_CalcButtons (wndPtr); */
/* TOOLBAR_CalcButtons (hwnd); */
infoPtr->rcBound.top = y;
infoPtr->rcBound.left = x;
......@@ -367,7 +368,7 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
/* UNDOCUMENTED: If a separator has a non zero bitmap index, */
/* it is the actual width of the separator. This is used for */
/* custom controls in toolbars. */
if ((wndPtr->dwStyle & TBSTYLE_WRAPABLE) &&
if ((dwStyle & TBSTYLE_WRAPABLE) &&
(btnPtr->fsState & TBSTATE_WRAP)) {
x = 0;
y += cy;
......@@ -411,7 +412,7 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
}
bWrap = ((bWrap || (x + cx > infoPtr->nWidth)) &&
(wndPtr->dwStyle & TBSTYLE_WRAPABLE));
(dwStyle & TBSTYLE_WRAPABLE));
if (bWrap) {
nRows++;
y += cy;
......@@ -438,7 +439,7 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
/* UNDOCUMENTED: If a separator has a non zero bitmap index, */
/* it is the actual width of the separator. This is used for */
/* custom controls in toolbars. */
if ((wndPtr->dwStyle & TBSTYLE_WRAPABLE) &&
if ((dwStyle & TBSTYLE_WRAPABLE) &&
(btnPtr->fsState & TBSTATE_WRAP)) {
x = 0;
y += cy;
......@@ -474,7 +475,7 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
ti.cbSize = sizeof(TTTOOLINFOA);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = btnPtr->idCommand;
ti.rect = btnPtr->rect;
SendMessageA (infoPtr->hwndToolTip, TTM_NEWTOOLRECTA,
......@@ -498,9 +499,9 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
static INT
TOOLBAR_InternalHitTest (WND *wndPtr, LPPOINT lpPt)
TOOLBAR_InternalHitTest (HWND hwnd, LPPOINT lpPt)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
INT i;
......@@ -611,9 +612,9 @@ TOOLBAR_RelayEvent (HWND hwndTip, HWND hwndMsg, UINT uMsg,
static LRESULT
TOOLBAR_AddBitmap (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPTBADDBITMAP lpAddBmp = (LPTBADDBITMAP)lParam;
INT nIndex = 0;
......@@ -673,9 +674,9 @@ TOOLBAR_AddBitmap (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_AddButtonsA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_AddButtonsA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPTBBUTTON lpTbb = (LPTBBUTTON)lParam;
INT nOldButtons, nNewButtons, nAddButtons, nCount;
HDC hdc;
......@@ -716,7 +717,7 @@ TOOLBAR_AddButtonsA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
ti.cbSize = sizeof (TTTOOLINFOA);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = btnPtr->idCommand;
ti.hinst = 0;
ti.lpszText = LPSTR_TEXTCALLBACKA;
......@@ -726,11 +727,11 @@ TOOLBAR_AddButtonsA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
}
TOOLBAR_CalcToolbar (wndPtr);
TOOLBAR_CalcToolbar (hwnd);
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
......@@ -740,9 +741,9 @@ TOOLBAR_AddButtonsA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_AddStringA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_AddStringA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
if ((wParam) && (HIWORD(lParam) == 0)) {
......@@ -812,9 +813,9 @@ TOOLBAR_AddStringA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_AddStringW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_AddStringW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
if ((wParam) && (HIWORD(lParam) == 0)) {
......@@ -884,9 +885,10 @@ TOOLBAR_AddStringW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_AutoSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_AutoSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
RECT parent_rect;
HWND parent;
/* INT32 x, y; */
......@@ -895,29 +897,29 @@ TOOLBAR_AutoSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE (toolbar, "resize forced!\n");
parent = GetParent (wndPtr->hwndSelf);
parent = GetParent (hwnd);
GetClientRect(parent, &parent_rect);
if (wndPtr->dwStyle & CCS_NORESIZE) {
if (dwStyle & CCS_NORESIZE) {
uPosFlags |= (SWP_NOSIZE | SWP_NOMOVE);
cx = 0;
cy = 0;
}
else {
infoPtr->nWidth = parent_rect.right - parent_rect.left;
TOOLBAR_CalcToolbar (wndPtr);
TOOLBAR_CalcToolbar (hwnd);
cy = infoPtr->nHeight;
cx = infoPtr->nWidth;
}
if (wndPtr->dwStyle & CCS_NOPARENTALIGN)
if (dwStyle & CCS_NOPARENTALIGN)
uPosFlags |= SWP_NOMOVE;
if (!(wndPtr->dwStyle & CCS_NODIVIDER))
if (!(dwStyle & CCS_NODIVIDER))
cy += sysMetrics[SM_CYEDGE];
infoPtr->bAutoSize = TRUE;
SetWindowPos (wndPtr->hwndSelf, HWND_TOP, parent_rect.left, parent_rect.top,
SetWindowPos (hwnd, HWND_TOP, parent_rect.left, parent_rect.top,
cx, cy, uPosFlags);
return 0;
......@@ -925,21 +927,21 @@ TOOLBAR_AutoSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_ButtonCount (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_ButtonCount (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
return infoPtr->nNumButtons;
}
static LRESULT
TOOLBAR_ButtonStructSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_ButtonStructSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (infoPtr == NULL) {
ERR (toolbar, "(0x%08lx, 0x%08x, 0x%08lx)\n", (DWORD)wndPtr, wParam, lParam);
ERR (toolbar, "(0x%x, 0x%x, 0x%lx)\n", hwnd, wParam, lParam);
ERR (toolbar, "infoPtr == NULL!\n");
return 0;
}
......@@ -951,9 +953,9 @@ TOOLBAR_ButtonStructSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_ChangeBitmap (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_ChangeBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
HDC hdc;
INT nIndex;
......@@ -965,18 +967,18 @@ TOOLBAR_ChangeBitmap (WND *wndPtr, WPARAM wParam, LPARAM lParam)
btnPtr = &infoPtr->buttons[nIndex];
btnPtr->iBitmap = LOWORD(lParam);
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
TOOLBAR_CheckButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_CheckButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
HDC hdc;
INT nIndex;
......@@ -1005,11 +1007,11 @@ TOOLBAR_CheckButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
btnPtr->fsState |= TBSTATE_CHECKED;
}
hdc = GetDC (wndPtr->hwndSelf);
hdc = GetDC (hwnd);
if (nOldIndex != -1)
TOOLBAR_DrawButton (wndPtr, &infoPtr->buttons[nOldIndex], hdc);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
TOOLBAR_DrawButton (hwnd, &infoPtr->buttons[nOldIndex], hdc);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
/* FIXME: Send a WM_NOTIFY?? */
......@@ -1018,16 +1020,16 @@ TOOLBAR_CheckButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_CommandToIndex (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_CommandToIndex (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
return TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
}
static LRESULT
TOOLBAR_Customize (WND *wndPtr)
TOOLBAR_Customize (HWND hwnd)
{
FIXME (toolbar, "customization not implemented!\n");
......@@ -1036,9 +1038,9 @@ TOOLBAR_Customize (WND *wndPtr)
static LRESULT
TOOLBAR_DeleteButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_DeleteButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex = (INT)wParam;
if ((nIndex < 0) || (nIndex >= infoPtr->nNumButtons))
......@@ -1050,7 +1052,7 @@ TOOLBAR_DeleteButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
ti.cbSize = sizeof (TTTOOLINFOA);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = infoPtr->buttons[nIndex].idCommand;
SendMessageA (infoPtr->hwndToolTip, TTM_DELTOOLA, 0, (LPARAM)&ti);
......@@ -1081,19 +1083,19 @@ TOOLBAR_DeleteButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMCTL32_Free (oldButtons);
}
TOOLBAR_CalcToolbar (wndPtr);
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect (wndPtr->hwndSelf, NULL, TRUE);
UpdateWindow (wndPtr->hwndSelf);
InvalidateRect (hwnd, NULL, TRUE);
UpdateWindow (hwnd);
return TRUE;
}
static LRESULT
TOOLBAR_EnableButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_EnableButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
HDC hdc;
INT nIndex;
......@@ -1108,9 +1110,9 @@ TOOLBAR_EnableButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
else
btnPtr->fsState |= TBSTATE_ENABLED;
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
......@@ -1120,9 +1122,9 @@ TOOLBAR_EnableButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetBitmap (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
......@@ -1134,22 +1136,25 @@ TOOLBAR_GetBitmap (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static __inline__ LRESULT
TOOLBAR_GetBitmapFlags (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetBitmapFlags (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
return (GetDeviceCaps (0, LOGPIXELSX) >= 120) ? TBBF_LARGE : 0;
}
static LRESULT
TOOLBAR_GetButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPTBBUTTON lpTbb = (LPTBBUTTON)lParam;
INT nIndex = (INT)wParam;
TBUTTON_INFO *btnPtr;
if (infoPtr == NULL) return FALSE;
if (lpTbb == NULL) return FALSE;
if (infoPtr == NULL)
return FALSE;
if (lpTbb == NULL)
return FALSE;
if ((nIndex < 0) || (nIndex >= infoPtr->nNumButtons))
return FALSE;
......@@ -1167,16 +1172,19 @@ TOOLBAR_GetButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetButtonInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPTBBUTTONINFOA lpTbInfo = (LPTBBUTTONINFOA)lParam;
TBUTTON_INFO *btnPtr;
INT nIndex;
if (infoPtr == NULL) return -1;
if (lpTbInfo == NULL) return -1;
if (lpTbInfo->cbSize < sizeof(LPTBBUTTONINFOA)) return -1;
if (infoPtr == NULL)
return -1;
if (lpTbInfo == NULL)
return -1;
if (lpTbInfo->cbSize < sizeof(LPTBBUTTONINFOA))
return -1;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
if (nIndex == -1)
......@@ -1211,9 +1219,9 @@ TOOLBAR_GetButtonInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetButtonSize (WND *wndPtr)
TOOLBAR_GetButtonSize (HWND hwnd)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
return MAKELONG((WORD)infoPtr->nButtonWidth,
(WORD)infoPtr->nButtonHeight);
......@@ -1221,9 +1229,9 @@ TOOLBAR_GetButtonSize (WND *wndPtr)
static LRESULT
TOOLBAR_GetButtonTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetButtonTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex, nStringIndex;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
......@@ -1250,11 +1258,11 @@ TOOLBAR_GetButtonTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetDisabledImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetDisabledImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (wndPtr->dwStyle & TBSTYLE_FLAT)
if (GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT)
return (LRESULT)infoPtr->himlDis;
else
return 0;
......@@ -1262,20 +1270,20 @@ TOOLBAR_GetDisabledImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
TOOLBAR_GetExtendedStyle (WND *wndPtr)
TOOLBAR_GetExtendedStyle (HWND hwnd)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
return infoPtr->dwExStyle;
}
static LRESULT
TOOLBAR_GetHotImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetHotImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (wndPtr->dwStyle & TBSTYLE_FLAT)
if (GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT)
return (LRESULT)infoPtr->himlHot;
else
return 0;
......@@ -1286,11 +1294,11 @@ TOOLBAR_GetHotImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (wndPtr->dwStyle & TBSTYLE_FLAT)
if (GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT)
return (LRESULT)infoPtr->himlDef;
else
return 0;
......@@ -1302,21 +1310,24 @@ TOOLBAR_GetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetItemRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetItemRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
LPRECT lpRect;
INT nIndex;
if (infoPtr == NULL) return FALSE;
if (infoPtr == NULL)
return FALSE;
nIndex = (INT)wParam;
btnPtr = &infoPtr->buttons[nIndex];
if ((nIndex < 0) || (nIndex >= infoPtr->nNumButtons))
return FALSE;
lpRect = (LPRECT)lParam;
if (lpRect == NULL) return FALSE;
if (btnPtr->fsState & TBSTATE_HIDDEN) return FALSE;
if (lpRect == NULL)
return FALSE;
if (btnPtr->fsState & TBSTATE_HIDDEN)
return FALSE;
lpRect->left = btnPtr->rect.left;
lpRect->right = btnPtr->rect.right;
......@@ -1328,9 +1339,9 @@ TOOLBAR_GetItemRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetMaxSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetMaxSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPSIZE lpSize = (LPSIZE)lParam;
if (lpSize == NULL)
......@@ -1352,20 +1363,22 @@ TOOLBAR_GetMaxSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
LPRECT lpRect;
INT nIndex;
if (infoPtr == NULL) return FALSE;
if (infoPtr == NULL)
return FALSE;
nIndex = (INT)wParam;
btnPtr = &infoPtr->buttons[nIndex];
if ((nIndex < 0) || (nIndex >= infoPtr->nNumButtons))
return FALSE;
lpRect = (LPRECT)lParam;
if (lpRect == NULL) return FALSE;
if (lpRect == NULL)
return FALSE;
lpRect->left = btnPtr->rect.left;
lpRect->right = btnPtr->rect.right;
......@@ -1377,11 +1390,11 @@ TOOLBAR_GetRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetRows (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (wndPtr->dwStyle & TBSTYLE_WRAPABLE)
if (GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_WRAPABLE)
return infoPtr->nRows;
else
return 1;
......@@ -1389,35 +1402,37 @@ TOOLBAR_GetRows (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetState (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetState (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
if (nIndex == -1) return -1;
if (nIndex == -1)
return -1;
return infoPtr->buttons[nIndex].fsState;
}
static LRESULT
TOOLBAR_GetStyle (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetStyle (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
if (nIndex == -1) return -1;
if (nIndex == -1)
return -1;
return infoPtr->buttons[nIndex].fsStyle;
}
static LRESULT
TOOLBAR_GetTextRows (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetTextRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (infoPtr == NULL)
return 0;
......@@ -1427,31 +1442,32 @@ TOOLBAR_GetTextRows (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_GetToolTips (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetToolTips (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (infoPtr == NULL) return 0;
if (infoPtr == NULL)
return 0;
return infoPtr->hwndToolTip;
}
static LRESULT
TOOLBAR_GetUnicodeFormat (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_GetUnicodeFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TRACE (toolbar, "%s hwnd=0x%04x stub!\n",
infoPtr->bUnicode ? "TRUE" : "FALSE", wndPtr->hwndSelf);
TRACE (toolbar, "%s hwnd=0x%x stub!\n",
infoPtr->bUnicode ? "TRUE" : "FALSE", hwnd);
return infoPtr->bUnicode;
}
static LRESULT
TOOLBAR_HideButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_HideButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
INT nIndex;
......@@ -1465,26 +1481,26 @@ TOOLBAR_HideButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
else
btnPtr->fsState |= TBSTATE_HIDDEN;
TOOLBAR_CalcToolbar (wndPtr);
TOOLBAR_CalcToolbar (hwnd);
InvalidateRect (wndPtr->hwndSelf, NULL, TRUE);
UpdateWindow (wndPtr->hwndSelf);
InvalidateRect (hwnd, NULL, TRUE);
UpdateWindow (hwnd);
return TRUE;
}
__inline__ static LRESULT
TOOLBAR_HitTest (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_HitTest (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
return TOOLBAR_InternalHitTest (wndPtr, (LPPOINT)lParam);
return TOOLBAR_InternalHitTest (hwnd, (LPPOINT)lParam);
}
static LRESULT
TOOLBAR_Indeterminate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_Indeterminate (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
HDC hdc;
INT nIndex;
......@@ -1499,25 +1515,27 @@ TOOLBAR_Indeterminate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
else
btnPtr->fsState |= TBSTATE_INDETERMINATE;
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
TOOLBAR_InsertButtonA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_InsertButtonA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPTBBUTTON lpTbb = (LPTBBUTTON)lParam;
INT nIndex = (INT)wParam;
TBUTTON_INFO *oldButtons;
HDC hdc;
if (lpTbb == NULL) return FALSE;
if (nIndex < 0) return FALSE;
if (lpTbb == NULL)
return FALSE;
if (nIndex < 0)
return FALSE;
TRACE (toolbar, "inserting button index=%d\n", nIndex);
if (nIndex > infoPtr->nNumButtons) {
......@@ -1547,7 +1565,7 @@ TOOLBAR_InsertButtonA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
ti.cbSize = sizeof (TTTOOLINFOA);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = lpTbb->idCommand;
ti.hinst = 0;
ti.lpszText = LPSTR_TEXTCALLBACKA;
......@@ -1564,11 +1582,11 @@ TOOLBAR_InsertButtonA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
COMCTL32_Free (oldButtons);
TOOLBAR_CalcToolbar (wndPtr);
TOOLBAR_CalcToolbar (hwnd);
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
......@@ -1579,9 +1597,9 @@ TOOLBAR_InsertButtonA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_IsButtonChecked (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_IsButtonChecked (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
......@@ -1593,9 +1611,9 @@ TOOLBAR_IsButtonChecked (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_IsButtonEnabled (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_IsButtonEnabled (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
......@@ -1607,9 +1625,9 @@ TOOLBAR_IsButtonEnabled (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_IsButtonHidden (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_IsButtonHidden (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
......@@ -1621,9 +1639,9 @@ TOOLBAR_IsButtonHidden (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_IsButtonHighlighted (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_IsButtonHighlighted (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
......@@ -1635,9 +1653,9 @@ TOOLBAR_IsButtonHighlighted (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_IsButtonIndeterminate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_IsButtonIndeterminate (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
......@@ -1649,9 +1667,9 @@ TOOLBAR_IsButtonIndeterminate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_IsButtonPressed (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_IsButtonPressed (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam);
......@@ -1669,9 +1687,9 @@ TOOLBAR_IsButtonPressed (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_PressButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_PressButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
HDC hdc;
INT nIndex;
......@@ -1686,9 +1704,9 @@ TOOLBAR_PressButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
else
btnPtr->fsState |= TBSTATE_PRESSED;
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
......@@ -1698,10 +1716,10 @@ TOOLBAR_PressButton (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SaveRestoreA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SaveRestoreA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
#if 0
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPTBSAVEPARAMSA lpSave = (LPTBSAVEPARAMSA)lParam;
if (lpSave == NULL) return 0;
......@@ -1732,9 +1750,9 @@ TOOLBAR_SaveRestoreA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetBitmapSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetBitmapSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if ((LOWORD(lParam) <= 0) || (HIWORD(lParam)<=0))
return FALSE;
......@@ -1747,9 +1765,9 @@ TOOLBAR_SetBitmapSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetButtonInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPTBBUTTONINFOA lptbbi = (LPTBBUTTONINFOA)lParam;
TBUTTON_INFO *btnPtr;
INT nIndex;
......@@ -1799,9 +1817,9 @@ TOOLBAR_SetButtonInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetButtonSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetButtonSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if ((LOWORD(lParam) <= 0) || (HIWORD(lParam)<=0))
return FALSE;
......@@ -1814,9 +1832,9 @@ TOOLBAR_SetButtonSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetButtonWidth (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetButtonWidth (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (infoPtr == NULL)
return FALSE;
......@@ -1829,9 +1847,9 @@ TOOLBAR_SetButtonWidth (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetCmdId (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetCmdId (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
INT nIndex = (INT)wParam;
if ((nIndex < 0) || (nIndex >= infoPtr->nNumButtons))
......@@ -1853,12 +1871,12 @@ TOOLBAR_SetCmdId (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetDisabledImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetDisabledImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
HIMAGELIST himlTemp;
if (!(wndPtr->dwStyle & TBSTYLE_FLAT))
if (!(GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT))
return 0;
himlTemp = infoPtr->himlDis;
......@@ -1871,9 +1889,9 @@ TOOLBAR_SetDisabledImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetDrawTextFlags (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetDrawTextFlags (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
DWORD dwTemp;
dwTemp = infoPtr->dwDTFlags;
......@@ -1885,9 +1903,9 @@ TOOLBAR_SetDrawTextFlags (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetExtendedStyle (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetExtendedStyle (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
DWORD dwTemp;
dwTemp = infoPtr->dwExStyle;
......@@ -1898,12 +1916,12 @@ TOOLBAR_SetExtendedStyle (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetHotImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetHotImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd);
HIMAGELIST himlTemp;
if (!(wndPtr->dwStyle & TBSTYLE_FLAT))
if (!(GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT))
return 0;
himlTemp = infoPtr->himlHot;
......@@ -1919,12 +1937,12 @@ TOOLBAR_SetHotImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
HIMAGELIST himlTemp;
if (!(wndPtr->dwStyle & TBSTYLE_FLAT))
if (!(GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT))
return 0;
himlTemp = infoPtr->himlDef;
......@@ -1937,16 +1955,18 @@ TOOLBAR_SetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetIndent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetIndent (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
HDC hdc;
infoPtr->nIndent = (INT)wParam;
TOOLBAR_CalcToolbar (wndPtr);
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
TOOLBAR_CalcToolbar (hwnd);
hdc = GetDC (hwnd);
TOOLBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
......@@ -1956,9 +1976,9 @@ TOOLBAR_SetIndent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetInsertMarkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetInsertMarkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
infoPtr->clrInsertMark = (COLORREF)lParam;
......@@ -1969,9 +1989,9 @@ TOOLBAR_SetInsertMarkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetMaxTextRows (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetMaxTextRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (infoPtr == NULL)
return FALSE;
......@@ -1986,12 +2006,13 @@ TOOLBAR_SetMaxTextRows (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetParent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetParent (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
HWND hwndOldNotify;
if (infoPtr == NULL) return 0;
if (infoPtr == NULL)
return 0;
hwndOldNotify = infoPtr->hwndNotify;
infoPtr->hwndNotify = (HWND)wParam;
......@@ -2000,9 +2021,9 @@ TOOLBAR_SetParent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_SetRows (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetRows (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPRECT lprc = (LPRECT)lParam;
HDC hdc;
......@@ -2013,7 +2034,7 @@ TOOLBAR_SetRows (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
/* recalculate toolbar */
TOOLBAR_CalcToolbar (wndPtr);
TOOLBAR_CalcToolbar (hwnd);
/* return bounding rectangle */
if (lprc) {
......@@ -2024,18 +2045,18 @@ TOOLBAR_SetRows (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
/* repaint toolbar */
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return 0;
}
static LRESULT
TOOLBAR_SetState (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetState (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
HDC hdc;
INT nIndex;
......@@ -2047,18 +2068,18 @@ TOOLBAR_SetState (WND *wndPtr, WPARAM wParam, LPARAM lParam)
btnPtr = &infoPtr->buttons[nIndex];
btnPtr->fsState = LOWORD(lParam);
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
TOOLBAR_SetStyle (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetStyle (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
HDC hdc;
INT nIndex;
......@@ -2070,9 +2091,9 @@ TOOLBAR_SetStyle (WND *wndPtr, WPARAM wParam, LPARAM lParam)
btnPtr = &infoPtr->buttons[nIndex];
btnPtr->fsStyle = LOWORD(lParam);
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
if (infoPtr->hwndToolTip) {
......@@ -2085,24 +2106,25 @@ TOOLBAR_SetStyle (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
TOOLBAR_SetToolTips (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetToolTips (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (infoPtr == NULL) return 0;
if (infoPtr == NULL)
return 0;
infoPtr->hwndToolTip = (HWND)wParam;
return 0;
}
static LRESULT
TOOLBAR_SetUnicodeFormat (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_SetUnicodeFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
BOOL bTemp;
TRACE (toolbar, "%s hwnd=0x%04x stub!\n",
((BOOL)wParam) ? "TRUE" : "FALSE", wndPtr->hwndSelf);
((BOOL)wParam) ? "TRUE" : "FALSE", hwnd);
bTemp = infoPtr->bUnicode;
infoPtr->bUnicode = (BOOL)wParam;
......@@ -2112,9 +2134,10 @@ TOOLBAR_SetUnicodeFormat (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
LOGFONTA logFont;
/* initialize info structure */
......@@ -2130,37 +2153,37 @@ TOOLBAR_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->cxMax = -1;
infoPtr->bCaptured = FALSE;
infoPtr->bUnicode = IsWindowUnicode (wndPtr->hwndSelf);
infoPtr->bUnicode = IsWindowUnicode (hwnd);
infoPtr->nButtonDown = -1;
infoPtr->nOldHit = -1;
infoPtr->hwndNotify = GetParent (wndPtr->hwndSelf);
infoPtr->bTransparent = (wndPtr->dwStyle & TBSTYLE_FLAT);
infoPtr->hwndNotify = GetParent (hwnd);
infoPtr->bTransparent = (dwStyle & TBSTYLE_FLAT);
infoPtr->nHotItem = -1;
infoPtr->dwDTFlags = DT_CENTER;
SystemParametersInfoA (SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
infoPtr->hFont = CreateFontIndirectA (&logFont);
if (wndPtr->dwStyle & TBSTYLE_TOOLTIPS) {
if (dwStyle & TBSTYLE_TOOLTIPS) {
/* Create tooltip control */
infoPtr->hwndToolTip =
CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
wndPtr->hwndSelf, 0, 0, 0);
hwnd, 0, 0, 0);
/* Send NM_TOOLTIPSCREATED notification */
if (infoPtr->hwndToolTip) {
NMTOOLTIPSCREATED nmttc;
nmttc.hdr.hwndFrom = wndPtr->hwndSelf;
nmttc.hdr.idFrom = wndPtr->wIDmenu;
nmttc.hdr.hwndFrom = hwnd;
nmttc.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmttc.hdr.code = NM_TOOLTIPSCREATED;
nmttc.hwndToolTips = infoPtr->hwndToolTip;
SendMessageA (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)wndPtr->wIDmenu, (LPARAM)&nmttc);
(WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc);
}
}
......@@ -2169,9 +2192,9 @@ TOOLBAR_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
/* delete tooltip control */
if (infoPtr->hwndToolTip)
......@@ -2215,22 +2238,21 @@ TOOLBAR_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_EraseBackground (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
if (infoPtr->bTransparent)
return SendMessageA (GetParent (wndPtr->hwndSelf), WM_ERASEBKGND,
wParam, lParam);
return SendMessageA (GetParent (hwnd), WM_ERASEBKGND, wParam, lParam);
return DefWindowProcA (wndPtr->hwndSelf, WM_ERASEBKGND, wParam, lParam);
return DefWindowProcA (hwnd, WM_ERASEBKGND, wParam, lParam);
}
static LRESULT
TOOLBAR_LButtonDblClk (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_LButtonDblClk (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
POINT pt;
INT nHit;
......@@ -2238,61 +2260,61 @@ TOOLBAR_LButtonDblClk (WND *wndPtr, WPARAM wParam, LPARAM lParam)
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (wndPtr, &pt);
nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
if (nHit >= 0) {
btnPtr = &infoPtr->buttons[nHit];
if (!(btnPtr->fsState & TBSTATE_ENABLED))
return 0;
SetCapture (wndPtr->hwndSelf);
SetCapture (hwnd);
infoPtr->bCaptured = TRUE;
infoPtr->nButtonDown = nHit;
btnPtr->fsState |= TBSTATE_PRESSED;
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
}
else if (wndPtr->dwStyle & CCS_ADJUSTABLE)
TOOLBAR_Customize (wndPtr);
else if (GetWindowLongA (hwnd, GWL_STYLE) & CCS_ADJUSTABLE)
TOOLBAR_Customize (hwnd);
return 0;
}
static LRESULT
TOOLBAR_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
POINT pt;
INT nHit;
HDC hdc;
if (infoPtr->hwndToolTip)
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, wndPtr->hwndSelf,
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, hwnd,
WM_LBUTTONDOWN, wParam, lParam);
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (wndPtr, &pt);
nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
if (nHit >= 0) {
btnPtr = &infoPtr->buttons[nHit];
if (!(btnPtr->fsState & TBSTATE_ENABLED))
return 0;
SetCapture (wndPtr->hwndSelf);
SetCapture (hwnd);
infoPtr->bCaptured = TRUE;
infoPtr->nButtonDown = nHit;
infoPtr->nOldHit = nHit;
btnPtr->fsState |= TBSTATE_PRESSED;
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -2300,9 +2322,9 @@ TOOLBAR_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
POINT pt;
INT nHit;
......@@ -2311,12 +2333,12 @@ TOOLBAR_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
BOOL bSendMessage = TRUE;
if (infoPtr->hwndToolTip)
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, wndPtr->hwndSelf,
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, hwnd,
WM_LBUTTONUP, wParam, lParam);
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (wndPtr, &pt);
nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
if ((infoPtr->bCaptured) && (infoPtr->nButtonDown >= 0)) {
infoPtr->bCaptured = FALSE;
......@@ -2347,16 +2369,15 @@ TOOLBAR_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
else
bSendMessage = FALSE;
hdc = GetDC (wndPtr->hwndSelf);
hdc = GetDC (hwnd);
if (nOldIndex != -1)
TOOLBAR_DrawButton (wndPtr, &infoPtr->buttons[nOldIndex], hdc);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
TOOLBAR_DrawButton (hwnd, &infoPtr->buttons[nOldIndex], hdc);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
if (bSendMessage)
SendMessageA (infoPtr->hwndNotify, WM_COMMAND,
MAKEWPARAM(btnPtr->idCommand, 0),
(LPARAM)wndPtr->hwndSelf);
MAKEWPARAM(btnPtr->idCommand, 0), (LPARAM)hwnd);
infoPtr->nButtonDown = -1;
infoPtr->nOldHit = -1;
......@@ -2367,36 +2388,36 @@ TOOLBAR_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
POINT pt;
INT nHit;
HDC hdc;
if (infoPtr->hwndToolTip)
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, wndPtr->hwndSelf,
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, hwnd,
WM_MOUSEMOVE, wParam, lParam);
pt.x = (INT)LOWORD(lParam);
pt.y = (INT)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (wndPtr, &pt);
nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
if (infoPtr->bCaptured) {
if (infoPtr->nOldHit != nHit) {
btnPtr = &infoPtr->buttons[infoPtr->nButtonDown];
if (infoPtr->nOldHit == infoPtr->nButtonDown) {
btnPtr->fsState &= ~TBSTATE_PRESSED;
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
}
else if (nHit == infoPtr->nButtonDown) {
btnPtr->fsState |= TBSTATE_PRESSED;
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_DrawButton (hwnd, btnPtr, hdc);
ReleaseDC (hwnd, hdc);
}
}
infoPtr->nOldHit = nHit;
......@@ -2407,80 +2428,68 @@ TOOLBAR_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
TOOLBAR_NCActivate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_NCActivate (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* if (wndPtr->dwStyle & CCS_NODIVIDER) */
return DefWindowProcA (wndPtr->hwndSelf, WM_NCACTIVATE,
wParam, lParam);
return DefWindowProcA (hwnd, WM_NCACTIVATE, wParam, lParam);
/* else */
/* return TOOLBAR_NCPaint (wndPtr, wParam, lParam); */
}
__inline__ static LRESULT
TOOLBAR_NCCalcSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_NCCalcSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
if (!(wndPtr->dwStyle & CCS_NODIVIDER))
if (!(GetWindowLongA (hwnd, GWL_STYLE) & CCS_NODIVIDER))
((LPRECT)lParam)->top += sysMetrics[SM_CYEDGE];
return DefWindowProcA (wndPtr->hwndSelf, WM_NCCALCSIZE, wParam, lParam);
return DefWindowProcA (hwnd, WM_NCCALCSIZE, wParam, lParam);
}
static LRESULT
TOOLBAR_NCCreate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (TOOLBAR_INFO *)COMCTL32_Alloc (sizeof(TOOLBAR_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (toolbar, "could not allocate info memory!\n");
return 0;
}
if ((TOOLBAR_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (toolbar, "pointer assignment error!\n");
return 0;
}
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
/* paranoid!! */
infoPtr->dwStructSize = sizeof(TBBUTTON);
/* fix instance handle, if the toolbar was created by CreateToolbarEx() */
if (!wndPtr->hInstance)
wndPtr->hInstance = wndPtr->parent->hInstance;
if (!GetWindowLongA (hwnd, GWL_HINSTANCE)) {
HINSTANCE hInst = (HINSTANCE)GetWindowLongA (GetParent (hwnd), GWL_HINSTANCE);
SetWindowLongA (hwnd, GWL_HINSTANCE, (DWORD)hInst);
}
return DefWindowProcA (wndPtr->hwndSelf, WM_NCCREATE, wParam, lParam);
return DefWindowProcA (hwnd, WM_NCCREATE, wParam, lParam);
}
static LRESULT
TOOLBAR_NCPaint (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_NCPaint (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HWND hwnd = wndPtr->hwndSelf;
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
RECT rcWindow;
HDC hdc;
if ( wndPtr->dwStyle & WS_MINIMIZE ||
!WIN_IsWindowDrawable( wndPtr, 0 )) return 0; /* Nothing to do */
if (dwStyle & WS_MINIMIZE)
return 0; /* Nothing to do */
DefWindowProcA (hwnd, WM_NCPAINT, wParam, lParam);
if (!(hdc = GetDCEx( hwnd, 0, DCX_USESTYLE | DCX_WINDOW ))) return 0;
if (ExcludeVisRect16( hdc, wndPtr->rectClient.left-wndPtr->rectWindow.left,
wndPtr->rectClient.top-wndPtr->rectWindow.top,
wndPtr->rectClient.right-wndPtr->rectWindow.left,
wndPtr->rectClient.bottom-wndPtr->rectWindow.top )
== NULLREGION){
ReleaseDC( hwnd, hdc );
if (!(hdc = GetDCEx (hwnd, 0, DCX_USESTYLE | DCX_WINDOW)))
return 0;
}
if (!(wndPtr->flags & WIN_MANAGED) && !(wndPtr->dwStyle & CCS_NODIVIDER))
DrawEdge (hdc, &wndPtr->rectWindow, EDGE_ETCHED, BF_TOP);
if (!(dwStyle & CCS_NODIVIDER))
{
GetWindowRect (hwnd, &rcWindow);
OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top);
DrawEdge (hdc, &rcWindow, EDGE_ETCHED, BF_TOP);
}
ReleaseDC( hwnd, hdc );
......@@ -2489,9 +2498,9 @@ TOOLBAR_NCPaint (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
TOOLBAR_Notify (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_Notify (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
LPNMHDR lpnmh = (LPNMHDR)lParam;
TRACE (toolbar, "passing WM_NOTIFY!\n");
......@@ -2520,23 +2529,24 @@ TOOLBAR_Notify (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_Paint (WND *wndPtr, WPARAM wParam)
TOOLBAR_Paint (HWND hwnd, WPARAM wParam)
{
HDC hdc;
PAINTSTRUCT ps;
hdc = wParam==0 ? BeginPaint (wndPtr->hwndSelf, &ps) : (HDC)wParam;
TOOLBAR_Refresh (wndPtr, hdc);
hdc = wParam==0 ? BeginPaint (hwnd, &ps) : (HDC)wParam;
TOOLBAR_Refresh (hwnd, hdc);
if (!wParam)
EndPaint (wndPtr->hwndSelf, &ps);
EndPaint (hwnd, &ps);
return 0;
}
static LRESULT
TOOLBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_Size (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
RECT parent_rect;
HWND parent;
/* INT32 x, y; */
......@@ -2560,37 +2570,37 @@ TOOLBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if (flags == SIZE_RESTORED) {
/* width and height don't apply */
parent = GetParent (wndPtr->hwndSelf);
parent = GetParent (hwnd);
GetClientRect(parent, &parent_rect);
if (wndPtr->dwStyle & CCS_NORESIZE) {
if (dwStyle & CCS_NORESIZE) {
uPosFlags |= (SWP_NOSIZE | SWP_NOMOVE);
/* FIXME */
/* infoPtr->nWidth = parent_rect.right - parent_rect.left; */
cy = infoPtr->nHeight;
cx = infoPtr->nWidth;
TOOLBAR_CalcToolbar (wndPtr);
TOOLBAR_CalcToolbar (hwnd);
infoPtr->nWidth = cx;
infoPtr->nHeight = cy;
}
else {
infoPtr->nWidth = parent_rect.right - parent_rect.left;
TOOLBAR_CalcToolbar (wndPtr);
TOOLBAR_CalcToolbar (hwnd);
cy = infoPtr->nHeight;
cx = infoPtr->nWidth;
}
if (wndPtr->dwStyle & CCS_NOPARENTALIGN) {
if (dwStyle & CCS_NOPARENTALIGN) {
uPosFlags |= SWP_NOMOVE;
cy = infoPtr->nHeight;
cx = infoPtr->nWidth;
}
if (!(wndPtr->dwStyle & CCS_NODIVIDER))
if (!(dwStyle & CCS_NODIVIDER))
cy += sysMetrics[SM_CYEDGE];
SetWindowPos (wndPtr->hwndSelf, 0, parent_rect.left, parent_rect.top,
SetWindowPos (hwnd, 0, parent_rect.left, parent_rect.top,
cx, cy, uPosFlags | SWP_NOZORDER);
}
return 0;
......@@ -2598,15 +2608,15 @@ TOOLBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLBAR_StyleChanged (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLBAR_StyleChanged (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
TOOLBAR_AutoSize (wndPtr, wParam, lParam);
TOOLBAR_AutoSize (hwnd, wParam, lParam);
hdc = GetDC (wndPtr->hwndSelf);
TOOLBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return 0;
}
......@@ -2616,155 +2626,153 @@ TOOLBAR_StyleChanged (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case TB_ADDBITMAP:
return TOOLBAR_AddBitmap (wndPtr, wParam, lParam);
return TOOLBAR_AddBitmap (hwnd, wParam, lParam);
case TB_ADDBUTTONSA:
return TOOLBAR_AddButtonsA (wndPtr, wParam, lParam);
return TOOLBAR_AddButtonsA (hwnd, wParam, lParam);
/* case TB_ADDBUTTONS32W: */
case TB_ADDSTRINGA:
return TOOLBAR_AddStringA (wndPtr, wParam, lParam);
return TOOLBAR_AddStringA (hwnd, wParam, lParam);
case TB_ADDSTRINGW:
return TOOLBAR_AddStringW (wndPtr, wParam, lParam);
return TOOLBAR_AddStringW (hwnd, wParam, lParam);
case TB_AUTOSIZE:
return TOOLBAR_AutoSize (wndPtr, wParam, lParam);
return TOOLBAR_AutoSize (hwnd, wParam, lParam);
case TB_BUTTONCOUNT:
return TOOLBAR_ButtonCount (wndPtr, wParam, lParam);
return TOOLBAR_ButtonCount (hwnd, wParam, lParam);
case TB_BUTTONSTRUCTSIZE:
return TOOLBAR_ButtonStructSize (wndPtr, wParam, lParam);
return TOOLBAR_ButtonStructSize (hwnd, wParam, lParam);
case TB_CHANGEBITMAP:
return TOOLBAR_ChangeBitmap (wndPtr, wParam, lParam);
return TOOLBAR_ChangeBitmap (hwnd, wParam, lParam);
case TB_CHECKBUTTON:
return TOOLBAR_CheckButton (wndPtr, wParam, lParam);
return TOOLBAR_CheckButton (hwnd, wParam, lParam);
case TB_COMMANDTOINDEX:
return TOOLBAR_CommandToIndex (wndPtr, wParam, lParam);
return TOOLBAR_CommandToIndex (hwnd, wParam, lParam);
case TB_CUSTOMIZE:
return TOOLBAR_Customize (wndPtr);
return TOOLBAR_Customize (hwnd);
case TB_DELETEBUTTON:
return TOOLBAR_DeleteButton (wndPtr, wParam, lParam);
return TOOLBAR_DeleteButton (hwnd, wParam, lParam);
case TB_ENABLEBUTTON:
return TOOLBAR_EnableButton (wndPtr, wParam, lParam);
return TOOLBAR_EnableButton (hwnd, wParam, lParam);
/* case TB_GETANCHORHIGHLIGHT: */ /* 4.71 */
case TB_GETBITMAP:
return TOOLBAR_GetBitmap (wndPtr, wParam, lParam);
return TOOLBAR_GetBitmap (hwnd, wParam, lParam);
case TB_GETBITMAPFLAGS:
return TOOLBAR_GetBitmapFlags (wndPtr, wParam, lParam);
return TOOLBAR_GetBitmapFlags (hwnd, wParam, lParam);
case TB_GETBUTTON:
return TOOLBAR_GetButton (wndPtr, wParam, lParam);
return TOOLBAR_GetButton (hwnd, wParam, lParam);
case TB_GETBUTTONINFOA:
return TOOLBAR_GetButtonInfoA (wndPtr, wParam, lParam);
return TOOLBAR_GetButtonInfoA (hwnd, wParam, lParam);
/* case TB_GETBUTTONINFO32W: */ /* 4.71 */
case TB_GETBUTTONSIZE:
return TOOLBAR_GetButtonSize (wndPtr);
return TOOLBAR_GetButtonSize (hwnd);
case TB_GETBUTTONTEXTA:
return TOOLBAR_GetButtonTextA (wndPtr, wParam, lParam);
return TOOLBAR_GetButtonTextA (hwnd, wParam, lParam);
/* case TB_GETBUTTONTEXT32W: */
/* case TB_GETCOLORSCHEME: */ /* 4.71 */
case TB_GETDISABLEDIMAGELIST:
return TOOLBAR_GetDisabledImageList (wndPtr, wParam, lParam);
return TOOLBAR_GetDisabledImageList (hwnd, wParam, lParam);
case TB_GETEXTENDEDSTYLE:
return TOOLBAR_GetExtendedStyle (wndPtr);
return TOOLBAR_GetExtendedStyle (hwnd);
case TB_GETHOTIMAGELIST:
return TOOLBAR_GetHotImageList (wndPtr, wParam, lParam);
return TOOLBAR_GetHotImageList (hwnd, wParam, lParam);
/* case TB_GETHOTITEM: */ /* 4.71 */
case TB_GETIMAGELIST:
return TOOLBAR_GetImageList (wndPtr, wParam, lParam);
return TOOLBAR_GetImageList (hwnd, wParam, lParam);
/* case TB_GETINSERTMARK: */ /* 4.71 */
/* case TB_GETINSERTMARKCOLOR: */ /* 4.71 */
case TB_GETITEMRECT:
return TOOLBAR_GetItemRect (wndPtr, wParam, lParam);
return TOOLBAR_GetItemRect (hwnd, wParam, lParam);
case TB_GETMAXSIZE:
return TOOLBAR_GetMaxSize (wndPtr, wParam, lParam);
return TOOLBAR_GetMaxSize (hwnd, wParam, lParam);
/* case TB_GETOBJECT: */ /* 4.71 */
/* case TB_GETPADDING: */ /* 4.71 */
case TB_GETRECT:
return TOOLBAR_GetRect (wndPtr, wParam, lParam);
return TOOLBAR_GetRect (hwnd, wParam, lParam);
case TB_GETROWS:
return TOOLBAR_GetRows (wndPtr, wParam, lParam);
return TOOLBAR_GetRows (hwnd, wParam, lParam);
case TB_GETSTATE:
return TOOLBAR_GetState (wndPtr, wParam, lParam);
return TOOLBAR_GetState (hwnd, wParam, lParam);
case TB_GETSTYLE:
return TOOLBAR_GetStyle (wndPtr, wParam, lParam);
return TOOLBAR_GetStyle (hwnd, wParam, lParam);
case TB_GETTEXTROWS:
return TOOLBAR_GetTextRows (wndPtr, wParam, lParam);
return TOOLBAR_GetTextRows (hwnd, wParam, lParam);
case TB_GETTOOLTIPS:
return TOOLBAR_GetToolTips (wndPtr, wParam, lParam);
return TOOLBAR_GetToolTips (hwnd, wParam, lParam);
case TB_GETUNICODEFORMAT:
return TOOLBAR_GetUnicodeFormat (wndPtr, wParam, lParam);
return TOOLBAR_GetUnicodeFormat (hwnd, wParam, lParam);
case TB_HIDEBUTTON:
return TOOLBAR_HideButton (wndPtr, wParam, lParam);
return TOOLBAR_HideButton (hwnd, wParam, lParam);
case TB_HITTEST:
return TOOLBAR_HitTest (wndPtr, wParam, lParam);
return TOOLBAR_HitTest (hwnd, wParam, lParam);
case TB_INDETERMINATE:
return TOOLBAR_Indeterminate (wndPtr, wParam, lParam);
return TOOLBAR_Indeterminate (hwnd, wParam, lParam);
case TB_INSERTBUTTONA:
return TOOLBAR_InsertButtonA (wndPtr, wParam, lParam);
return TOOLBAR_InsertButtonA (hwnd, wParam, lParam);
/* case TB_INSERTBUTTON32W: */
/* case TB_INSERTMARKHITTEST: */ /* 4.71 */
case TB_ISBUTTONCHECKED:
return TOOLBAR_IsButtonChecked (wndPtr, wParam, lParam);
return TOOLBAR_IsButtonChecked (hwnd, wParam, lParam);
case TB_ISBUTTONENABLED:
return TOOLBAR_IsButtonEnabled (wndPtr, wParam, lParam);
return TOOLBAR_IsButtonEnabled (hwnd, wParam, lParam);
case TB_ISBUTTONHIDDEN:
return TOOLBAR_IsButtonHidden (wndPtr, wParam, lParam);
return TOOLBAR_IsButtonHidden (hwnd, wParam, lParam);
case TB_ISBUTTONHIGHLIGHTED:
return TOOLBAR_IsButtonHighlighted (wndPtr, wParam, lParam);
return TOOLBAR_IsButtonHighlighted (hwnd, wParam, lParam);
case TB_ISBUTTONINDETERMINATE:
return TOOLBAR_IsButtonIndeterminate (wndPtr, wParam, lParam);
return TOOLBAR_IsButtonIndeterminate (hwnd, wParam, lParam);
case TB_ISBUTTONPRESSED:
return TOOLBAR_IsButtonPressed (wndPtr, wParam, lParam);
return TOOLBAR_IsButtonPressed (hwnd, wParam, lParam);
/* case TB_LOADIMAGES: */ /* 4.70 */
/* case TB_MAPACCELERATOR32A: */ /* 4.71 */
......@@ -2773,136 +2781,136 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case TB_MOVEBUTTON: */ /* 4.71 */
case TB_PRESSBUTTON:
return TOOLBAR_PressButton (wndPtr, wParam, lParam);
return TOOLBAR_PressButton (hwnd, wParam, lParam);
/* case TB_REPLACEBITMAP: */
case TB_SAVERESTOREA:
return TOOLBAR_SaveRestoreA (wndPtr, wParam, lParam);
return TOOLBAR_SaveRestoreA (hwnd, wParam, lParam);
/* case TB_SAVERESTORE32W: */
/* case TB_SETANCHORHIGHLIGHT: */ /* 4.71 */
case TB_SETBITMAPSIZE:
return TOOLBAR_SetBitmapSize (wndPtr, wParam, lParam);
return TOOLBAR_SetBitmapSize (hwnd, wParam, lParam);
case TB_SETBUTTONINFOA:
return TOOLBAR_SetButtonInfoA (wndPtr, wParam, lParam);
return TOOLBAR_SetButtonInfoA (hwnd, wParam, lParam);
/* case TB_SETBUTTONINFO32W: */ /* 4.71 */
case TB_SETBUTTONSIZE:
return TOOLBAR_SetButtonSize (wndPtr, wParam, lParam);
return TOOLBAR_SetButtonSize (hwnd, wParam, lParam);
case TB_SETBUTTONWIDTH:
return TOOLBAR_SetButtonWidth (wndPtr, wParam, lParam);
return TOOLBAR_SetButtonWidth (hwnd, wParam, lParam);
case TB_SETCMDID:
return TOOLBAR_SetCmdId (wndPtr, wParam, lParam);
return TOOLBAR_SetCmdId (hwnd, wParam, lParam);
/* case TB_SETCOLORSCHEME: */ /* 4.71 */
case TB_SETDISABLEDIMAGELIST:
return TOOLBAR_SetDisabledImageList (wndPtr, wParam, lParam);
return TOOLBAR_SetDisabledImageList (hwnd, wParam, lParam);
case TB_SETDRAWTEXTFLAGS:
return TOOLBAR_SetDrawTextFlags (wndPtr, wParam, lParam);
return TOOLBAR_SetDrawTextFlags (hwnd, wParam, lParam);
case TB_SETEXTENDEDSTYLE:
return TOOLBAR_SetExtendedStyle (wndPtr, wParam, lParam);
return TOOLBAR_SetExtendedStyle (hwnd, wParam, lParam);
case TB_SETHOTIMAGELIST:
return TOOLBAR_SetHotImageList (wndPtr, wParam, lParam);
return TOOLBAR_SetHotImageList (hwnd, wParam, lParam);
/* case TB_SETHOTITEM: */ /* 4.71 */
case TB_SETIMAGELIST:
return TOOLBAR_SetImageList (wndPtr, wParam, lParam);
return TOOLBAR_SetImageList (hwnd, wParam, lParam);
case TB_SETINDENT:
return TOOLBAR_SetIndent (wndPtr, wParam, lParam);
return TOOLBAR_SetIndent (hwnd, wParam, lParam);
/* case TB_SETINSERTMARK: */ /* 4.71 */
case TB_SETINSERTMARKCOLOR:
return TOOLBAR_SetInsertMarkColor (wndPtr, wParam, lParam);
return TOOLBAR_SetInsertMarkColor (hwnd, wParam, lParam);
case TB_SETMAXTEXTROWS:
return TOOLBAR_SetMaxTextRows (wndPtr, wParam, lParam);
return TOOLBAR_SetMaxTextRows (hwnd, wParam, lParam);
/* case TB_SETPADDING: */ /* 4.71 */
case TB_SETPARENT:
return TOOLBAR_SetParent (wndPtr, wParam, lParam);
return TOOLBAR_SetParent (hwnd, wParam, lParam);
case TB_SETROWS:
return TOOLBAR_SetRows (wndPtr, wParam, lParam);
return TOOLBAR_SetRows (hwnd, wParam, lParam);
case TB_SETSTATE:
return TOOLBAR_SetState (wndPtr, wParam, lParam);
return TOOLBAR_SetState (hwnd, wParam, lParam);
case TB_SETSTYLE:
return TOOLBAR_SetStyle (wndPtr, wParam, lParam);
return TOOLBAR_SetStyle (hwnd, wParam, lParam);
case TB_SETTOOLTIPS:
return TOOLBAR_SetToolTips (wndPtr, wParam, lParam);
return TOOLBAR_SetToolTips (hwnd, wParam, lParam);
case TB_SETUNICODEFORMAT:
return TOOLBAR_SetUnicodeFormat (wndPtr, wParam, lParam);
return TOOLBAR_SetUnicodeFormat (hwnd, wParam, lParam);
/* case WM_CHAR: */
case WM_CREATE:
return TOOLBAR_Create (wndPtr, wParam, lParam);
return TOOLBAR_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return TOOLBAR_Destroy (wndPtr, wParam, lParam);
return TOOLBAR_Destroy (hwnd, wParam, lParam);
case WM_ERASEBKGND:
return TOOLBAR_EraseBackground (wndPtr, wParam, lParam);
return TOOLBAR_EraseBackground (hwnd, wParam, lParam);
/* case WM_GETFONT: */
/* case WM_KEYDOWN: */
/* case WM_KILLFOCUS: */
case WM_LBUTTONDBLCLK:
return TOOLBAR_LButtonDblClk (wndPtr, wParam, lParam);
return TOOLBAR_LButtonDblClk (hwnd, wParam, lParam);
case WM_LBUTTONDOWN:
return TOOLBAR_LButtonDown (wndPtr, wParam, lParam);
return TOOLBAR_LButtonDown (hwnd, wParam, lParam);
case WM_LBUTTONUP:
return TOOLBAR_LButtonUp (wndPtr, wParam, lParam);
return TOOLBAR_LButtonUp (hwnd, wParam, lParam);
case WM_MOUSEMOVE:
return TOOLBAR_MouseMove (wndPtr, wParam, lParam);
return TOOLBAR_MouseMove (hwnd, wParam, lParam);
case WM_NCACTIVATE:
return TOOLBAR_NCActivate (wndPtr, wParam, lParam);
return TOOLBAR_NCActivate (hwnd, wParam, lParam);
case WM_NCCALCSIZE:
return TOOLBAR_NCCalcSize (wndPtr, wParam, lParam);
return TOOLBAR_NCCalcSize (hwnd, wParam, lParam);
case WM_NCCREATE:
return TOOLBAR_NCCreate (wndPtr, wParam, lParam);
return TOOLBAR_NCCreate (hwnd, wParam, lParam);
case WM_NCPAINT:
return TOOLBAR_NCPaint (wndPtr, wParam, lParam);
return TOOLBAR_NCPaint (hwnd, wParam, lParam);
case WM_NOTIFY:
return TOOLBAR_Notify (wndPtr, wParam, lParam);
return TOOLBAR_Notify (hwnd, wParam, lParam);
/* case WM_NOTIFYFORMAT: */
case WM_PAINT:
return TOOLBAR_Paint (wndPtr, wParam);
return TOOLBAR_Paint (hwnd, wParam);
case WM_SIZE:
return TOOLBAR_Size (wndPtr, wParam, lParam);
return TOOLBAR_Size (hwnd, wParam, lParam);
case WM_STYLECHANGED:
return TOOLBAR_StyleChanged (wndPtr, wParam, lParam);
return TOOLBAR_StyleChanged (hwnd, wParam, lParam);
/* case WM_SYSCOLORCHANGE: */
......
......@@ -13,6 +13,7 @@
* curtool.exe, deltool.exe, enumtools.exe, getinfo.exe, getiptxt.exe,
* hittest.exe, needtext.exe, newrect.exe, updtext.exe and winfrpt.exe.
*/
#include <string.h>
#include "commctrl.h"
......@@ -30,7 +31,7 @@ extern LPSTR COMCTL32_aSubclass; /* global subclassing atom */
/* property name of tooltip window handle */
/*#define TT_SUBCLASS_PROP "CC32SubclassInfo" */
#define TOOLTIPS_GetInfoPtr(wndPtr) ((TOOLTIPS_INFO *)wndPtr->wExtra[0])
#define TOOLTIPS_GetInfoPtr(wndPtr) ((TOOLTIPS_INFO *)GetWindowLongA (hwnd, 0))
LRESULT CALLBACK
......@@ -38,9 +39,9 @@ TOOLTIPS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static VOID
TOOLTIPS_Refresh (WND *wndPtr, HDC hdc)
TOOLTIPS_Refresh (HWND hwnd, HDC hdc)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(hwnd);
RECT rc;
INT oldBkMode;
HFONT hOldFont;
......@@ -49,9 +50,9 @@ TOOLTIPS_Refresh (WND *wndPtr, HDC hdc)
if (infoPtr->nMaxTipWidth > -1)
uFlags |= DT_WORDBREAK;
if (wndPtr->dwStyle & TTS_NOPREFIX)
if (GetWindowLongA (hwnd, GWL_STYLE) & TTS_NOPREFIX)
uFlags |= DT_NOPREFIX;
GetClientRect (wndPtr->hwndSelf, &rc);
GetClientRect (hwnd, &rc);
/* fill the background */
hBrush = CreateSolidBrush (infoPtr->clrBk);
......@@ -76,7 +77,7 @@ TOOLTIPS_Refresh (WND *wndPtr, HDC hdc)
static VOID
TOOLTIPS_GetTipText (WND *wndPtr, TOOLTIPS_INFO *infoPtr, INT nTool)
TOOLTIPS_GetTipText (HWND hwnd, TOOLTIPS_INFO *infoPtr, INT nTool)
{
TTTOOL_INFO *toolPtr = &infoPtr->tools[nTool];
......@@ -93,7 +94,7 @@ TOOLTIPS_GetTipText (WND *wndPtr, TOOLTIPS_INFO *infoPtr, INT nTool)
/* fill NMHDR struct */
ZeroMemory (&ttnmdi, sizeof(NMTTDISPINFOA));
ttnmdi.hdr.hwndFrom = wndPtr->hwndSelf;
ttnmdi.hdr.hwndFrom = hwnd;
ttnmdi.hdr.idFrom = toolPtr->uId;
ttnmdi.hdr.code = TTN_GETDISPINFOA;
ttnmdi.lpszText = (LPSTR)&ttnmdi.szText;
......@@ -154,7 +155,7 @@ TOOLTIPS_GetTipText (WND *wndPtr, TOOLTIPS_INFO *infoPtr, INT nTool)
static VOID
TOOLTIPS_CalcTipSize (WND *wndPtr, TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
TOOLTIPS_CalcTipSize (HWND hwnd, TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
{
HDC hdc;
HFONT hOldFont;
......@@ -165,15 +166,15 @@ TOOLTIPS_CalcTipSize (WND *wndPtr, TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
rc.right = infoPtr->nMaxTipWidth;
uFlags |= DT_WORDBREAK;
}
if (wndPtr->dwStyle & TTS_NOPREFIX)
if (GetWindowLongA (hwnd, GWL_STYLE) & TTS_NOPREFIX)
uFlags |= DT_NOPREFIX;
TRACE (tooltips, "\"%s\"\n", debugstr_w(infoPtr->szTipText));
hdc = GetDC (wndPtr->hwndSelf);
hdc = GetDC (hwnd);
hOldFont = SelectObject (hdc, infoPtr->hFont);
DrawTextW (hdc, infoPtr->szTipText, -1, &rc, uFlags);
SelectObject (hdc, hOldFont);
ReleaseDC (wndPtr->hwndSelf, hdc);
ReleaseDC (hwnd, hdc);
lpSize->cx = rc.right - rc.left + 4 +
infoPtr->rcMargin.left + infoPtr->rcMargin.right;
......@@ -183,7 +184,7 @@ TOOLTIPS_CalcTipSize (WND *wndPtr, TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
static VOID
TOOLTIPS_Show (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
{
TTTOOL_INFO *toolPtr;
RECT rect;
......@@ -200,7 +201,7 @@ TOOLTIPS_Show (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TRACE (tooltips, "Show tooltip pre %d!\n", infoPtr->nTool);
TOOLTIPS_GetTipText (wndPtr, infoPtr, infoPtr->nCurrentTool);
TOOLTIPS_GetTipText (hwnd, infoPtr, infoPtr->nCurrentTool);
if (infoPtr->szTipText[0] == L'\0') {
infoPtr->nCurrentTool = -1;
......@@ -210,7 +211,7 @@ TOOLTIPS_Show (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TRACE (tooltips, "Show tooltip %d!\n", infoPtr->nCurrentTool);
toolPtr = &infoPtr->tools[infoPtr->nCurrentTool];
hdr.hwndFrom = wndPtr->hwndSelf;
hdr.hwndFrom = hwnd;
hdr.idFrom = toolPtr->uId;
hdr.code = TTN_SHOW;
SendMessageA (toolPtr->hwnd, WM_NOTIFY,
......@@ -218,7 +219,7 @@ TOOLTIPS_Show (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TRACE (tooltips, "\"%s\"\n", debugstr_w(infoPtr->szTipText));
TOOLTIPS_CalcTipSize (wndPtr, infoPtr, &size);
TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size);
TRACE (tooltips, "size %d - %d\n", size.cx, size.cy);
if (toolPtr->uFlags & TTF_CENTERTIP) {
......@@ -245,23 +246,24 @@ TOOLTIPS_Show (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
rect.right = rect.left + size.cx;
rect.bottom = rect.top + size.cy;
AdjustWindowRectEx (&rect, wndPtr->dwStyle, FALSE, wndPtr->dwExStyle);
AdjustWindowRectEx (&rect, GetWindowLongA (hwnd, GWL_STYLE),
FALSE, GetWindowLongA (hwnd, GWL_EXSTYLE));
SetWindowPos (wndPtr->hwndSelf, HWND_TOP, rect.left, rect.top,
SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
SWP_SHOWWINDOW);
/* repaint the tooltip */
hdc = GetDC (wndPtr->hwndSelf);
TOOLTIPS_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLTIPS_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
SetTimer (wndPtr->hwndSelf, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
SetTimer (hwnd, ID_TIMERPOP, infoPtr->nAutoPopTime, 0);
}
static VOID
TOOLTIPS_Hide (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TOOLTIPS_Hide (HWND hwnd, TOOLTIPS_INFO *infoPtr)
{
TTTOOL_INFO *toolPtr;
NMHDR hdr;
......@@ -271,9 +273,9 @@ TOOLTIPS_Hide (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
toolPtr = &infoPtr->tools[infoPtr->nCurrentTool];
TRACE (tooltips, "Hide tooltip %d!\n", infoPtr->nCurrentTool);
KillTimer (wndPtr->hwndSelf, ID_TIMERPOP);
KillTimer (hwnd, ID_TIMERPOP);
hdr.hwndFrom = wndPtr->hwndSelf;
hdr.hwndFrom = hwnd;
hdr.idFrom = toolPtr->uId;
hdr.code = TTN_POP;
SendMessageA (toolPtr->hwnd, WM_NOTIFY,
......@@ -281,13 +283,13 @@ TOOLTIPS_Hide (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
infoPtr->nCurrentTool = -1;
SetWindowPos (wndPtr->hwndSelf, HWND_TOP, 0, 0, 0, 0,
SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0,
SWP_NOZORDER | SWP_HIDEWINDOW);
}
static VOID
TOOLTIPS_TrackShow (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TOOLTIPS_TrackShow (HWND hwnd, TOOLTIPS_INFO *infoPtr)
{
TTTOOL_INFO *toolPtr;
RECT rect;
......@@ -302,7 +304,7 @@ TOOLTIPS_TrackShow (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TRACE (tooltips, "show tracking tooltip pre %d!\n", infoPtr->nTrackTool);
TOOLTIPS_GetTipText (wndPtr, infoPtr, infoPtr->nTrackTool);
TOOLTIPS_GetTipText (hwnd, infoPtr, infoPtr->nTrackTool);
if (infoPtr->szTipText[0] == L'\0') {
infoPtr->nTrackTool = -1;
......@@ -312,7 +314,7 @@ TOOLTIPS_TrackShow (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TRACE (tooltips, "show tracking tooltip %d!\n", infoPtr->nTrackTool);
toolPtr = &infoPtr->tools[infoPtr->nTrackTool];
hdr.hwndFrom = wndPtr->hwndSelf;
hdr.hwndFrom = hwnd;
hdr.idFrom = toolPtr->uId;
hdr.code = TTN_SHOW;
SendMessageA (toolPtr->hwnd, WM_NOTIFY,
......@@ -320,7 +322,7 @@ TOOLTIPS_TrackShow (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TRACE (tooltips, "\"%s\"\n", debugstr_w(infoPtr->szTipText));
TOOLTIPS_CalcTipSize (wndPtr, infoPtr, &size);
TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size);
TRACE (tooltips, "size %d - %d\n", size.cx, size.cy);
if (toolPtr->uFlags & TTF_ABSOLUTE) {
......@@ -361,20 +363,21 @@ TOOLTIPS_TrackShow (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
rect.right = rect.left + size.cx;
rect.bottom = rect.top + size.cy;
AdjustWindowRectEx (&rect, wndPtr->dwStyle, FALSE, wndPtr->dwExStyle);
AdjustWindowRectEx (&rect, GetWindowLongA (hwnd, GWL_STYLE),
FALSE, GetWindowLongA (hwnd, GWL_EXSTYLE));
SetWindowPos (wndPtr->hwndSelf, HWND_TOP, rect.left, rect.top,
SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
SWP_SHOWWINDOW);
hdc = GetDC (wndPtr->hwndSelf);
TOOLTIPS_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TOOLTIPS_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
static VOID
TOOLTIPS_TrackHide (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TOOLTIPS_TrackHide (HWND hwnd, TOOLTIPS_INFO *infoPtr)
{
TTTOOL_INFO *toolPtr;
NMHDR hdr;
......@@ -385,13 +388,13 @@ TOOLTIPS_TrackHide (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
toolPtr = &infoPtr->tools[infoPtr->nTrackTool];
TRACE (tooltips, "hide tracking tooltip %d!\n", infoPtr->nTrackTool);
hdr.hwndFrom = wndPtr->hwndSelf;
hdr.hwndFrom = hwnd;
hdr.idFrom = toolPtr->uId;
hdr.code = TTN_POP;
SendMessageA (toolPtr->hwnd, WM_NOTIFY,
(WPARAM)toolPtr->uId, (LPARAM)&hdr);
SetWindowPos (wndPtr->hwndSelf, HWND_TOP, 0, 0, 0, 0,
SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0,
SWP_NOZORDER | SWP_HIDEWINDOW);
}
......@@ -509,16 +512,15 @@ TOOLTIPS_IsWindowActive (HWND hwnd)
static INT
TOOLTIPS_CheckTool (WND *wndPtr, BOOL bShowTest)
TOOLTIPS_CheckTool (HWND hwnd, BOOL bShowTest)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
POINT pt;
HWND hwndTool;
INT nTool;
GetCursorPos (&pt);
hwndTool =
SendMessageA (wndPtr->hwndSelf, TTM_WINDOWFROMPOINT, 0, (LPARAM)&pt);
hwndTool = SendMessageA (hwnd, TTM_WINDOWFROMPOINT, 0, (LPARAM)&pt);
if (hwndTool == 0)
return -1;
......@@ -527,8 +529,8 @@ TOOLTIPS_CheckTool (WND *wndPtr, BOOL bShowTest)
if (nTool == -1)
return -1;
if (!(wndPtr->dwStyle & TTS_ALWAYSTIP) && bShowTest) {
if (!TOOLTIPS_IsWindowActive (wndPtr->owner->hwndSelf))
if (!(GetWindowLongA (hwnd, GWL_STYLE) & TTS_ALWAYSTIP) && bShowTest) {
if (!TOOLTIPS_IsWindowActive (GetWindow (hwnd, GW_OWNER)))
return -1;
}
......@@ -539,9 +541,9 @@ TOOLTIPS_CheckTool (WND *wndPtr, BOOL bShowTest)
static LRESULT
TOOLTIPS_Activate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_Activate (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
infoPtr->bActive = (BOOL)wParam;
......@@ -549,16 +551,16 @@ TOOLTIPS_Activate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE (tooltips, "activate!\n");
if (!(infoPtr->bActive) && (infoPtr->nCurrentTool != -1))
TOOLTIPS_Hide (wndPtr, infoPtr);
TOOLTIPS_Hide (hwnd, infoPtr);
return 0;
}
static LRESULT
TOOLTIPS_AddToolA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_AddToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
TTTOOL_INFO *toolPtr;
......@@ -568,7 +570,7 @@ TOOLTIPS_AddToolA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
return FALSE;
TRACE (tooltips, "add tool (%x) %x %d%s!\n",
wndPtr->hwndSelf, lpToolInfo->hwnd, lpToolInfo->uId,
hwnd, lpToolInfo->hwnd, lpToolInfo->uId,
(lpToolInfo->uFlags & TTF_IDISHWND) ? " TTF_IDISHWND" : "");
if (infoPtr->uNumTools == 0) {
......@@ -625,7 +627,7 @@ TOOLTIPS_AddToolA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
lpttsi->wpOrigProc =
(WNDPROC)SetWindowLongA ((HWND)toolPtr->uId,
GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc);
lpttsi->hwndToolTip = wndPtr->hwndSelf;
lpttsi->hwndToolTip = hwnd;
lpttsi->uRefCount++;
SetPropA ((HWND)toolPtr->uId, COMCTL32_aSubclass,
(HANDLE)lpttsi);
......@@ -642,7 +644,7 @@ TOOLTIPS_AddToolA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
lpttsi->wpOrigProc =
(WNDPROC)SetWindowLongA (toolPtr->hwnd,
GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc);
lpttsi->hwndToolTip = wndPtr->hwndSelf;
lpttsi->hwndToolTip = hwnd;
lpttsi->uRefCount++;
SetPropA (toolPtr->hwnd, COMCTL32_aSubclass, (HANDLE)lpttsi);
}
......@@ -657,9 +659,9 @@ TOOLTIPS_AddToolA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_AddToolW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOW lpToolInfo = (LPTTTOOLINFOW)lParam;
TTTOOL_INFO *toolPtr;
......@@ -669,7 +671,7 @@ TOOLTIPS_AddToolW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
return FALSE;
TRACE (tooltips, "add tool (%x) %x %d%s!\n",
wndPtr->hwndSelf, lpToolInfo->hwnd, lpToolInfo->uId,
hwnd, lpToolInfo->hwnd, lpToolInfo->uId,
(lpToolInfo->uFlags & TTF_IDISHWND) ? " TTF_IDISHWND" : "");
if (infoPtr->uNumTools == 0) {
......@@ -727,7 +729,7 @@ TOOLTIPS_AddToolW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
lpttsi->wpOrigProc =
(WNDPROC)SetWindowLongA ((HWND)toolPtr->uId,
GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc);
lpttsi->hwndToolTip = wndPtr->hwndSelf;
lpttsi->hwndToolTip = hwnd;
lpttsi->uRefCount++;
SetPropA ((HWND)toolPtr->uId, COMCTL32_aSubclass,
(HANDLE)lpttsi);
......@@ -744,7 +746,7 @@ TOOLTIPS_AddToolW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
lpttsi->wpOrigProc =
(WNDPROC)SetWindowLongA (toolPtr->hwnd,
GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc);
lpttsi->hwndToolTip = wndPtr->hwndSelf;
lpttsi->hwndToolTip = hwnd;
lpttsi->uRefCount++;
SetPropA (toolPtr->hwnd, COMCTL32_aSubclass, (HANDLE)lpttsi);
}
......@@ -759,9 +761,9 @@ TOOLTIPS_AddToolW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_DelToolA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
TTTOOL_INFO *toolPtr;
INT nTool;
......@@ -845,9 +847,9 @@ TOOLTIPS_DelToolA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_DelToolW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOW lpToolInfo = (LPTTTOOLINFOW)lParam;
TTTOOL_INFO *toolPtr;
INT nTool;
......@@ -931,9 +933,9 @@ TOOLTIPS_DelToolW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_EnumToolsA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_EnumToolsA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
UINT uIndex = (UINT)wParam;
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
TTTOOL_INFO *toolPtr;
......@@ -966,9 +968,9 @@ TOOLTIPS_EnumToolsA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_EnumToolsW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_EnumToolsW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
UINT uIndex = (UINT)wParam;
LPTTTOOLINFOW lpToolInfo = (LPTTTOOLINFOW)lParam;
TTTOOL_INFO *toolPtr;
......@@ -1001,9 +1003,9 @@ TOOLTIPS_EnumToolsW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_GetCurrentToolA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetCurrentToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
TTTOOL_INFO *toolPtr;
......@@ -1039,9 +1041,9 @@ TOOLTIPS_GetCurrentToolA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_GetCurrentToolW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetCurrentToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOW lpToolInfo = (LPTTTOOLINFOW)lParam;
TTTOOL_INFO *toolPtr;
......@@ -1077,9 +1079,9 @@ TOOLTIPS_GetCurrentToolW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_GetDelayTime (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetDelayTime (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
switch (wParam) {
case TTDT_AUTOMATIC:
......@@ -1100,9 +1102,9 @@ TOOLTIPS_GetDelayTime (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_GetMargin (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetMargin (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPRECT lpRect = (LPRECT)lParam;
lpRect->left = infoPtr->rcMargin.left;
......@@ -1115,18 +1117,18 @@ TOOLTIPS_GetMargin (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
TOOLTIPS_GetMaxTipWidth (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetMaxTipWidth (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
return infoPtr->nMaxTipWidth;
}
static LRESULT
TOOLTIPS_GetTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
INT nTool;
......@@ -1145,9 +1147,9 @@ TOOLTIPS_GetTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_GetTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOW lpToolInfo = (LPTTTOOLINFOW)lParam;
INT nTool;
......@@ -1166,33 +1168,33 @@ TOOLTIPS_GetTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
TOOLTIPS_GetTipBkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetTipBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
return infoPtr->clrBk;
}
__inline__ static LRESULT
TOOLTIPS_GetTipTextColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetTipTextColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
return infoPtr->clrText;
}
__inline__ static LRESULT
TOOLTIPS_GetToolCount (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetToolCount (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
return infoPtr->uNumTools;
}
static LRESULT
TOOLTIPS_GetToolInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetToolInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
TTTOOL_INFO *toolPtr;
INT nTool;
......@@ -1227,9 +1229,9 @@ TOOLTIPS_GetToolInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_GetToolInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetToolInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOW lpToolInfo = (LPTTTOOLINFOW)lParam;
TTTOOL_INFO *toolPtr;
INT nTool;
......@@ -1264,9 +1266,9 @@ TOOLTIPS_GetToolInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_HitTestA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_HitTestA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTHITTESTINFOA lptthit = (LPTTHITTESTINFOA)lParam;
TTTOOL_INFO *toolPtr;
INT nTool;
......@@ -1299,9 +1301,9 @@ TOOLTIPS_HitTestA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_HitTestW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_HitTestW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTHITTESTINFOW lptthit = (LPTTHITTESTINFOW)lParam;
TTTOOL_INFO *toolPtr;
INT nTool;
......@@ -1334,9 +1336,9 @@ TOOLTIPS_HitTestW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_NewToolRectA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_NewToolRectA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOA lpti = (LPTTTOOLINFOA)lParam;
INT nTool;
......@@ -1355,9 +1357,9 @@ TOOLTIPS_NewToolRectA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_NewToolRectW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_NewToolRectW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOW lpti = (LPTTTOOLINFOW)lParam;
INT nTool;
......@@ -1376,20 +1378,20 @@ TOOLTIPS_NewToolRectW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
TOOLTIPS_Pop (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_Pop (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
TOOLTIPS_Hide (wndPtr, infoPtr);
TOOLTIPS_Hide (hwnd, infoPtr);
return 0;
}
static LRESULT
TOOLTIPS_RelayEvent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_RelayEvent (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPMSG lpMsg = (LPMSG)lParam;
POINT pt;
......@@ -1410,8 +1412,8 @@ TOOLTIPS_RelayEvent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->nOldTool = infoPtr->nTool;
infoPtr->nTool = TOOLTIPS_GetToolFromPoint (infoPtr, lpMsg->hwnd, &pt);
TRACE (tooltips, "tool (%x) %d %d\n",
wndPtr->hwndSelf, infoPtr->nOldTool, infoPtr->nTool);
TOOLTIPS_Hide (wndPtr, infoPtr);
hwnd, infoPtr->nOldTool, infoPtr->nTool);
TOOLTIPS_Hide (hwnd, infoPtr);
break;
case WM_MOUSEMOVE:
......@@ -1420,24 +1422,22 @@ TOOLTIPS_RelayEvent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->nOldTool = infoPtr->nTool;
infoPtr->nTool = TOOLTIPS_GetToolFromPoint (infoPtr, lpMsg->hwnd, &pt);
TRACE (tooltips, "tool (%x) %d %d\n",
wndPtr->hwndSelf, infoPtr->nOldTool, infoPtr->nTool);
hwnd, infoPtr->nOldTool, infoPtr->nTool);
TRACE (tooltips, "WM_MOUSEMOVE (%04x %ld %ld)\n",
wndPtr->hwndSelf, pt.x, pt.y);
hwnd, pt.x, pt.y);
if ((infoPtr->bActive) && (infoPtr->nTool != infoPtr->nOldTool)) {
if (infoPtr->nOldTool == -1) {
SetTimer (wndPtr->hwndSelf, ID_TIMERSHOW,
infoPtr->nInitialTime, 0);
SetTimer (hwnd, ID_TIMERSHOW, infoPtr->nInitialTime, 0);
TRACE (tooltips, "timer 1 started!\n");
}
else {
TOOLTIPS_Hide (wndPtr, infoPtr);
SetTimer (wndPtr->hwndSelf, ID_TIMERSHOW,
infoPtr->nReshowTime, 0);
TOOLTIPS_Hide (hwnd, infoPtr);
SetTimer (hwnd, ID_TIMERSHOW, infoPtr->nReshowTime, 0);
TRACE (tooltips, "timer 2 started!\n");
}
}
if (infoPtr->nCurrentTool != -1) {
SetTimer (wndPtr->hwndSelf, ID_TIMERLEAVE, 100, 0);
SetTimer (hwnd, ID_TIMERLEAVE, 100, 0);
TRACE (tooltips, "timer 3 started!\n");
}
break;
......@@ -1448,9 +1448,9 @@ TOOLTIPS_RelayEvent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_SetDelayTime (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_SetDelayTime (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
INT nTime = (INT)LOWORD(lParam);
switch (wParam) {
......@@ -1487,9 +1487,9 @@ TOOLTIPS_SetDelayTime (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_SetMargin (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_SetMargin (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPRECT lpRect = (LPRECT)lParam;
infoPtr->rcMargin.left = lpRect->left;
......@@ -1502,9 +1502,9 @@ TOOLTIPS_SetMargin (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
TOOLTIPS_SetMaxTipWidth (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_SetMaxTipWidth (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
INT nTemp = infoPtr->nMaxTipWidth;
infoPtr->nMaxTipWidth = (INT)lParam;
......@@ -1514,9 +1514,9 @@ TOOLTIPS_SetMaxTipWidth (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
TOOLTIPS_SetTipBkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_SetTipBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
infoPtr->clrBk = (COLORREF)wParam;
......@@ -1525,9 +1525,9 @@ TOOLTIPS_SetTipBkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
__inline__ static LRESULT
TOOLTIPS_SetTipTextColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_SetTipTextColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
infoPtr->clrText = (COLORREF)wParam;
......@@ -1536,9 +1536,9 @@ TOOLTIPS_SetTipTextColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_SetToolInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_SetToolInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
TTTOOL_INFO *toolPtr;
INT nTool;
......@@ -1590,9 +1590,9 @@ TOOLTIPS_SetToolInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_SetToolInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_SetToolInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOW lpToolInfo = (LPTTTOOLINFOW)lParam;
TTTOOL_INFO *toolPtr;
INT nTool;
......@@ -1644,9 +1644,9 @@ TOOLTIPS_SetToolInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_TrackActivate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_TrackActivate (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
if (lpToolInfo == NULL)
......@@ -1660,12 +1660,12 @@ TOOLTIPS_TrackActivate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if (infoPtr->nTrackTool != -1) {
TRACE (tooltips, "activated!\n");
infoPtr->bTrackActive = TRUE;
TOOLTIPS_TrackShow (wndPtr, infoPtr);
TOOLTIPS_TrackShow (hwnd, infoPtr);
}
}
else {
/* deactivate */
TOOLTIPS_TrackHide (wndPtr, infoPtr);
TOOLTIPS_TrackHide (hwnd, infoPtr);
infoPtr->bTrackActive = FALSE;
infoPtr->nTrackTool = -1;
......@@ -1678,9 +1678,9 @@ TOOLTIPS_TrackActivate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_TrackPosition (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_TrackPosition (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
infoPtr->xTrackPos = (INT)LOWORD(lParam);
infoPtr->yTrackPos = (INT)HIWORD(lParam);
......@@ -1689,7 +1689,7 @@ TOOLTIPS_TrackPosition (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE (tooltips, "[%d %d]\n",
infoPtr->xTrackPos, infoPtr->yTrackPos);
TOOLTIPS_TrackShow (wndPtr, infoPtr);
TOOLTIPS_TrackShow (hwnd, infoPtr);
}
return 0;
......@@ -1697,21 +1697,21 @@ TOOLTIPS_TrackPosition (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_Update (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_Update (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
if (infoPtr->nCurrentTool != -1)
UpdateWindow (wndPtr->hwndSelf);
UpdateWindow (hwnd);
return 0;
}
static LRESULT
TOOLTIPS_UpdateTipTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_UpdateTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
TTTOOL_INFO *toolPtr;
INT nTool;
......@@ -1752,18 +1752,18 @@ TOOLTIPS_UpdateTipTextA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
/* force repaint */
if (infoPtr->bActive)
TOOLTIPS_Show (wndPtr, infoPtr);
TOOLTIPS_Show (hwnd, infoPtr);
else if (infoPtr->bTrackActive)
TOOLTIPS_TrackShow (wndPtr, infoPtr);
TOOLTIPS_TrackShow (hwnd, infoPtr);
return 0;
}
static LRESULT
TOOLTIPS_UpdateTipTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_UpdateTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
LPTTTOOLINFOW lpToolInfo = (LPTTTOOLINFOW)lParam;
TTTOOL_INFO *toolPtr;
INT nTool;
......@@ -1805,16 +1805,16 @@ TOOLTIPS_UpdateTipTextW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
/* force repaint */
if (infoPtr->bActive)
TOOLTIPS_Show (wndPtr, infoPtr);
TOOLTIPS_Show (hwnd, infoPtr);
else if (infoPtr->bTrackActive)
TOOLTIPS_TrackShow (wndPtr, infoPtr);
TOOLTIPS_TrackShow (hwnd, infoPtr);
return 0;
}
static LRESULT
TOOLTIPS_WindowFromPoint (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_WindowFromPoint (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
return WindowFromPoint (*((LPPOINT)lParam));
}
......@@ -1822,7 +1822,7 @@ TOOLTIPS_WindowFromPoint (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr;
NONCLIENTMETRICSA nclm;
......@@ -1830,12 +1830,7 @@ TOOLTIPS_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
/* allocate memory for info structure */
infoPtr = (TOOLTIPS_INFO *)COMCTL32_Alloc (sizeof(TOOLTIPS_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (tooltips, "could not allocate info memory!\n");
return 0;
}
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
/* initialize info structure */
infoPtr->bActive = TRUE;
......@@ -1858,9 +1853,8 @@ TOOLTIPS_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->nAutoPopTime = 5000;
infoPtr->nInitialTime = 500;
nResult =
(INT) SendMessageA (wndPtr->parent->hwndSelf, WM_NOTIFYFORMAT,
(WPARAM)wndPtr->hwndSelf, (LPARAM)NF_QUERY);
nResult = (INT) SendMessageA (GetParent (hwnd), WM_NOTIFYFORMAT,
(WPARAM)hwnd, (LPARAM)NF_QUERY);
if (nResult == NFR_ANSI)
FIXME (tooltips, " -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");
else if (nResult == NFR_UNICODE)
......@@ -1868,17 +1862,16 @@ TOOLTIPS_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
else
FIXME (tooltips, " -- WM_NOTIFYFORMAT returns: error!\n");
SetWindowPos (wndPtr->hwndSelf, HWND_TOP, 0, 0, 0, 0,
SWP_NOZORDER | SWP_HIDEWINDOW);
SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOZORDER | SWP_HIDEWINDOW);
return 0;
}
static LRESULT
TOOLTIPS_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
TTTOOL_INFO *toolPtr;
INT i;
......@@ -1922,14 +1915,14 @@ TOOLTIPS_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_EraseBackground (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
RECT rect;
HBRUSH hBrush;
hBrush = CreateSolidBrush (infoPtr->clrBk);
GetClientRect (wndPtr->hwndSelf, &rect);
GetClientRect (hwnd, &rect);
FillRect ((HDC)wParam, &rect, hBrush);
DeleteObject (hBrush);
......@@ -1938,39 +1931,42 @@ TOOLTIPS_EraseBackground (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_GetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_GetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
return infoPtr->hFont;
}
static LRESULT
TOOLTIPS_MouseMessage (WND *wndPtr, UINT uMsg, WPARAM wParam, LPARAM lParam)
TOOLTIPS_MouseMessage (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
TOOLTIPS_Hide (wndPtr, infoPtr);
TOOLTIPS_Hide (hwnd, infoPtr);
return 0;
}
static LRESULT
TOOLTIPS_NCCreate (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
wndPtr->dwStyle &= 0x0000FFFF;
wndPtr->dwStyle |= (WS_POPUP | WS_BORDER | WS_CLIPSIBLINGS);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
dwStyle &= 0x0000FFFF;
dwStyle |= (WS_POPUP | WS_BORDER | WS_CLIPSIBLINGS);
SetWindowLongA (hwnd, GWL_STYLE, dwStyle);
return TRUE;
}
static LRESULT
TOOLTIPS_NCHitTest (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_NCHitTest (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
INT nTool = (infoPtr->bTrackActive) ? infoPtr->nTrackTool : infoPtr->nTool;
TRACE (tooltips, " nTool=%d\n", nTool);
......@@ -1982,28 +1978,28 @@ TOOLTIPS_NCHitTest (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
}
return DefWindowProcA (wndPtr->hwndSelf, WM_NCHITTEST, wParam, lParam);
return DefWindowProcA (hwnd, WM_NCHITTEST, wParam, lParam);
}
static LRESULT
TOOLTIPS_Paint (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_Paint (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
hdc = (wParam == 0) ? BeginPaint (wndPtr->hwndSelf, &ps) : (HDC)wParam;
TOOLTIPS_Refresh (wndPtr, hdc);
hdc = (wParam == 0) ? BeginPaint (hwnd, &ps) : (HDC)wParam;
TOOLTIPS_Refresh (hwnd, hdc);
if (!wParam)
EndPaint (wndPtr->hwndSelf, &ps);
EndPaint (hwnd, &ps);
return 0;
}
static LRESULT
TOOLTIPS_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
infoPtr->hFont = (HFONT)wParam;
......@@ -2016,30 +2012,30 @@ TOOLTIPS_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_Timer (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_Timer (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
TRACE (tooltips, "timer %d (%x) expired!\n", wParam, wndPtr->hwndSelf);
TRACE (tooltips, "timer %d (%x) expired!\n", wParam, hwnd);
switch (wParam)
{
case ID_TIMERSHOW:
KillTimer (wndPtr->hwndSelf, ID_TIMERSHOW);
if (TOOLTIPS_CheckTool (wndPtr, TRUE) == infoPtr->nTool)
TOOLTIPS_Show (wndPtr, infoPtr);
KillTimer (hwnd, ID_TIMERSHOW);
if (TOOLTIPS_CheckTool (hwnd, TRUE) == infoPtr->nTool)
TOOLTIPS_Show (hwnd, infoPtr);
break;
case ID_TIMERPOP:
TOOLTIPS_Hide (wndPtr, infoPtr);
TOOLTIPS_Hide (hwnd, infoPtr);
break;
case ID_TIMERLEAVE:
KillTimer (wndPtr->hwndSelf, ID_TIMERLEAVE);
if (TOOLTIPS_CheckTool (wndPtr, FALSE) == -1) {
KillTimer (hwnd, ID_TIMERLEAVE);
if (TOOLTIPS_CheckTool (hwnd, FALSE) == -1) {
infoPtr->nTool = -1;
infoPtr->nOldTool = -1;
TOOLTIPS_Hide (wndPtr, infoPtr);
TOOLTIPS_Hide (hwnd, infoPtr);
}
break;
}
......@@ -2048,9 +2044,9 @@ TOOLTIPS_Timer (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TOOLTIPS_WinIniChange (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TOOLTIPS_WinIniChange (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
NONCLIENTMETRICSA nclm;
infoPtr->clrBk = GetSysColor (COLOR_INFOBK);
......@@ -2070,7 +2066,6 @@ TOOLTIPS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LPTT_SUBCLASS_INFO lpttsi =
(LPTT_SUBCLASS_INFO)GetPropA (hwnd, COMCTL32_aSubclass);
WND *wndPtr;
TOOLTIPS_INFO *infoPtr;
UINT nTool;
......@@ -2081,22 +2076,17 @@ TOOLTIPS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_MBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
{
wndPtr = WIN_FindWndPtr(lpttsi->hwndToolTip);
infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
infoPtr = TOOLTIPS_GetInfoPtr(lpttsi->hwndToolTip);
nTool = TOOLTIPS_GetToolFromMessage (infoPtr, hwnd);
TRACE (tooltips, "subclassed mouse message %04x\n", uMsg);
infoPtr->nOldTool = infoPtr->nTool;
infoPtr->nTool = nTool;
TOOLTIPS_Hide (wndPtr, infoPtr);
}
TOOLTIPS_Hide (lpttsi->hwndToolTip, infoPtr);
break;
case WM_MOUSEMOVE:
{
wndPtr = WIN_FindWndPtr(lpttsi->hwndToolTip);
infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
infoPtr = TOOLTIPS_GetInfoPtr (lpttsi->hwndToolTip);
nTool = TOOLTIPS_GetToolFromMessage (infoPtr, hwnd);
TRACE (tooltips, "subclassed WM_MOUSEMOVE\n");
......@@ -2106,22 +2096,21 @@ TOOLTIPS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if ((infoPtr->bActive) &&
(infoPtr->nTool != infoPtr->nOldTool)) {
if (infoPtr->nOldTool == -1) {
SetTimer (wndPtr->hwndSelf, ID_TIMERSHOW,
SetTimer (hwnd, ID_TIMERSHOW,
infoPtr->nInitialTime, 0);
TRACE (tooltips, "timer 1 started!\n");
}
else {
TOOLTIPS_Hide (wndPtr, infoPtr);
SetTimer (wndPtr->hwndSelf, ID_TIMERSHOW,
TOOLTIPS_Hide (lpttsi->hwndToolTip, infoPtr);
SetTimer (hwnd, ID_TIMERSHOW,
infoPtr->nReshowTime, 0);
TRACE (tooltips, "timer 2 started!\n");
}
}
if (infoPtr->nCurrentTool != -1) {
SetTimer (wndPtr->hwndSelf, ID_TIMERLEAVE, 100, 0);
SetTimer (hwnd, ID_TIMERLEAVE, 100, 0);
TRACE (tooltips, "timer 3 started!\n");
}
}
break;
}
......@@ -2132,136 +2121,134 @@ TOOLTIPS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK
TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case TTM_ACTIVATE:
return TOOLTIPS_Activate (wndPtr, wParam, lParam);
return TOOLTIPS_Activate (hwnd, wParam, lParam);
case TTM_ADDTOOLA:
return TOOLTIPS_AddToolA (wndPtr, wParam, lParam);
return TOOLTIPS_AddToolA (hwnd, wParam, lParam);
case TTM_ADDTOOLW:
return TOOLTIPS_AddToolW (wndPtr, wParam, lParam);
return TOOLTIPS_AddToolW (hwnd, wParam, lParam);
case TTM_DELTOOLA:
return TOOLTIPS_DelToolA (wndPtr, wParam, lParam);
return TOOLTIPS_DelToolA (hwnd, wParam, lParam);
case TTM_DELTOOLW:
return TOOLTIPS_DelToolW (wndPtr, wParam, lParam);
return TOOLTIPS_DelToolW (hwnd, wParam, lParam);
case TTM_ENUMTOOLSA:
return TOOLTIPS_EnumToolsA (wndPtr, wParam, lParam);
return TOOLTIPS_EnumToolsA (hwnd, wParam, lParam);
case TTM_ENUMTOOLSW:
return TOOLTIPS_EnumToolsW (wndPtr, wParam, lParam);
return TOOLTIPS_EnumToolsW (hwnd, wParam, lParam);
case TTM_GETCURRENTTOOLA:
return TOOLTIPS_GetCurrentToolA (wndPtr, wParam, lParam);
return TOOLTIPS_GetCurrentToolA (hwnd, wParam, lParam);
case TTM_GETCURRENTTOOLW:
return TOOLTIPS_GetCurrentToolW (wndPtr, wParam, lParam);
return TOOLTIPS_GetCurrentToolW (hwnd, wParam, lParam);
case TTM_GETDELAYTIME:
return TOOLTIPS_GetDelayTime (wndPtr, wParam, lParam);
return TOOLTIPS_GetDelayTime (hwnd, wParam, lParam);
case TTM_GETMARGIN:
return TOOLTIPS_GetMargin (wndPtr, wParam, lParam);
return TOOLTIPS_GetMargin (hwnd, wParam, lParam);
case TTM_GETMAXTIPWIDTH:
return TOOLTIPS_GetMaxTipWidth (wndPtr, wParam, lParam);
return TOOLTIPS_GetMaxTipWidth (hwnd, wParam, lParam);
case TTM_GETTEXTA:
return TOOLTIPS_GetTextA (wndPtr, wParam, lParam);
return TOOLTIPS_GetTextA (hwnd, wParam, lParam);
case TTM_GETTEXTW:
return TOOLTIPS_GetTextW (wndPtr, wParam, lParam);
return TOOLTIPS_GetTextW (hwnd, wParam, lParam);
case TTM_GETTIPBKCOLOR:
return TOOLTIPS_GetTipBkColor (wndPtr, wParam, lParam);
return TOOLTIPS_GetTipBkColor (hwnd, wParam, lParam);
case TTM_GETTIPTEXTCOLOR:
return TOOLTIPS_GetTipTextColor (wndPtr, wParam, lParam);
return TOOLTIPS_GetTipTextColor (hwnd, wParam, lParam);
case TTM_GETTOOLCOUNT:
return TOOLTIPS_GetToolCount (wndPtr, wParam, lParam);
return TOOLTIPS_GetToolCount (hwnd, wParam, lParam);
case TTM_GETTOOLINFOA:
return TOOLTIPS_GetToolInfoA (wndPtr, wParam, lParam);
return TOOLTIPS_GetToolInfoA (hwnd, wParam, lParam);
case TTM_GETTOOLINFOW:
return TOOLTIPS_GetToolInfoW (wndPtr, wParam, lParam);
return TOOLTIPS_GetToolInfoW (hwnd, wParam, lParam);
case TTM_HITTESTA:
return TOOLTIPS_HitTestA (wndPtr, wParam, lParam);
return TOOLTIPS_HitTestA (hwnd, wParam, lParam);
case TTM_HITTESTW:
return TOOLTIPS_HitTestW (wndPtr, wParam, lParam);
return TOOLTIPS_HitTestW (hwnd, wParam, lParam);
case TTM_NEWTOOLRECTA:
return TOOLTIPS_NewToolRectA (wndPtr, wParam, lParam);
return TOOLTIPS_NewToolRectA (hwnd, wParam, lParam);
case TTM_NEWTOOLRECTW:
return TOOLTIPS_NewToolRectW (wndPtr, wParam, lParam);
return TOOLTIPS_NewToolRectW (hwnd, wParam, lParam);
case TTM_POP:
return TOOLTIPS_Pop (wndPtr, wParam, lParam);
return TOOLTIPS_Pop (hwnd, wParam, lParam);
case TTM_RELAYEVENT:
return TOOLTIPS_RelayEvent (wndPtr, wParam, lParam);
return TOOLTIPS_RelayEvent (hwnd, wParam, lParam);
case TTM_SETDELAYTIME:
return TOOLTIPS_SetDelayTime (wndPtr, wParam, lParam);
return TOOLTIPS_SetDelayTime (hwnd, wParam, lParam);
case TTM_SETMARGIN:
return TOOLTIPS_SetMargin (wndPtr, wParam, lParam);
return TOOLTIPS_SetMargin (hwnd, wParam, lParam);
case TTM_SETMAXTIPWIDTH:
return TOOLTIPS_SetMaxTipWidth (wndPtr, wParam, lParam);
return TOOLTIPS_SetMaxTipWidth (hwnd, wParam, lParam);
case TTM_SETTIPBKCOLOR:
return TOOLTIPS_SetTipBkColor (wndPtr, wParam, lParam);
return TOOLTIPS_SetTipBkColor (hwnd, wParam, lParam);
case TTM_SETTIPTEXTCOLOR:
return TOOLTIPS_SetTipTextColor (wndPtr, wParam, lParam);
return TOOLTIPS_SetTipTextColor (hwnd, wParam, lParam);
case TTM_SETTOOLINFOA:
return TOOLTIPS_SetToolInfoA (wndPtr, wParam, lParam);
return TOOLTIPS_SetToolInfoA (hwnd, wParam, lParam);
case TTM_SETTOOLINFOW:
return TOOLTIPS_SetToolInfoW (wndPtr, wParam, lParam);
return TOOLTIPS_SetToolInfoW (hwnd, wParam, lParam);
case TTM_TRACKACTIVATE:
return TOOLTIPS_TrackActivate (wndPtr, wParam, lParam);
return TOOLTIPS_TrackActivate (hwnd, wParam, lParam);
case TTM_TRACKPOSITION:
return TOOLTIPS_TrackPosition (wndPtr, wParam, lParam);
return TOOLTIPS_TrackPosition (hwnd, wParam, lParam);
case TTM_UPDATE:
return TOOLTIPS_Update (wndPtr, wParam, lParam);
return TOOLTIPS_Update (hwnd, wParam, lParam);
case TTM_UPDATETIPTEXTA:
return TOOLTIPS_UpdateTipTextA (wndPtr, wParam, lParam);
return TOOLTIPS_UpdateTipTextA (hwnd, wParam, lParam);
case TTM_UPDATETIPTEXTW:
return TOOLTIPS_UpdateTipTextW (wndPtr, wParam, lParam);
return TOOLTIPS_UpdateTipTextW (hwnd, wParam, lParam);
case TTM_WINDOWFROMPOINT:
return TOOLTIPS_WindowFromPoint (wndPtr, wParam, lParam);
return TOOLTIPS_WindowFromPoint (hwnd, wParam, lParam);
case WM_CREATE:
return TOOLTIPS_Create (wndPtr, wParam, lParam);
return TOOLTIPS_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return TOOLTIPS_Destroy (wndPtr, wParam, lParam);
return TOOLTIPS_Destroy (hwnd, wParam, lParam);
case WM_ERASEBKGND:
return TOOLTIPS_EraseBackground (wndPtr, wParam, lParam);
return TOOLTIPS_EraseBackground (hwnd, wParam, lParam);
case WM_GETFONT:
return TOOLTIPS_GetFont (wndPtr, wParam, lParam);
return TOOLTIPS_GetFont (hwnd, wParam, lParam);
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
......@@ -2270,28 +2257,28 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_MOUSEMOVE:
return TOOLTIPS_MouseMessage (wndPtr, uMsg, wParam, lParam);
return TOOLTIPS_MouseMessage (hwnd, uMsg, wParam, lParam);
case WM_NCCREATE:
return TOOLTIPS_NCCreate (wndPtr, wParam, lParam);
return TOOLTIPS_NCCreate (hwnd, wParam, lParam);
case WM_NCHITTEST:
return TOOLTIPS_NCHitTest (wndPtr, wParam, lParam);
return TOOLTIPS_NCHitTest (hwnd, wParam, lParam);
/* case WM_NOTIFYFORMAT: */
/* return TOOLTIPS_NotifyFormat (wndPtr, wParam, lParam); */
/* return TOOLTIPS_NotifyFormat (hwnd, wParam, lParam); */
case WM_PAINT:
return TOOLTIPS_Paint (wndPtr, wParam, lParam);
return TOOLTIPS_Paint (hwnd, wParam, lParam);
case WM_SETFONT:
return TOOLTIPS_SetFont (wndPtr, wParam, lParam);
return TOOLTIPS_SetFont (hwnd, wParam, lParam);
case WM_TIMER:
return TOOLTIPS_Timer (wndPtr, wParam, lParam);
return TOOLTIPS_Timer (hwnd, wParam, lParam);
case WM_WININICHANGE:
return TOOLTIPS_WinIniChange (wndPtr, wParam, lParam);
return TOOLTIPS_WinIniChange (hwnd, wParam, lParam);
default:
if (uMsg >= WM_USER)
......
/*
* Trackbar control
*
* Copyright 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* Copyright 1998, 1999 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* Copyright 1998,1999 Alex Priem <alexp@sci.kun.nl>
*
*
......@@ -30,7 +30,7 @@
#include "debug.h"
#define TRACKBAR_GetInfoPtr(wndPtr) ((TRACKBAR_INFO *)wndPtr->wExtra[0])
#define TRACKBAR_GetInfoPtr(wndPtr) ((TRACKBAR_INFO *)GetWindowLongA (hwnd,0))
/* Used by TRACKBAR_Refresh to find out which parts of the control
......@@ -55,7 +55,7 @@
#define TIC_SELECTIONMARKMIN 0x100
#define TIC_SELECTIONMARK (TIC_SELECTIONMARKMAX | TIC_SELECTIONMARKMIN)
static BOOL TRACKBAR_SendNotify (WND *wndPtr, UINT code);
static BOOL TRACKBAR_SendNotify (HWND hwnd, UINT code);
void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
......@@ -108,27 +108,28 @@ TRACKBAR_ConvertPlaceToPosition (TRACKBAR_INFO *infoPtr, int place,
static VOID
TRACKBAR_CalcChannel (WND *wndPtr, TRACKBAR_INFO *infoPtr)
TRACKBAR_CalcChannel (HWND hwnd, TRACKBAR_INFO *infoPtr)
{
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
INT cyChannel;
RECT lpRect,*channel = & infoPtr->rcChannel;
GetClientRect (wndPtr->hwndSelf, &lpRect);
GetClientRect (hwnd, &lpRect);
if (wndPtr->dwStyle & TBS_ENABLESELRANGE)
if (dwStyle & TBS_ENABLESELRANGE)
cyChannel = MAX(infoPtr->uThumbLen - 8, 4);
else
cyChannel = 4;
if (wndPtr->dwStyle & TBS_VERT) {
if (dwStyle & TBS_VERT) {
channel->top = lpRect.top + 8;
channel->bottom = lpRect.bottom - 8;
if (wndPtr->dwStyle & TBS_BOTH) {
if (dwStyle & TBS_BOTH) {
channel->left = (lpRect.right - cyChannel) / 2;
channel->right = (lpRect.right + cyChannel) / 2;
}
else if (wndPtr->dwStyle & TBS_LEFT) {
else if (dwStyle & TBS_LEFT) {
channel->left = lpRect.left + 10;
channel->right = channel->left + cyChannel;
}
......@@ -140,11 +141,11 @@ TRACKBAR_CalcChannel (WND *wndPtr, TRACKBAR_INFO *infoPtr)
else {
channel->left = lpRect.left + 8;
channel->right = lpRect.right - 8;
if (wndPtr->dwStyle & TBS_BOTH) {
if (dwStyle & TBS_BOTH) {
channel->top = (lpRect.bottom - cyChannel) / 2;
channel->bottom = (lpRect.bottom + cyChannel) / 2;
}
else if (wndPtr->dwStyle & TBS_TOP) {
else if (dwStyle & TBS_TOP) {
channel->top = lpRect.top + 10;
channel->bottom = channel->top + cyChannel;
}
......@@ -156,7 +157,7 @@ TRACKBAR_CalcChannel (WND *wndPtr, TRACKBAR_INFO *infoPtr)
}
static VOID
TRACKBAR_CalcThumb (WND *wndPtr, TRACKBAR_INFO *infoPtr)
TRACKBAR_CalcThumb (HWND hwnd, TRACKBAR_INFO *infoPtr)
{
RECT *thumb;
......@@ -164,7 +165,7 @@ TRACKBAR_CalcThumb (WND *wndPtr, TRACKBAR_INFO *infoPtr)
thumb=&infoPtr->rcThumb;
range=infoPtr->nRangeMax - infoPtr->nRangeMin;
if (wndPtr->dwStyle & TBS_VERT) {
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_VERT) {
width=infoPtr->rcChannel.bottom - infoPtr->rcChannel.top;
thumb->left = infoPtr->rcChannel.left - 1;
thumb->right = infoPtr->rcChannel.left + infoPtr->uThumbLen - 8;
......@@ -183,7 +184,7 @@ TRACKBAR_CalcThumb (WND *wndPtr, TRACKBAR_INFO *infoPtr)
}
static VOID
TRACKBAR_CalcSelection (WND *wndPtr, TRACKBAR_INFO *infoPtr)
TRACKBAR_CalcSelection (HWND hwnd, TRACKBAR_INFO *infoPtr)
{
RECT *selection;
int range, width;
......@@ -195,7 +196,7 @@ TRACKBAR_CalcSelection (WND *wndPtr, TRACKBAR_INFO *infoPtr)
if (range <= 0)
SetRectEmpty (selection);
else
if (wndPtr->dwStyle & TBS_VERT) {
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_VERT) {
selection->left = infoPtr->rcChannel.left +
(width*infoPtr->nSelMin)/range;
selection->right = infoPtr->rcChannel.left +
......@@ -214,17 +215,16 @@ TRACKBAR_CalcSelection (WND *wndPtr, TRACKBAR_INFO *infoPtr)
static void
TRACKBAR_QueueRefresh (WND *wndPtr)
TRACKBAR_QueueRefresh (HWND hwnd)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
TRACE (trackbar,"queued\n");
if (infoPtr->flags & TB_REFRESH_TIMER_SET) {
KillTimer (wndPtr->hwndSelf, TB_REFRESH_TIMER);
KillTimer (hwnd, TB_REFRESH_TIMER);
}
SetTimer (wndPtr->hwndSelf, TB_REFRESH_TIMER, TB_REFRESH_DELAY, 0);
SetTimer (hwnd, TB_REFRESH_TIMER, TB_REFRESH_DELAY, 0);
infoPtr->flags|=TB_REFRESH_TIMER_SET;
}
......@@ -365,20 +365,21 @@ TRACKBAR_DrawTics (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
static VOID
TRACKBAR_Refresh (WND *wndPtr, HDC hdc)
TRACKBAR_Refresh (HWND hwnd, HDC hdc)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
RECT rcClient, rcChannel, rcSelection;
HBRUSH hBrush = CreateSolidBrush (infoPtr->clrBk);
int i;
GetClientRect (wndPtr->hwndSelf, &rcClient);
GetClientRect (hwnd, &rcClient);
hBrush = CreateSolidBrush (infoPtr->clrBk);
FillRect (hdc, &rcClient, hBrush);
DeleteObject (hBrush);
if (infoPtr->flags & TB_REFRESH_TIMER_SET) {
KillTimer (wndPtr->hwndSelf, TB_REFRESH_TIMER);
KillTimer (hwnd, TB_REFRESH_TIMER);
infoPtr->flags &= ~TB_REFRESH_TIMER_SET;
}
......@@ -388,12 +389,12 @@ TRACKBAR_Refresh (WND *wndPtr, HDC hdc)
}
if (infoPtr->flags & TB_THUMBCHANGED) {
TRACKBAR_CalcThumb (wndPtr, infoPtr);
TRACKBAR_CalcThumb (hwnd, infoPtr);
if (infoPtr->flags & TB_THUMBSIZECHANGED)
TRACKBAR_CalcChannel (wndPtr, infoPtr);
TRACKBAR_CalcChannel (hwnd, infoPtr);
}
if (infoPtr->flags & TB_SELECTIONCHANGED)
TRACKBAR_CalcSelection (wndPtr, infoPtr);
TRACKBAR_CalcSelection (hwnd, infoPtr);
infoPtr->flags &= ~ (TB_THUMBCHANGED | TB_SELECTIONCHANGED | TB_DRAGPOSVALID);
/* draw channel */
......@@ -402,12 +403,12 @@ TRACKBAR_Refresh (WND *wndPtr, HDC hdc)
rcSelection= infoPtr->rcSelection;
DrawEdge (hdc, &rcChannel, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
if (wndPtr->dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */
if (dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */
HBRUSH hbr = CreateSolidBrush (RGB(255,255,255));
FillRect (hdc, &rcChannel, hbr);
if (((wndPtr->dwStyle & TBS_VERT) &&
if (((dwStyle & TBS_VERT) &&
(rcSelection.left!=rcSelection.right)) ||
((!(wndPtr->dwStyle & TBS_VERT)) &&
((!(dwStyle & TBS_VERT)) &&
(rcSelection.left!=rcSelection.right))) {
hbr=CreateSolidBrush (COLOR_HIGHLIGHT);
FillRect (hdc, &rcSelection, hbr);
......@@ -418,8 +419,8 @@ TRACKBAR_Refresh (WND *wndPtr, HDC hdc)
/* draw tics */
if (!(wndPtr->dwStyle & TBS_NOTICKS)) {
int ticFlags=wndPtr->dwStyle & 0x0f;
if (!(dwStyle & TBS_NOTICKS)) {
int ticFlags = dwStyle & 0x0f;
COLORREF clrTic=GetSysColor (COLOR_3DDKSHADOW);
for (i=0; i<infoPtr->uNumTics; i++)
......@@ -429,7 +430,7 @@ TRACKBAR_Refresh (WND *wndPtr, HDC hdc)
TRACKBAR_DrawTics (infoPtr, hdc, 0, ticFlags | TIC_LEFTEDGE, clrTic);
TRACKBAR_DrawTics (infoPtr, hdc, 0, ticFlags | TIC_RIGHTEDGE, clrTic);
if ((wndPtr->dwStyle & TBS_ENABLESELRANGE) &&
if ((dwStyle & TBS_ENABLESELRANGE) &&
(rcSelection.left!=rcSelection.right)) {
TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->nSelMin,
ticFlags | TIC_SELECTIONMARKMIN, clrTic);
......@@ -440,14 +441,14 @@ TRACKBAR_Refresh (WND *wndPtr, HDC hdc)
/* draw thumb */
if (!(wndPtr->dwStyle & TBS_NOTHUMB)) {
if (!(dwStyle & TBS_NOTHUMB)) {
HBRUSH hbr = CreateSolidBrush (COLOR_BACKGROUND);
RECT thumb = infoPtr->rcThumb;
SelectObject (hdc, hbr);
if (wndPtr->dwStyle & TBS_BOTH) {
if (dwStyle & TBS_BOTH) {
FillRect (hdc, &thumb, hbr);
DrawEdge (hdc, &thumb, EDGE_RAISED, BF_TOPLEFT);
} else {
......@@ -472,7 +473,7 @@ TRACKBAR_Refresh (WND *wndPtr, HDC hdc)
points[5].y=points[0].y;
Polygon (hdc, points, 6);
if (wndPtr->dwStyle & TBS_VERT) {
if (dwStyle & TBS_VERT) {
/* draw edge */
} else {
RECT triangle; /* for correct shadows of thumb */
......@@ -503,13 +504,14 @@ TRACKBAR_Refresh (WND *wndPtr, HDC hdc)
static VOID
TRACKBAR_AlignBuddies (WND *wndPtr, TRACKBAR_INFO *infoPtr)
TRACKBAR_AlignBuddies (HWND hwnd, TRACKBAR_INFO *infoPtr)
{
HWND hwndParent = GetParent (wndPtr->hwndSelf);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
HWND hwndParent = GetParent (hwnd);
RECT rcSelf, rcBuddy;
INT x, y;
GetWindowRect (wndPtr->hwndSelf, &rcSelf);
GetWindowRect (hwnd, &rcSelf);
MapWindowPoints (HWND_DESKTOP, hwndParent, (LPPOINT)&rcSelf, 2);
/* align buddy left or above */
......@@ -517,7 +519,7 @@ TRACKBAR_AlignBuddies (WND *wndPtr, TRACKBAR_INFO *infoPtr)
GetWindowRect (infoPtr->hwndBuddyLA, &rcBuddy);
MapWindowPoints (HWND_DESKTOP, hwndParent, (LPPOINT)&rcBuddy, 2);
if (wndPtr->dwStyle & TBS_VERT) {
if (dwStyle & TBS_VERT) {
x = (infoPtr->rcChannel.right + infoPtr->rcChannel.left) / 2 -
(rcBuddy.right - rcBuddy.left) / 2 + rcSelf.left;
y = rcSelf.top - (rcBuddy.bottom - rcBuddy.top);
......@@ -538,7 +540,7 @@ TRACKBAR_AlignBuddies (WND *wndPtr, TRACKBAR_INFO *infoPtr)
GetWindowRect (infoPtr->hwndBuddyRB, &rcBuddy);
MapWindowPoints (HWND_DESKTOP, hwndParent, (LPPOINT)&rcBuddy, 2);
if (wndPtr->dwStyle & TBS_VERT) {
if (dwStyle & TBS_VERT) {
x = (infoPtr->rcChannel.right + infoPtr->rcChannel.left) / 2 -
(rcBuddy.right - rcBuddy.left) / 2 + rcSelf.left;
y = rcSelf.bottom;
......@@ -555,18 +557,18 @@ TRACKBAR_AlignBuddies (WND *wndPtr, TRACKBAR_INFO *infoPtr)
static LRESULT
TRACKBAR_ClearSel (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_ClearSel (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
infoPtr->nSelMin = 0;
infoPtr->nSelMax = 0;
infoPtr->flags |=TB_SELECTIONCHANGED;
if ((BOOL)wParam) {
HDC hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HDC hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -574,9 +576,9 @@ TRACKBAR_ClearSel (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_ClearTics (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_ClearTics (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
if (infoPtr->tics) {
COMCTL32_Free (infoPtr->tics);
......@@ -585,9 +587,9 @@ TRACKBAR_ClearTics (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
if (wParam) {
HDC hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HDC hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -595,9 +597,9 @@ TRACKBAR_ClearTics (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_GetBuddy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetBuddy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
if (wParam) /* buddy is left or above */
return (LRESULT)infoPtr->hwndBuddyLA;
......@@ -608,9 +610,9 @@ TRACKBAR_GetBuddy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_GetChannelRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetChannelRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
LPRECT lprc = (LPRECT)lParam;
if (lprc == NULL)
......@@ -626,20 +628,20 @@ TRACKBAR_GetChannelRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_GetLineSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetLineSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
return infoPtr->nLineSize;
}
static LRESULT
TRACKBAR_GetNumTics (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetNumTics (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
if (wndPtr->dwStyle & TBS_NOTICKS)
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_NOTICKS)
return 0;
return infoPtr->uNumTics+2;
......@@ -647,18 +649,18 @@ TRACKBAR_GetNumTics (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_GetPageSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetPageSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
return infoPtr->nPageSize;
}
static LRESULT
TRACKBAR_GetPos (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetPos (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
return infoPtr->nPos;
}
......@@ -667,61 +669,61 @@ TRACKBAR_GetPos (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_GetRangeMax (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetRangeMax (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
return infoPtr->nRangeMax;
}
static LRESULT
TRACKBAR_GetRangeMin (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetRangeMin (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
return infoPtr->nRangeMin;
}
static LRESULT
TRACKBAR_GetSelEnd (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetSelEnd (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
return infoPtr->nSelMax;
}
static LRESULT
TRACKBAR_GetSelStart (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetSelStart (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
return infoPtr->nSelMin;
}
static LRESULT
TRACKBAR_GetThumbLength (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetThumbLength (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
return infoPtr->uThumbLen;
}
static LRESULT
TRACKBAR_GetPTics (WND *wndPtr)
TRACKBAR_GetPTics (HWND hwnd)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
return (LRESULT) infoPtr->tics;
}
static LRESULT
TRACKBAR_GetThumbRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetThumbRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
LPRECT lprc = (LPRECT)lParam;
if (lprc == NULL)
......@@ -740,10 +742,10 @@ TRACKBAR_GetThumbRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_GetTic (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetTic (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
INT iTic;
iTic=(INT) wParam;
......@@ -756,10 +758,9 @@ TRACKBAR_GetTic (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_GetTicPos (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetTicPos (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
INT iTic, range, width, pos;
......@@ -776,11 +777,11 @@ TRACKBAR_GetTicPos (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
static LRESULT
TRACKBAR_GetToolTips (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_GetToolTips (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
if (wndPtr->dwStyle & TBS_TOOLTIPS)
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_TOOLTIPS)
return (LRESULT)infoPtr->hwndToolTip;
return 0;
}
......@@ -790,9 +791,9 @@ TRACKBAR_GetToolTips (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetBuddy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetBuddy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
HWND hwndTemp;
if (wParam) {
......@@ -810,16 +811,16 @@ TRACKBAR_SetBuddy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
FIXME (trackbar, "move buddy!\n");
}
TRACKBAR_AlignBuddies (wndPtr, infoPtr);
TRACKBAR_AlignBuddies (hwnd, infoPtr);
return (LRESULT)hwndTemp;
}
static LRESULT
TRACKBAR_SetLineSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetLineSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
INT nTemp = infoPtr->nLineSize;
infoPtr->nLineSize = (INT)lParam;
......@@ -829,9 +830,9 @@ TRACKBAR_SetLineSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetPageSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetPageSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
INT nTemp = infoPtr->nPageSize;
infoPtr->nPageSize = (INT)lParam;
......@@ -841,9 +842,9 @@ TRACKBAR_SetPageSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetPos (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetPos (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
infoPtr->nPos = (INT)HIWORD(lParam);
......@@ -855,9 +856,9 @@ TRACKBAR_SetPos (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->flags |=TB_THUMBPOSCHANGED;
if (wParam) {
HDC hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HDC hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -865,9 +866,9 @@ TRACKBAR_SetPos (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetRange (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetRange (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
infoPtr->nRangeMin = (INT)LOWORD(lParam);
infoPtr->nRangeMax = (INT)HIWORD(lParam);
......@@ -885,9 +886,9 @@ TRACKBAR_SetRange (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_RecalculateTics (infoPtr);
if (wParam) {
HDC hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HDC hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -895,9 +896,9 @@ TRACKBAR_SetRange (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetRangeMax (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetRangeMax (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
infoPtr->nRangeMax = (INT)lParam;
if (infoPtr->nPos > infoPtr->nRangeMax) {
......@@ -909,9 +910,9 @@ TRACKBAR_SetRangeMax (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_RecalculateTics (infoPtr);
if (wParam) {
HDC hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HDC hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -919,9 +920,9 @@ TRACKBAR_SetRangeMax (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetRangeMin (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetRangeMin (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
infoPtr->nRangeMin = (INT)lParam;
if (infoPtr->nPos < infoPtr->nRangeMin) {
......@@ -933,42 +934,43 @@ TRACKBAR_SetRangeMin (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_RecalculateTics (infoPtr);
if (wParam) {
HDC hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HDC hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
}
static LRESULT
TRACKBAR_SetTicFreq (WND *wndPtr, WPARAM wParam)
TRACKBAR_SetTicFreq (HWND hwnd, WPARAM wParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
HDC hdc;
if (wndPtr->dwStyle & TBS_AUTOTICKS)
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_AUTOTICKS)
infoPtr->uTicFreq=(UINT) wParam;
TRACKBAR_RecalculateTics (infoPtr);
hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return 0;
}
static LRESULT
TRACKBAR_SetSel (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetSel (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
infoPtr->nSelMin = (INT)LOWORD(lParam);
infoPtr->nSelMax = (INT)HIWORD(lParam);
infoPtr->flags |=TB_SELECTIONCHANGED;
if (!wndPtr->dwStyle & TBS_ENABLESELRANGE)
if (!GetWindowLongA (hwnd, GWL_STYLE) & TBS_ENABLESELRANGE)
return 0;
if (infoPtr->nSelMin < infoPtr->nRangeMin)
......@@ -977,9 +979,9 @@ TRACKBAR_SetSel (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->nSelMax = infoPtr->nRangeMax;
if (wParam) {
HDC hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HDC hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -987,11 +989,11 @@ TRACKBAR_SetSel (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetSelEnd (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetSelEnd (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
if (!wndPtr->dwStyle & TBS_ENABLESELRANGE)
if (!GetWindowLongA (hwnd, GWL_STYLE) & TBS_ENABLESELRANGE)
return 0;
infoPtr->nSelMax = (INT)lParam;
......@@ -1001,9 +1003,9 @@ TRACKBAR_SetSelEnd (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->nSelMax = infoPtr->nRangeMax;
if (wParam) {
HDC hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HDC hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -1011,22 +1013,23 @@ TRACKBAR_SetSelEnd (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetSelStart (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetSelStart (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
if (!wndPtr->dwStyle & TBS_ENABLESELRANGE)
if (!GetWindowLongA (hwnd, GWL_STYLE) & TBS_ENABLESELRANGE)
return 0;
infoPtr->nSelMin = (INT)lParam;
infoPtr->flags |=TB_SELECTIONCHANGED;
if (infoPtr->nSelMin < infoPtr->nRangeMin)
infoPtr->nSelMin = infoPtr->nRangeMin;
if (wParam) {
HDC hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
HDC hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
}
return 0;
......@@ -1034,27 +1037,28 @@ TRACKBAR_SetSelStart (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetThumbLength (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetThumbLength (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
HDC hdc;
if (wndPtr->dwStyle & TBS_FIXEDLENGTH)
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_FIXEDLENGTH)
infoPtr->uThumbLen = (UINT)wParam;
hdc = GetDC (wndPtr->hwndSelf);
infoPtr->flags |=TB_THUMBSIZECHANGED;
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return 0;
}
static LRESULT
TRACKBAR_SetTic (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetTic (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
INT nPos = (INT)lParam;
HDC hdc;
......@@ -1066,9 +1070,9 @@ TRACKBAR_SetTic (WND *wndPtr, WPARAM wParam, LPARAM lParam)
(infoPtr->uNumTics)*sizeof (DWORD));
infoPtr->tics[infoPtr->uNumTics-1]=nPos;
hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
......@@ -1077,9 +1081,9 @@ TRACKBAR_SetTic (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetTipSide (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetTipSide (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
INT fTemp = infoPtr->fLocation;
infoPtr->fLocation = (INT)wParam;
......@@ -1089,9 +1093,9 @@ TRACKBAR_SetTipSide (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_SetToolTips (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetToolTips (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
infoPtr->hwndToolTip = (HWND)wParam;
......@@ -1103,14 +1107,14 @@ TRACKBAR_SetToolTips (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_InitializeThumb (WND *wndPtr)
TRACKBAR_InitializeThumb (HWND hwnd)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
infoPtr->uThumbLen = 23; /* initial thumb length */
TRACKBAR_CalcChannel (wndPtr,infoPtr);
TRACKBAR_CalcThumb (wndPtr, infoPtr);
TRACKBAR_CalcChannel (hwnd,infoPtr);
TRACKBAR_CalcThumb (hwnd, infoPtr);
infoPtr->flags &= ~TB_SELECTIONCHANGED;
return 0;
......@@ -1118,15 +1122,15 @@ TRACKBAR_InitializeThumb (WND *wndPtr)
static LRESULT
TRACKBAR_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr;
infoPtr = (TRACKBAR_INFO *)COMCTL32_Alloc (sizeof(TRACKBAR_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
infoPtr->nRangeMin = 0; /* default values */
/* set default values */
infoPtr->nRangeMin = 0;
infoPtr->nRangeMax = 100;
infoPtr->nLineSize = 1;
infoPtr->nPageSize = 20;
......@@ -1138,54 +1142,55 @@ TRACKBAR_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->uTicFreq = 1;
infoPtr->tics = NULL;
infoPtr->clrBk = GetSysColor (COLOR_BACKGROUND);
infoPtr->hwndNotify = GetParent (wndPtr->hwndSelf);
infoPtr->hwndNotify = GetParent (hwnd);
TRACKBAR_InitializeThumb (wndPtr);
TRACKBAR_InitializeThumb (hwnd);
if (wndPtr->dwStyle & TBS_TOOLTIPS) { /* Create tooltip control */
/* Create tooltip control */
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_TOOLTIPS) {
TTTOOLINFOA ti;
infoPtr->hwndToolTip =
CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
wndPtr->hwndSelf, 0, 0, 0);
hwnd, 0, 0, 0);
/* Send NM_TOOLTIPSCREATED notification */
if (infoPtr->hwndToolTip) {
NMTOOLTIPSCREATED nmttc;
nmttc.hdr.hwndFrom = wndPtr->hwndSelf;
nmttc.hdr.idFrom = wndPtr->wIDmenu;
nmttc.hdr.hwndFrom = hwnd;
nmttc.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmttc.hdr.code = NM_TOOLTIPSCREATED;
nmttc.hwndToolTips = infoPtr->hwndToolTip;
SendMessageA (GetParent (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM)wndPtr->wIDmenu, (LPARAM)&nmttc);
SendMessageA (GetParent (hwnd), WM_NOTIFY,
(WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc);
}
ZeroMemory (&ti, sizeof(TTTOOLINFOA));
ti.cbSize = sizeof(TTTOOLINFOA);
ti.uFlags = TTF_IDISHWND | TTF_TRACK;
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = 0;
ti.lpszText = "Test"; /* LPSTR_TEXTCALLBACK */
SetRectEmpty (&ti.rect);
SendMessageA (infoPtr->hwndToolTip, TTM_ADDTOOLA, 0, (LPARAM)&ti);
}
return 0;
}
static LRESULT
TRACKBAR_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
if (infoPtr->flags & TB_REFRESH_TIMER_SET)
KillTimer (wndPtr->hwndSelf, TB_REFRESH_TIMER);
KillTimer (hwnd, TB_REFRESH_TIMER);
/* delete tooltip control */
if (infoPtr->hwndToolTip)
......@@ -1197,30 +1202,32 @@ TRACKBAR_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT
TRACKBAR_KillFocus (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_KillFocus (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
TRACE (trackbar,"\n");
infoPtr->bFocus = FALSE;
infoPtr->flags &= ~TB_DRAG_MODE;
TRACKBAR_QueueRefresh (wndPtr);
InvalidateRect (wndPtr->hwndSelf, NULL, TRUE);
TRACKBAR_QueueRefresh (hwnd);
InvalidateRect (hwnd, NULL, TRUE);
return 0;
}
static LRESULT
TRACKBAR_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
int clickPlace,prevPos,clickPos,vertical;
SetFocus (wndPtr->hwndSelf);
SetFocus (hwnd);
vertical=wndPtr->dwStyle & TBS_VERT;
vertical = dwStyle & TBS_VERT;
if (vertical)
clickPlace=(INT)HIWORD(lParam);
else
......@@ -1233,7 +1240,7 @@ TRACKBAR_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
(clickPlace>infoPtr->rcThumb.left) &&
(clickPlace<infoPtr->rcThumb.right))) {
infoPtr->flags |= TB_DRAG_MODE;
if (wndPtr->dwStyle & TBS_TOOLTIPS) { /* enable tooltip */
if (dwStyle & TBS_TOOLTIPS) { /* enable tooltip */
TTTOOLINFOA ti;
POINT pt;
......@@ -1243,10 +1250,10 @@ TRACKBAR_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
ti.cbSize = sizeof(TTTOOLINFOA);
ti.uId = 0;
ti.hwnd = (UINT)wndPtr->hwndSelf;
ti.hwnd = (UINT)hwnd;
infoPtr->flags |= TB_SHOW_TOOLTIP;
SetCapture (wndPtr->hwndSelf);
SetCapture (hwnd);
SendMessageA (infoPtr->hwndToolTip, TTM_TRACKACTIVATE,
(WPARAM)TRUE, (LPARAM)&ti);
}
......@@ -1260,38 +1267,38 @@ TRACKBAR_LButtonDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->nPos += infoPtr->nPageSize;
if (infoPtr->nPos > infoPtr->nRangeMax)
infoPtr->nPos = infoPtr->nRangeMax;
TRACKBAR_SendNotify (wndPtr, TB_PAGEUP);
TRACKBAR_SendNotify (hwnd, TB_PAGEUP);
} else {
infoPtr->nPos -= infoPtr->nPageSize; /* similar to VK_PRIOR */
if (infoPtr->nPos < infoPtr->nRangeMin)
infoPtr->nPos = infoPtr->nRangeMin;
TRACKBAR_SendNotify (wndPtr, TB_PAGEDOWN);
TRACKBAR_SendNotify (hwnd, TB_PAGEDOWN);
}
if (prevPos!=infoPtr->nPos) {
infoPtr->flags |=TB_THUMBPOSCHANGED;
TRACKBAR_QueueRefresh (wndPtr);
TRACKBAR_QueueRefresh (hwnd);
}
return 0;
}
static LRESULT
TRACKBAR_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
TRACKBAR_QueueRefresh (wndPtr);
TRACKBAR_SendNotify (wndPtr, TB_ENDTRACK);
TRACKBAR_QueueRefresh (hwnd);
TRACKBAR_SendNotify (hwnd, TB_ENDTRACK);
infoPtr->flags &= ~TB_DRAG_MODE;
if (wndPtr->dwStyle & TBS_TOOLTIPS) { /* disable tooltip */
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_TOOLTIPS) { /* disable tooltip */
TTTOOLINFOA ti;
ti.cbSize = sizeof(TTTOOLINFOA);
ti.uId = 0;
ti.hwnd = (UINT)wndPtr->hwndSelf;
ti.hwnd = (UINT)hwnd;
infoPtr->flags &= ~TB_SHOW_TOOLTIP;
ReleaseCapture ();
......@@ -1303,59 +1310,59 @@ TRACKBAR_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
static LRESULT
TRACKBAR_CaptureChanged (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_CaptureChanged (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
if (infoPtr->flags & TB_DRAGPOSVALID) {
infoPtr->nPos=infoPtr->dragPos;
TRACKBAR_QueueRefresh (wndPtr);
TRACKBAR_QueueRefresh (hwnd);
}
infoPtr->flags &= ~ TB_DRAGPOSVALID;
TRACKBAR_SendNotify (wndPtr, TB_ENDTRACK);
TRACKBAR_SendNotify (hwnd, TB_ENDTRACK);
return 0;
}
static LRESULT
TRACKBAR_Paint (WND *wndPtr, WPARAM wParam)
TRACKBAR_Paint (HWND hwnd, WPARAM wParam)
{
HDC hdc;
PAINTSTRUCT ps;
hdc = wParam==0 ? BeginPaint (wndPtr->hwndSelf, &ps) : (HDC)wParam;
TRACKBAR_Refresh (wndPtr, hdc);
hdc = wParam==0 ? BeginPaint (hwnd, &ps) : (HDC)wParam;
TRACKBAR_Refresh (hwnd, hdc);
if(!wParam)
EndPaint (wndPtr->hwndSelf, &ps);
EndPaint (hwnd, &ps);
return 0;
}
static LRESULT
TRACKBAR_SetFocus (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_SetFocus (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
HDC hdc;
TRACE (trackbar,"\n");
infoPtr->bFocus = TRUE;
hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return 0;
}
static LRESULT
TRACKBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_Size (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
TRACKBAR_CalcChannel (wndPtr, infoPtr);
TRACKBAR_AlignBuddies (wndPtr, infoPtr);
TRACKBAR_CalcChannel (hwnd, infoPtr);
TRACKBAR_AlignBuddies (hwnd, infoPtr);
return 0;
}
......@@ -1363,54 +1370,55 @@ TRACKBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static BOOL
TRACKBAR_SendNotify (WND *wndPtr, UINT code)
TRACKBAR_SendNotify (HWND hwnd, UINT code)
{
TRACE (trackbar, "%x\n",code);
if (wndPtr->dwStyle & TBS_VERT)
return (BOOL) SendMessageA (GetParent (wndPtr->hwndSelf),
WM_VSCROLL, (WPARAM)code, (LPARAM) wndPtr->hwndSelf);
return (BOOL) SendMessageA (GetParent (wndPtr->hwndSelf),
WM_HSCROLL, (WPARAM)code, (LPARAM) wndPtr->hwndSelf);
return 0;
if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_VERT)
return (BOOL) SendMessageA (GetParent (hwnd),
WM_VSCROLL, (WPARAM)code, (LPARAM)hwnd);
return (BOOL) SendMessageA (GetParent (hwnd),
WM_HSCROLL, (WPARAM)code, (LPARAM)hwnd);
}
static LRESULT
TRACKBAR_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
INT clickPlace,vertical;
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
INT clickPlace;
HDC hdc;
char buf[80];
TRACE (trackbar, "%x\n",wParam);
vertical=wndPtr->dwStyle & TBS_VERT;
if (vertical)
if (dwStyle & TBS_VERT)
clickPlace=(INT)HIWORD(lParam);
else
clickPlace=(INT)LOWORD(lParam);
if (!(infoPtr->flags & TB_DRAG_MODE)) return TRUE;
if (!(infoPtr->flags & TB_DRAG_MODE))
return TRUE;
infoPtr->dragPos=TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace, vertical);
infoPtr->dragPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace, dwStyle & TBS_VERT);
infoPtr->flags|= TB_DRAGPOSVALID;
TRACKBAR_SendNotify (wndPtr, TB_THUMBTRACK | (infoPtr->nPos>>16));
TRACKBAR_SendNotify (hwnd, TB_THUMBTRACK | (infoPtr->nPos>>16));
if (infoPtr->flags & TB_SHOW_TOOLTIP) {
POINT pt;
TTTOOLINFOA ti;
ti.cbSize = sizeof(TTTOOLINFOA);
ti.hwnd = wndPtr->hwndSelf;
ti.hwnd = hwnd;
ti.uId = 0;
ti.hinst=0;
sprintf (buf,"%d",infoPtr->nPos);
ti.lpszText = (LPSTR) buf;
GetCursorPos (&pt);
if (vertical) {
if (dwStyle & TBS_VERT) {
SendMessageA (infoPtr->hwndToolTip, TTM_TRACKPOSITION,
0, (LPARAM)MAKELPARAM(pt.x+5, pt.y+15));
} else {
......@@ -1421,18 +1429,18 @@ TRACKBAR_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
0, (LPARAM)&ti);
}
hdc = GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc = GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return TRUE;
}
static LRESULT
TRACKBAR_KeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
INT pos;
TRACE (trackbar, "%x\n",wParam);
......@@ -1445,7 +1453,7 @@ TRACKBAR_KeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->nPos -= infoPtr->nLineSize;
if (infoPtr->nPos < infoPtr->nRangeMin)
infoPtr->nPos = infoPtr->nRangeMin;
TRACKBAR_SendNotify (wndPtr, TB_LINEUP);
TRACKBAR_SendNotify (hwnd, TB_LINEUP);
break;
case VK_RIGHT:
case VK_DOWN:
......@@ -1453,44 +1461,44 @@ TRACKBAR_KeyDown (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr->nPos += infoPtr->nLineSize;
if (infoPtr->nPos > infoPtr->nRangeMax)
infoPtr->nPos = infoPtr->nRangeMax;
TRACKBAR_SendNotify (wndPtr, TB_LINEDOWN);
TRACKBAR_SendNotify (hwnd, TB_LINEDOWN);
break;
case VK_NEXT:
if (infoPtr->nPos == infoPtr->nRangeMax) return FALSE;
infoPtr->nPos += infoPtr->nPageSize;
if (infoPtr->nPos > infoPtr->nRangeMax)
infoPtr->nPos = infoPtr->nRangeMax;
TRACKBAR_SendNotify (wndPtr, TB_PAGEUP);
TRACKBAR_SendNotify (hwnd, TB_PAGEUP);
break;
case VK_PRIOR:
if (infoPtr->nPos == infoPtr->nRangeMin) return FALSE;
infoPtr->nPos -= infoPtr->nPageSize;
if (infoPtr->nPos < infoPtr->nRangeMin)
infoPtr->nPos = infoPtr->nRangeMin;
TRACKBAR_SendNotify (wndPtr, TB_PAGEDOWN);
TRACKBAR_SendNotify (hwnd, TB_PAGEDOWN);
break;
case VK_HOME:
if (infoPtr->nPos == infoPtr->nRangeMin) return FALSE;
infoPtr->nPos = infoPtr->nRangeMin;
TRACKBAR_SendNotify (wndPtr, TB_TOP);
TRACKBAR_SendNotify (hwnd, TB_TOP);
break;
case VK_END:
if (infoPtr->nPos == infoPtr->nRangeMax) return FALSE;
infoPtr->nPos = infoPtr->nRangeMax;
TRACKBAR_SendNotify (wndPtr, TB_BOTTOM);
TRACKBAR_SendNotify (hwnd, TB_BOTTOM);
break;
}
if (pos!=infoPtr->nPos) {
infoPtr->flags |=TB_THUMBPOSCHANGED;
TRACKBAR_QueueRefresh (wndPtr);
TRACKBAR_QueueRefresh (hwnd);
}
return TRUE;
}
static LRESULT
TRACKBAR_KeyUp (WND *wndPtr, WPARAM wParam)
TRACKBAR_KeyUp (HWND hwnd, WPARAM wParam)
{
switch (wParam) {
case VK_LEFT:
......@@ -1500,31 +1508,32 @@ TRACKBAR_KeyUp (WND *wndPtr, WPARAM wParam)
case VK_NEXT:
case VK_PRIOR:
case VK_HOME:
case VK_END: TRACKBAR_SendNotify (wndPtr, TB_ENDTRACK);
case VK_END:
TRACKBAR_SendNotify (hwnd, TB_ENDTRACK);
}
return TRUE;
}
static LRESULT
TRACKBAR_HandleTimer ( WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACKBAR_HandleTimer (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(wndPtr);
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
HDC hdc;
TRACE (trackbar,"timer\n");
switch (wParam) {
case TB_REFRESH_TIMER:
KillTimer (wndPtr->hwndSelf, TB_REFRESH_TIMER );
KillTimer (hwnd, TB_REFRESH_TIMER );
if (infoPtr->flags & TB_DRAGPOSVALID) {
infoPtr->nPos=infoPtr->dragPos;
infoPtr->flags |= TB_THUMBPOSCHANGED;
}
infoPtr->flags &= ~ (TB_REFRESH_TIMER_SET | TB_DRAGPOSVALID);
hdc=GetDC (wndPtr->hwndSelf);
TRACKBAR_Refresh (wndPtr, hdc);
ReleaseDC (wndPtr->hwndSelf, hdc);
hdc=GetDC (hwnd);
TRACKBAR_Refresh (hwnd, hdc);
ReleaseDC (hwnd, hdc);
return 0;
}
return 1;
......@@ -1534,125 +1543,120 @@ TRACKBAR_HandleTimer ( WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI
TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
/* TRACE (trackbar, "msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam); */
switch (uMsg)
{
case TBM_CLEARSEL:
return TRACKBAR_ClearSel (wndPtr, wParam, lParam);
return TRACKBAR_ClearSel (hwnd, wParam, lParam);
case TBM_CLEARTICS:
return TRACKBAR_ClearTics (wndPtr, wParam, lParam);
return TRACKBAR_ClearTics (hwnd, wParam, lParam);
case TBM_GETBUDDY:
return TRACKBAR_GetBuddy (wndPtr, wParam, lParam);
return TRACKBAR_GetBuddy (hwnd, wParam, lParam);
case TBM_GETCHANNELRECT:
return TRACKBAR_GetChannelRect (wndPtr, wParam, lParam);
return TRACKBAR_GetChannelRect (hwnd, wParam, lParam);
case TBM_GETLINESIZE:
return TRACKBAR_GetLineSize (wndPtr, wParam, lParam);
return TRACKBAR_GetLineSize (hwnd, wParam, lParam);
case TBM_GETNUMTICS:
return TRACKBAR_GetNumTics (wndPtr, wParam, lParam);
return TRACKBAR_GetNumTics (hwnd, wParam, lParam);
case TBM_GETPAGESIZE:
return TRACKBAR_GetPageSize (wndPtr, wParam, lParam);
return TRACKBAR_GetPageSize (hwnd, wParam, lParam);
case TBM_GETPOS:
return TRACKBAR_GetPos (wndPtr, wParam, lParam);
return TRACKBAR_GetPos (hwnd, wParam, lParam);
case TBM_GETPTICS:
return TRACKBAR_GetPTics (wndPtr);
return TRACKBAR_GetPTics (hwnd);
case TBM_GETRANGEMAX:
return TRACKBAR_GetRangeMax (wndPtr, wParam, lParam);
return TRACKBAR_GetRangeMax (hwnd, wParam, lParam);
case TBM_GETRANGEMIN:
return TRACKBAR_GetRangeMin (wndPtr, wParam, lParam);
return TRACKBAR_GetRangeMin (hwnd, wParam, lParam);
case TBM_GETSELEND:
return TRACKBAR_GetSelEnd (wndPtr, wParam, lParam);
return TRACKBAR_GetSelEnd (hwnd, wParam, lParam);
case TBM_GETSELSTART:
return TRACKBAR_GetSelStart (wndPtr, wParam, lParam);
return TRACKBAR_GetSelStart (hwnd, wParam, lParam);
case TBM_GETTHUMBLENGTH:
return TRACKBAR_GetThumbLength (wndPtr, wParam, lParam);
return TRACKBAR_GetThumbLength (hwnd, wParam, lParam);
case TBM_GETTHUMBRECT:
return TRACKBAR_GetThumbRect (wndPtr, wParam, lParam);
return TRACKBAR_GetThumbRect (hwnd, wParam, lParam);
case TBM_GETTIC:
return TRACKBAR_GetTic (wndPtr, wParam, lParam);
return TRACKBAR_GetTic (hwnd, wParam, lParam);
case TBM_GETTICPOS:
return TRACKBAR_GetTicPos (wndPtr, wParam, lParam);
return TRACKBAR_GetTicPos (hwnd, wParam, lParam);
case TBM_GETTOOLTIPS:
return TRACKBAR_GetToolTips (wndPtr, wParam, lParam);
return TRACKBAR_GetToolTips (hwnd, wParam, lParam);
/* case TBM_GETUNICODEFORMAT: */
case TBM_SETBUDDY:
return TRACKBAR_SetBuddy (wndPtr, wParam, lParam);
return TRACKBAR_SetBuddy (hwnd, wParam, lParam);
case TBM_SETLINESIZE:
return TRACKBAR_SetLineSize (wndPtr, wParam, lParam);
return TRACKBAR_SetLineSize (hwnd, wParam, lParam);
case TBM_SETPAGESIZE:
return TRACKBAR_SetPageSize (wndPtr, wParam, lParam);
return TRACKBAR_SetPageSize (hwnd, wParam, lParam);
case TBM_SETPOS:
return TRACKBAR_SetPos (wndPtr, wParam, lParam);
return TRACKBAR_SetPos (hwnd, wParam, lParam);
case TBM_SETRANGE:
return TRACKBAR_SetRange (wndPtr, wParam, lParam);
return TRACKBAR_SetRange (hwnd, wParam, lParam);
case TBM_SETRANGEMAX:
return TRACKBAR_SetRangeMax (wndPtr, wParam, lParam);
return TRACKBAR_SetRangeMax (hwnd, wParam, lParam);
case TBM_SETRANGEMIN:
return TRACKBAR_SetRangeMin (wndPtr, wParam, lParam);
return TRACKBAR_SetRangeMin (hwnd, wParam, lParam);
case TBM_SETSEL:
return TRACKBAR_SetSel (wndPtr, wParam, lParam);
return TRACKBAR_SetSel (hwnd, wParam, lParam);
case TBM_SETSELEND:
return TRACKBAR_SetSelEnd (wndPtr, wParam, lParam);
return TRACKBAR_SetSelEnd (hwnd, wParam, lParam);
case TBM_SETSELSTART:
return TRACKBAR_SetSelStart (wndPtr, wParam, lParam);
return TRACKBAR_SetSelStart (hwnd, wParam, lParam);
case TBM_SETTHUMBLENGTH:
return TRACKBAR_SetThumbLength (wndPtr, wParam, lParam);
return TRACKBAR_SetThumbLength (hwnd, wParam, lParam);
case TBM_SETTIC:
return TRACKBAR_SetTic (wndPtr, wParam, lParam);
return TRACKBAR_SetTic (hwnd, wParam, lParam);
case TBM_SETTICFREQ:
return TRACKBAR_SetTicFreq (wndPtr, wParam);
return TRACKBAR_SetTicFreq (hwnd, wParam);
case TBM_SETTIPSIDE:
return TRACKBAR_SetTipSide (wndPtr, wParam, lParam);
return TRACKBAR_SetTipSide (hwnd, wParam, lParam);
case TBM_SETTOOLTIPS:
return TRACKBAR_SetToolTips (wndPtr, wParam, lParam);
return TRACKBAR_SetToolTips (hwnd, wParam, lParam);
/* case TBM_SETUNICODEFORMAT: */
case WM_CAPTURECHANGED:
return TRACKBAR_CaptureChanged (wndPtr, wParam, lParam);
return TRACKBAR_CaptureChanged (hwnd, wParam, lParam);
case WM_CREATE:
return TRACKBAR_Create (wndPtr, wParam, lParam);
return TRACKBAR_Create (hwnd, wParam, lParam);
case WM_DESTROY:
return TRACKBAR_Destroy (wndPtr, wParam, lParam);
return TRACKBAR_Destroy (hwnd, wParam, lParam);
/* case WM_ENABLE: */
......@@ -1663,37 +1667,37 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DLGC_WANTARROWS;
case WM_KEYDOWN:
return TRACKBAR_KeyDown (wndPtr, wParam, lParam);
return TRACKBAR_KeyDown (hwnd, wParam, lParam);
case WM_KEYUP:
return TRACKBAR_KeyUp (wndPtr, wParam);
return TRACKBAR_KeyUp (hwnd, wParam);
case WM_KILLFOCUS:
return TRACKBAR_KillFocus (wndPtr, wParam, lParam);
return TRACKBAR_KillFocus (hwnd, wParam, lParam);
case WM_LBUTTONDOWN:
return TRACKBAR_LButtonDown (wndPtr, wParam, lParam);
return TRACKBAR_LButtonDown (hwnd, wParam, lParam);
case WM_LBUTTONUP:
return TRACKBAR_LButtonUp (wndPtr, wParam, lParam);
return TRACKBAR_LButtonUp (hwnd, wParam, lParam);
case WM_MOUSEMOVE:
return TRACKBAR_MouseMove (wndPtr, wParam, lParam);
return TRACKBAR_MouseMove (hwnd, wParam, lParam);
case WM_PAINT:
return TRACKBAR_Paint (wndPtr, wParam);
return TRACKBAR_Paint (hwnd, wParam);
case WM_SETFOCUS:
return TRACKBAR_SetFocus (wndPtr, wParam, lParam);
return TRACKBAR_SetFocus (hwnd, wParam, lParam);
case WM_SIZE:
return TRACKBAR_Size (wndPtr, wParam, lParam);
return TRACKBAR_Size (hwnd, wParam, lParam);
case WM_TIMER:
return TRACKBAR_HandleTimer (wndPtr, wParam, lParam);
return TRACKBAR_HandleTimer (hwnd, wParam, lParam);
case WM_WININICHANGE:
return TRACKBAR_InitializeThumb (wndPtr);
return TRACKBAR_InitializeThumb (hwnd);
default:
if (uMsg >= WM_USER)
......
......@@ -22,7 +22,7 @@ typedef struct tagIP_SUBCLASS_INFO
WNDPROC wpOrigProc[4];
HWND hwndIP[4];
IPADDRESS_INFO *infoPtr;
WND *wndPtr;
HWND hwnd;
UINT uRefCount;
} IP_SUBCLASS_INFO, *LPIP_SUBCLASS_INFO;
......
......@@ -19,6 +19,7 @@ typedef struct
INT MinVal; /* Minimum up-down value */
INT MaxVal; /* Maximum up-down value */
HWND Buddy; /* Handle to the buddy window */
CHAR szBuddyClass[40]; /* Buddy window class name */
INT Flags; /* Internal Flags FLAG_* */
} UPDOWN_INFO;
......
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