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)
......
/*
* 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: */
......
/*
* 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",
......
......@@ -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