2000-12-11 00:01:33 +01:00
|
|
|
/*
|
|
|
|
* User controls definitions
|
|
|
|
*
|
|
|
|
* Copyright 2000 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-12-11 00:01:33 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_CONTROLS_H
|
|
|
|
#define __WINE_CONTROLS_H
|
|
|
|
|
|
|
|
#include "winuser.h"
|
|
|
|
|
|
|
|
/* Built-in class names (see _Undocumented_Windows_ p.418) */
|
2006-11-08 01:19:02 +01:00
|
|
|
#define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
|
|
|
|
#define DESKTOP_CLASS_ATOM MAKEINTATOM(32769) /* Desktop */
|
|
|
|
#define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
|
|
|
|
#define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
|
|
|
|
#define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
|
2000-12-11 00:01:33 +01:00
|
|
|
|
2009-12-17 12:56:50 +01:00
|
|
|
enum builtin_winprocs
|
|
|
|
{
|
2009-12-18 12:36:26 +01:00
|
|
|
/* dual A/W procs */
|
2009-12-17 12:56:50 +01:00
|
|
|
WINPROC_BUTTON = 0,
|
2009-12-17 12:57:22 +01:00
|
|
|
WINPROC_COMBO,
|
2009-12-17 13:01:42 +01:00
|
|
|
WINPROC_DEFWND,
|
2009-12-17 13:00:23 +01:00
|
|
|
WINPROC_DIALOG,
|
2009-12-17 12:57:40 +01:00
|
|
|
WINPROC_EDIT,
|
2009-12-17 12:58:45 +01:00
|
|
|
WINPROC_LISTBOX,
|
2009-12-17 13:01:11 +01:00
|
|
|
WINPROC_MDICLIENT,
|
2009-12-17 12:59:40 +01:00
|
|
|
WINPROC_SCROLLBAR,
|
2009-12-17 13:00:04 +01:00
|
|
|
WINPROC_STATIC,
|
2009-12-18 12:36:26 +01:00
|
|
|
/* unicode-only procs */
|
|
|
|
WINPROC_DESKTOP,
|
2009-12-18 12:37:05 +01:00
|
|
|
WINPROC_ICONTITLE,
|
2009-12-18 12:37:58 +01:00
|
|
|
WINPROC_MENU,
|
2009-12-18 12:38:22 +01:00
|
|
|
WINPROC_MESSAGE,
|
2009-12-18 12:36:26 +01:00
|
|
|
NB_BUILTIN_WINPROCS,
|
|
|
|
NB_BUILTIN_AW_WINPROCS = WINPROC_DESKTOP
|
2009-12-17 12:56:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#define WINPROC_HANDLE (~0u >> 16)
|
|
|
|
#define BUILTIN_WINPROC(index) ((WNDPROC)(ULONG_PTR)((index) | (WINPROC_HANDLE << 16)))
|
|
|
|
|
2000-12-11 00:01:33 +01:00
|
|
|
/* Built-in class descriptor */
|
|
|
|
struct builtin_class_descr
|
|
|
|
{
|
2007-11-01 12:55:00 +01:00
|
|
|
LPCWSTR name; /* class name */
|
2003-09-10 05:56:47 +02:00
|
|
|
UINT style; /* class style */
|
2009-12-18 12:39:13 +01:00
|
|
|
enum builtin_winprocs proc;
|
2003-09-10 05:56:47 +02:00
|
|
|
INT extra; /* window extra bytes */
|
|
|
|
ULONG_PTR cursor; /* cursor id */
|
|
|
|
HBRUSH brush; /* brush or system color */
|
2000-12-11 00:01:33 +01:00
|
|
|
};
|
|
|
|
|
2007-11-07 18:05:49 +01:00
|
|
|
extern const struct builtin_class_descr BUTTON_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
extern const struct builtin_class_descr COMBO_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
extern const struct builtin_class_descr COMBOLBOX_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
extern const struct builtin_class_descr DIALOG_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
extern const struct builtin_class_descr DESKTOP_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
extern const struct builtin_class_descr EDIT_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
extern const struct builtin_class_descr ICONTITLE_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
extern const struct builtin_class_descr LISTBOX_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
extern const struct builtin_class_descr MDICLIENT_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
extern const struct builtin_class_descr MENU_builtin_class DECLSPEC_HIDDEN;
|
2008-06-25 14:19:34 +02:00
|
|
|
extern const struct builtin_class_descr MESSAGE_builtin_class DECLSPEC_HIDDEN;
|
2007-11-07 18:05:49 +01:00
|
|
|
extern const struct builtin_class_descr SCROLL_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
extern const struct builtin_class_descr STATIC_builtin_class DECLSPEC_HIDDEN;
|
|
|
|
|
2009-12-18 12:36:26 +01:00
|
|
|
extern LRESULT WINAPI DesktopWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
|
2009-12-18 12:37:05 +01:00
|
|
|
extern LRESULT WINAPI IconTitleWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
|
2009-12-18 12:37:58 +01:00
|
|
|
extern LRESULT WINAPI PopupMenuWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
|
2009-12-18 12:38:22 +01:00
|
|
|
extern LRESULT WINAPI MessageWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
|
2009-12-18 12:36:26 +01:00
|
|
|
|
2009-12-15 13:16:50 +01:00
|
|
|
/* Wow handlers */
|
|
|
|
|
2009-12-23 20:01:37 +01:00
|
|
|
/* the structures must match the corresponding ones in user.exe */
|
2009-12-15 13:16:50 +01:00
|
|
|
struct wow_handlers16
|
|
|
|
{
|
|
|
|
LRESULT (*button_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-15 13:17:15 +01:00
|
|
|
LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-15 13:19:03 +01:00
|
|
|
LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-15 13:18:28 +01:00
|
|
|
LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-16 13:22:08 +01:00
|
|
|
LRESULT (*mdiclient_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-15 13:19:30 +01:00
|
|
|
LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-15 13:19:53 +01:00
|
|
|
LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-24 12:02:10 +01:00
|
|
|
DWORD (*wait_message)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
|
2009-12-23 20:19:43 +01:00
|
|
|
HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL);
|
2009-12-15 20:01:38 +01:00
|
|
|
LRESULT (*call_window_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*);
|
|
|
|
LRESULT (*call_dialog_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*);
|
2010-02-08 17:38:05 +01:00
|
|
|
void (*free_icon_param)(ULONG_PTR);
|
2009-12-15 13:16:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wow_handlers32
|
|
|
|
{
|
|
|
|
LRESULT (*button_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-15 13:17:15 +01:00
|
|
|
LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-15 13:19:03 +01:00
|
|
|
LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-15 13:18:28 +01:00
|
|
|
LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-16 13:22:08 +01:00
|
|
|
LRESULT (*mdiclient_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-15 13:19:30 +01:00
|
|
|
LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-15 13:19:53 +01:00
|
|
|
LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
|
2009-12-24 12:02:10 +01:00
|
|
|
DWORD (*wait_message)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
|
2009-12-23 20:19:43 +01:00
|
|
|
HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL);
|
2009-12-22 18:09:30 +01:00
|
|
|
HWND (*get_win_handle)(HWND);
|
2009-12-18 12:41:59 +01:00
|
|
|
WNDPROC (*alloc_winproc)(WNDPROC,BOOL);
|
2009-12-22 17:57:42 +01:00
|
|
|
struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL);
|
|
|
|
INT (*dialog_box_loop)(HWND,HWND);
|
2010-02-08 17:38:05 +01:00
|
|
|
ULONG_PTR (*get_icon_param)(HICON);
|
|
|
|
ULONG_PTR (*set_icon_param)(HICON,ULONG_PTR);
|
2009-12-15 13:16:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
extern LRESULT ButtonWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
|
2009-12-15 13:17:15 +01:00
|
|
|
extern LRESULT ComboWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
|
2009-12-15 13:19:03 +01:00
|
|
|
extern LRESULT EditWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
|
2009-12-15 13:18:28 +01:00
|
|
|
extern LRESULT ListBoxWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
|
2009-12-16 13:22:08 +01:00
|
|
|
extern LRESULT MDIClientWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
|
2009-12-15 13:19:30 +01:00
|
|
|
extern LRESULT ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
|
2009-12-15 13:19:53 +01:00
|
|
|
extern LRESULT StaticWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
|
2009-12-15 13:16:50 +01:00
|
|
|
|
2010-02-08 17:38:05 +01:00
|
|
|
extern ULONG_PTR get_icon_param( HICON handle ) DECLSPEC_HIDDEN;
|
|
|
|
extern ULONG_PTR set_icon_param( HICON handle, ULONG_PTR param ) DECLSPEC_HIDDEN;
|
|
|
|
|
2006-05-26 14:54:54 +02:00
|
|
|
/* Class functions */
|
|
|
|
struct tagCLASS; /* opaque structure */
|
|
|
|
struct tagWND;
|
2007-11-07 18:05:49 +01:00
|
|
|
extern ATOM get_int_atom_value( LPCWSTR name ) DECLSPEC_HIDDEN;
|
|
|
|
extern void CLASS_RegisterBuiltinClasses(void) DECLSPEC_HIDDEN;
|
2008-02-25 15:55:17 +01:00
|
|
|
extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN;
|
2008-02-25 15:59:19 +01:00
|
|
|
extern struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN;
|
|
|
|
extern struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN;
|
2000-12-11 00:01:33 +01:00
|
|
|
|
2004-12-08 19:06:14 +01:00
|
|
|
/* defwnd proc */
|
2007-11-07 18:05:49 +01:00
|
|
|
extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
|
2004-12-08 19:06:14 +01:00
|
|
|
|
2000-12-11 00:01:33 +01:00
|
|
|
/* desktop */
|
2007-11-07 18:05:49 +01:00
|
|
|
extern BOOL DESKTOP_SetPattern( LPCWSTR pattern ) DECLSPEC_HIDDEN;
|
2000-12-11 00:01:33 +01:00
|
|
|
|
|
|
|
/* icon title */
|
2007-11-07 18:05:49 +01:00
|
|
|
extern HWND ICONTITLE_Create( HWND hwnd ) DECLSPEC_HIDDEN;
|
2000-12-11 00:01:33 +01:00
|
|
|
|
|
|
|
/* menu controls */
|
2007-11-07 18:05:49 +01:00
|
|
|
extern HWND MENU_IsMenuActive(void) DECLSPEC_HIDDEN;
|
2000-12-11 00:01:33 +01:00
|
|
|
extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
|
2007-11-07 18:05:49 +01:00
|
|
|
INT orgX, INT orgY ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL MENU_SetMenu(HWND, HMENU) DECLSPEC_HIDDEN;
|
|
|
|
extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt ) DECLSPEC_HIDDEN;
|
|
|
|
extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, WCHAR wChar ) DECLSPEC_HIDDEN;
|
2000-12-11 00:01:33 +01:00
|
|
|
extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
|
2007-11-07 18:05:49 +01:00
|
|
|
HWND hwnd, BOOL suppress_draw ) DECLSPEC_HIDDEN;
|
2009-04-02 11:37:11 +02:00
|
|
|
extern void MENU_EndMenu(HWND) DECLSPEC_HIDDEN;
|
2000-12-11 00:01:33 +01:00
|
|
|
|
2005-01-17 21:27:11 +01:00
|
|
|
/* nonclient area */
|
2007-11-07 18:05:49 +01:00
|
|
|
extern LRESULT NC_HandleNCPaint( HWND hwnd , HRGN clip) DECLSPEC_HIDDEN;
|
2008-03-18 13:06:59 +01:00
|
|
|
extern LRESULT NC_HandleNCActivate( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
|
2007-11-07 18:05:49 +01:00
|
|
|
extern LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) DECLSPEC_HIDDEN;
|
|
|
|
extern LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
|
|
|
|
extern LRESULT NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
|
|
|
|
extern LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN;
|
|
|
|
extern LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
|
|
|
|
extern LRESULT NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ) DECLSPEC_HIDDEN;
|
|
|
|
extern void NC_GetSysPopupPos( HWND hwnd, RECT* rect ) DECLSPEC_HIDDEN;
|
2005-01-17 21:27:11 +01:00
|
|
|
|
2000-12-11 00:01:33 +01:00
|
|
|
/* scrollbar */
|
2007-11-07 18:05:49 +01:00
|
|
|
extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior ) DECLSPEC_HIDDEN;
|
|
|
|
extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt ) DECLSPEC_HIDDEN;
|
2001-08-11 00:51:42 +02:00
|
|
|
extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
|
2007-11-07 18:05:49 +01:00
|
|
|
int hMin, int hMax, int hPos ) DECLSPEC_HIDDEN;
|
2000-12-11 00:01:33 +01:00
|
|
|
|
|
|
|
/* combo box */
|
|
|
|
|
|
|
|
#define ID_CB_LISTBOX 1000
|
|
|
|
#define ID_CB_EDIT 1001
|
|
|
|
|
|
|
|
/* internal flags */
|
|
|
|
#define CBF_DROPPED 0x0001
|
|
|
|
#define CBF_BUTTONDOWN 0x0002
|
|
|
|
#define CBF_NOROLLUP 0x0004
|
|
|
|
#define CBF_MEASUREITEM 0x0008
|
|
|
|
#define CBF_FOCUSED 0x0010
|
|
|
|
#define CBF_CAPTURE 0x0020
|
|
|
|
#define CBF_EDIT 0x0040
|
|
|
|
#define CBF_NORESIZE 0x0080
|
|
|
|
#define CBF_NOTIFY 0x0100
|
|
|
|
#define CBF_NOREDRAW 0x0200
|
|
|
|
#define CBF_SELCHANGE 0x0400
|
|
|
|
#define CBF_NOEDITNOTIFY 0x1000
|
|
|
|
#define CBF_NOLBSELECT 0x2000 /* do not change current selection */
|
2010-01-24 21:56:11 +01:00
|
|
|
#define CBF_BEENFOCUSED 0x4000 /* has it ever had focus */
|
2000-12-11 00:01:33 +01:00
|
|
|
#define CBF_EUI 0x8000
|
|
|
|
|
|
|
|
/* combo state struct */
|
|
|
|
typedef struct
|
|
|
|
{
|
2001-08-11 00:51:42 +02:00
|
|
|
HWND self;
|
2000-12-11 00:01:33 +01:00
|
|
|
HWND owner;
|
|
|
|
UINT dwStyle;
|
|
|
|
HWND hWndEdit;
|
|
|
|
HWND hWndLBox;
|
|
|
|
UINT wState;
|
|
|
|
HFONT hFont;
|
|
|
|
RECT textRect;
|
|
|
|
RECT buttonRect;
|
|
|
|
RECT droppedRect;
|
|
|
|
INT droppedIndex;
|
|
|
|
INT fixedOwnerDrawHeight;
|
|
|
|
INT droppedWidth; /* last two are not used unless set */
|
|
|
|
INT editHeight; /* explicitly */
|
|
|
|
} HEADCOMBO,*LPHEADCOMBO;
|
|
|
|
|
2007-11-07 18:05:49 +01:00
|
|
|
extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL ) DECLSPEC_HIDDEN;
|
2000-12-11 00:01:33 +01:00
|
|
|
|
2009-12-23 20:01:37 +01:00
|
|
|
/* Dialog info structure (note: shared with user.exe) */
|
2008-12-01 23:04:09 +01:00
|
|
|
typedef struct tagDIALOGINFO
|
2000-12-11 00:01:33 +01:00
|
|
|
{
|
2001-09-19 22:37:04 +02:00
|
|
|
HWND hwndFocus; /* Current control with focus */
|
|
|
|
HFONT hUserFont; /* Dialog font */
|
|
|
|
HMENU hMenu; /* Dialog menu */
|
|
|
|
UINT xBaseUnit; /* Dialog units (depends on the font) */
|
|
|
|
UINT yBaseUnit;
|
|
|
|
INT idResult; /* EndDialog() result / default pushbutton ID */
|
|
|
|
UINT flags; /* EndDialog() called for this dialog */
|
2000-12-11 00:01:33 +01:00
|
|
|
} DIALOGINFO;
|
|
|
|
|
|
|
|
#define DF_END 0x0001
|
|
|
|
#define DF_OWNERENABLED 0x0002
|
|
|
|
|
2007-11-07 18:05:49 +01:00
|
|
|
extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN;
|
|
|
|
extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN;
|
2000-12-11 00:01:33 +01:00
|
|
|
|
2010-09-02 11:35:14 +02:00
|
|
|
HRGN set_control_clipping( HDC hdc, const RECT *rect ) DECLSPEC_HIDDEN;
|
|
|
|
|
2000-12-11 00:01:33 +01:00
|
|
|
#endif /* __WINE_CONTROLS_H */
|