From dbb9546d9db2ce364f0bff53a38ff78bca3ac013 Mon Sep 17 00:00:00 2001 From: Boudewijn Dekker Date: Fri, 20 Aug 1999 10:12:53 +0000 Subject: [PATCH] Small additions, not yet finished svn path=/trunk/; revision=619 --- reactos/include/user32/button.h | 34 ++++++++ reactos/include/user32/class.h | 1 + reactos/include/user32/combo.h | 74 +++++++++++++++++ reactos/include/user32/dce.h | 2 + reactos/include/user32/defwnd.h | 8 ++ reactos/include/user32/dialog.h | 131 ++++++++++++++++++++++++++++++ reactos/include/user32/heapdup.h | 3 +- reactos/include/user32/hook.h | 3 + reactos/include/user32/mdi.h | 45 ++++++++++ reactos/include/user32/menu.h | 6 -- reactos/include/user32/msg.h | 12 ++- reactos/include/user32/paint.h | 5 ++ reactos/include/user32/scroll.h | 9 +- reactos/include/user32/static.h | 30 +++++++ reactos/include/user32/syscolor.h | 11 +++ reactos/include/user32/widgets.h | 63 ++++++++++++++ reactos/include/user32/win.h | 32 +------- 17 files changed, 427 insertions(+), 42 deletions(-) create mode 100644 reactos/include/user32/button.h create mode 100644 reactos/include/user32/combo.h create mode 100644 reactos/include/user32/defwnd.h create mode 100644 reactos/include/user32/dialog.h create mode 100644 reactos/include/user32/mdi.h create mode 100644 reactos/include/user32/static.h create mode 100644 reactos/include/user32/syscolor.h create mode 100644 reactos/include/user32/widgets.h diff --git a/reactos/include/user32/button.h b/reactos/include/user32/button.h new file mode 100644 index 00000000000..d56697937ec --- /dev/null +++ b/reactos/include/user32/button.h @@ -0,0 +1,34 @@ +/* + * Button-class extra info + * + * Copyright 1994 Alexandre Julliard + */ + +#ifndef __WINE_BUTTON_H +#define __WINE_BUTTON_H + +#include + + /* Extra info for BUTTON windows */ + /* Note: under MS-Windows, state is a BYTE and this structure is */ + /* only 3 bytes long. I don't think there are programs out there */ + /* broken enough to rely on this :-) */ +typedef struct +{ + WORD state; /* Current state */ + HFONT hFont; /* Button font (or 0 for system font) */ +} BUTTONINFO; + + /* Button state values */ +#define BUTTON_UNCHECKED 0x00 +#define BUTTON_CHECKED 0x01 +#define BUTTON_3STATE 0x02 +#define BUTTON_HIGHLIGHTED 0x04 +#define BUTTON_HASFOCUS 0x08 + +#define BUTTON_STATE(hwnd) ((WIN_FindWndPtr(hwnd))->wExtra[0]) + +LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg, + WPARAM wParam, LPARAM lParam ); + +#endif /* __WINE_BUTTON_H */ diff --git a/reactos/include/user32/class.h b/reactos/include/user32/class.h index 8f3f6ad36cf..598f5efb230 100644 --- a/reactos/include/user32/class.h +++ b/reactos/include/user32/class.h @@ -18,6 +18,7 @@ + typedef struct tagCLASS { struct tagCLASS *next; /* Next class */ diff --git a/reactos/include/user32/combo.h b/reactos/include/user32/combo.h new file mode 100644 index 00000000000..04e31297ec2 --- /dev/null +++ b/reactos/include/user32/combo.h @@ -0,0 +1,74 @@ +/* + * Combo box definitions + */ + +#ifndef __WINE_COMBO_H +#define __WINE_COMBO_H + +#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_EUI 0x8000 + + +#define LB_CARETON 0x01a3 +#define LB_CARETOFF 0x01a4 + + +/* Combo state struct */ + +typedef struct +{ + WND* self; + HWND owner; + UINT dwStyle; + HWND hWndEdit; + HWND hWndLBox; + UINT wState; + HFONT hFont; + RECT RectCombo; + RECT RectEdit; + RECT RectButton; + INT droppedWidth; /* last two are not used unless set */ + INT editHeight; /* explicitly */ +} HEADCOMBO,*LPHEADCOMBO; + +typedef DELETEITEMSTRUCT* LPDELETEITEMSTRUCT; + +typedef COMPAREITEMSTRUCT* LPCOMPAREITEMSTRUCT; + +/* Combo box message return values */ +#define CB_OKAY 0 +#define CB_ERR (-1) +#define CB_ERRSPACE (-2) + + +/* + * Note, that CBS_DROPDOWNLIST style is actually (CBS_SIMPLE | CBS_DROPDOWN)! + */ + +#define CB_GETTYPE( lphc ) ((lphc)->dwStyle & (CBS_DROPDOWNLIST)) +#define CB_DISABLED( lphc ) ((lphc)->self->dwStyle & WS_DISABLED) +#define CB_OWNERDRAWN( lphc ) ((lphc)->dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) +#define CB_HASSTRINGS( lphc ) ((lphc)->dwStyle & CBS_HASSTRINGS) +#define CB_HWND( lphc ) ((lphc)->self->hwndSelf) + +WINBOOL COMBO_FlipListbox( LPHEADCOMBO, WINBOOL ); +HWND COMBO_GetLBWindow( WND* ); +LRESULT COMBO_Directory( LPHEADCOMBO, UINT, LPSTR, WINBOOL ); + +#endif /* __WINE_COMBO_H */ + diff --git a/reactos/include/user32/dce.h b/reactos/include/user32/dce.h index 417ada8d20d..32e51eec248 100644 --- a/reactos/include/user32/dce.h +++ b/reactos/include/user32/dce.h @@ -27,6 +27,8 @@ struct tagWND; #define DCX_KEEPCLIPRGN 0x00040000 #define DCX_NOCLIPCHILDREN 0x00080000 +#define DCX_USESTYLE 0x00010000 + typedef enum { DCE_CACHE_DC, /* This is a cached DC (allocated by USER) */ diff --git a/reactos/include/user32/defwnd.h b/reactos/include/user32/defwnd.h new file mode 100644 index 00000000000..9d5ecfaa087 --- /dev/null +++ b/reactos/include/user32/defwnd.h @@ -0,0 +1,8 @@ +#ifndef __WINE_DEFWND_H +#define __WINE_DEFWND_H + +void DEFWND_SetText( WND *wndPtr, const void *text ); +void DEFWND_SetTextA( WND *wndPtr, LPCSTR text ); +void DEFWND_SetTextW( WND *wndPtr, LPCWSTR text ); + +#endif \ No newline at end of file diff --git a/reactos/include/user32/dialog.h b/reactos/include/user32/dialog.h new file mode 100644 index 00000000000..490f191c6fc --- /dev/null +++ b/reactos/include/user32/dialog.h @@ -0,0 +1,131 @@ +#ifndef __WINE_DIALOG_H +#define __WINE_DIALOG_H + +#include +#include + + /* Dialog info structure. + * This structure is stored into the window extra bytes (cbWndExtra). + * sizeof(DIALOGINFO) must be <= DLGWINDOWEXTRA (=30). + */ + + +typedef struct +{ + INT msgResult; /* +00 Last message result */ + DLGPROC dlgProc; /* +04 Dialog procedure */ + LONG userInfo; /* +08 User information (for DWL_USER) */ + + /* implementation-dependent part */ + + 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 */ + HGLOBAL hDialogHeap; +} DIALOGINFO; + + + /* Dialog control information */ +typedef struct +{ + DWORD style; + DWORD exStyle; + DWORD helpId; + INT x; + INT y; + INT cx; + INT cy; + UINT id; + LPCSTR className; + LPCSTR windowName; + LPVOID data; +} DLG_CONTROL_INFO; + + /* Dialog template */ +typedef struct +{ + DWORD style; + DWORD exStyle; + DWORD helpId; + UINT nbItems; + INT x; + INT y; + INT cx; + INT cy; + LPCSTR menuName; + LPCSTR className; + LPCSTR caption; + WORD pointSize; + WORD weight; + WINBOOL italic; + LPCSTR faceName; + WINBOOL dialogEx; +} DLG_TEMPLATE; + + +typedef struct { + WORD dlgVer; + WORD signature; + DWORD helpID; + DWORD exStyle; + DWORD style; + WORD cDlgItems; + short x; + short y; + short cx; + short cy; + void *menu; + void *windowClass; + WCHAR title[0]; + short pointsize; + short weight; + short bItalic; + WCHAR font[0]; +} DLGTEMPLATEEX, *LPDLGTEMPLATEEX, *LPCDLGTEMPLATEEX; + +typedef struct { + DWORD helpID; + DWORD exStyle; + DWORD style; + short x; + short y; + short cx; + short cy; + WORD id; + void *windowClass; + void *title; + WORD extraCount; +} DLGITEMTEMPLATEEX, *LPDLGITEMTEMPLATEEX, *LPCDLGITEMTEMPLATEEX; + + + +typedef const DLGITEMTEMPLATE * LPCDLGITEMTEMPLATE; + + /* Dialog base units */ +extern WORD xBaseUnit, yBaseUnit; + +#define DF_END 0x0001 +#define DF_ENDING 0x0002 + +HWND DIALOG_CreateIndirect( HINSTANCE hInst, void *dlgTemplate, HWND owner, + DLGPROC dlgProc, LPARAM param, + WINBOOL bUnicode ); + +WINBOOL DIALOG_IsDialogMessage( HWND hwnd, HWND hwndDlg, + UINT message, WPARAM wParam, + LPARAM lParam, WINBOOL *translate, + WINBOOL *dispatch, INT dlgCode ); + + +WINBOOL DIALOG_Init(void); + +INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ); + +#endif /* __WINE_DIALOG_H */ + + + diff --git a/reactos/include/user32/heapdup.h b/reactos/include/user32/heapdup.h index d7e77a1073c..0f793656148 100644 --- a/reactos/include/user32/heapdup.h +++ b/reactos/include/user32/heapdup.h @@ -8,4 +8,5 @@ int lpstrncpyW( LPWSTR ptr1,LPWSTR ptr2, int nMaxCount); LPVOID HEAP_strdupAtoW(HANDLE hHeap,DWORD dwFlags, LPCSTR lpszAsciiString ); LPVOID HEAP_strdupWtoA(HANDLE hHeap,DWORD dwFlags, LPCWSTR lpszUnicodeString ); LPSTR HEAP_strdupA(HANDLE hHeap,DWORD dwFlags, LPCSTR ptr); -LPWSTR HEAP_strdupW(HANDLE hHeap,DWORD dwFlags, LPCWSTR ptr); \ No newline at end of file +LPWSTR HEAP_strdupW(HANDLE hHeap,DWORD dwFlags, LPCWSTR ptr); +int HEAP_memset( void *d,int c ,int count); \ No newline at end of file diff --git a/reactos/include/user32/hook.h b/reactos/include/user32/hook.h index a84f7645cc8..15dba1a2453 100644 --- a/reactos/include/user32/hook.h +++ b/reactos/include/user32/hook.h @@ -51,6 +51,9 @@ WINBOOL HOOK_RemoveHook( HANDLE hook ); WINBOOL HOOK_IsHooked( INT id ); +LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wParam, + LPARAM lParam ,WINBOOL bUnicode); + LRESULT HOOK_CallHooksA( INT id, INT code, WPARAM wParam, LPARAM lParam ); LRESULT HOOK_CallHooksW( INT id, INT code, WPARAM wParam, diff --git a/reactos/include/user32/mdi.h b/reactos/include/user32/mdi.h new file mode 100644 index 00000000000..33123485a4f --- /dev/null +++ b/reactos/include/user32/mdi.h @@ -0,0 +1,45 @@ +/* MDI.H + * + * Copyright 1994, Bob Amstadt + * 1995 Alex Korobka + * + * MDI structure definitions. + */ + +#ifndef __WINE_MDI_H +#define __WINE_MDI_H + +#include + +#define MDI_MAXLISTLENGTH 0x40 +#define MDI_MAXTITLELENGTH 0xA1 + +#define MDI_NOFRAMEREPAINT 0 +#define MDI_REPAINTFRAMENOW 1 +#define MDI_REPAINTFRAME 2 + +#define WM_MDICALCCHILDSCROLL 0x10AC /* this is exactly what Windows uses */ + +LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, + WPARAM wParam, LPARAM lParam ); + +typedef struct +{ + UINT nActiveChildren; + HWND hwndChildMaximized; + HWND hwndActiveChild; + HMENU hWindowMenu; + UINT idFirstChild; + LPSTR frameTitle; + UINT nTotalCreated; + UINT mdiFlags; + UINT sbRecalc; /* SB_xxx flags for scrollbar fixup */ + HWND self; +} MDICLIENTINFO; + +extern HWND MDI_CreateMDIWindowA(LPCSTR,LPCSTR,DWORD,INT,INT, + INT,INT,HWND,HINSTANCE,LPARAM); +extern HWND MDI_CreateMDIWindowW(LPCWSTR,LPCWSTR,DWORD,INT,INT, + INT,INT,HWND,HINSTANCE,LPARAM); +#endif /* __WINE_MDI_H */ + diff --git a/reactos/include/user32/menu.h b/reactos/include/user32/menu.h index 0f42ba075ce..46d5f3d7b27 100644 --- a/reactos/include/user32/menu.h +++ b/reactos/include/user32/menu.h @@ -172,11 +172,5 @@ void MENU_FreeItemData( MENUITEM* item ); HMENU MENU_CopySysPopup(void); -// addition to win32 - - -HPEN STDCALL GetSysColorPen(INT); - - #endif /* __WINE_MENU_H */ diff --git a/reactos/include/user32/msg.h b/reactos/include/user32/msg.h index 1b2ac1140ee..c1d507da60d 100644 --- a/reactos/include/user32/msg.h +++ b/reactos/include/user32/msg.h @@ -12,7 +12,7 @@ #include #include #include -//#include +#include typedef struct { @@ -52,10 +52,16 @@ WINBOOL MSG_PeekMessage( LPMSG msg, HWND hwnd, WORD first, WORD last, void MSG_CallWndProcHook( LPMSG pmsg, WINBOOL bUnicode ); -LRESULT MSG_SendMessage( HQUEUE hDestQueue, HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam, WORD flags ); +LRESULT MSG_SendMessage(WND *Wnd, UINT msg, + WPARAM wParam, LPARAM lParam); +LRESULT MSG_SendMessageInterTask( HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam, WINBOOL bUnicode); + +WINBOOL MSG_DoTranslateMessage( UINT message, HWND hwnd, + WPARAM wParam, LPARAM lParam ); + void joySendMessages(void); diff --git a/reactos/include/user32/paint.h b/reactos/include/user32/paint.h index 7b11faf2a67..dea9b120530 100644 --- a/reactos/include/user32/paint.h +++ b/reactos/include/user32/paint.h @@ -20,3 +20,8 @@ WINBOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate, HRGN hrgnUpdate, UINT flags, UINT control ); + +HBRUSH PAINT_GetControlBrush( HWND hParent, HWND hWnd, HDC hDC, UINT ctlType ); + +HBRUSH GetControlBrush( HWND hwnd, HDC hdc, UINT ctlType ); + diff --git a/reactos/include/user32/scroll.h b/reactos/include/user32/scroll.h index 665c587da42..2dd0638b735 100644 --- a/reactos/include/user32/scroll.h +++ b/reactos/include/user32/scroll.h @@ -8,7 +8,7 @@ #ifndef __WINE_SCROLL_H #define __WINE_SCROLL_H -#include "windows.h" +#include typedef struct { @@ -19,6 +19,12 @@ typedef struct UINT flags; /* EnableScrollBar flags */ } SCROLLBAR_INFO; +/* GetScrollInfo() flags */ + +#define SIF_TRACKPOS 0x0010 +//#define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS) + + LRESULT STDCALL ScrollBarWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, @@ -26,6 +32,7 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt ); +WINBOOL SCROLL_FixCaret(HWND hWnd, LPRECT lprc, UINT flags); //#define WM_SYSTIMER (0x118) diff --git a/reactos/include/user32/static.h b/reactos/include/user32/static.h new file mode 100644 index 00000000000..a726ffb3c96 --- /dev/null +++ b/reactos/include/user32/static.h @@ -0,0 +1,30 @@ +/* + * Static-class extra info + * + * Copyright 1994 Alexandre Julliard + */ + +#ifndef __WINE_STATIC_H +#define __WINE_STATIC_H + +#include +#include + + /* Extra info for STATIC windows */ +typedef struct +{ + HFONT hFont; /* Control font (or 0 for system font) */ + WORD dummy; /* Don't know what MS-Windows puts in there */ + HICON hIcon; /* Icon handle for SS_ICON controls */ +} STATICINFO; + +HICON STATIC_LoadIcon(WND *wndPtr,const void *name ); +HICON STATIC_SetIcon( WND *wndPtr, HICON hicon ); + +HBITMAP STATIC_LoadBitmap(WND *wndPtr,const void *name ); +HICON STATIC_SetBitmap( WND *wndPtr, HICON hicon ); + +LRESULT WINAPI StaticWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, + LPARAM lParam ); + +#endif /* __WINE_STATIC_H */ diff --git a/reactos/include/user32/syscolor.h b/reactos/include/user32/syscolor.h new file mode 100644 index 00000000000..434b016893b --- /dev/null +++ b/reactos/include/user32/syscolor.h @@ -0,0 +1,11 @@ + +#ifndef __SYSCOLOR_H +#define __SYSCOLOR_H + +#define COLOR_3DHIGHLIGHT COLOR_BTNHIGHLIGHT + +void SYSCOLOR_SetColor( int index, COLORREF color ); +void SYSCOLOR_Init(void); +HPEN GetSysColorPen( INT index ); + +#endif \ No newline at end of file diff --git a/reactos/include/user32/widgets.h b/reactos/include/user32/widgets.h new file mode 100644 index 00000000000..05d5b13c594 --- /dev/null +++ b/reactos/include/user32/widgets.h @@ -0,0 +1,63 @@ +#ifndef __WINE_WIDGETS_H +#define __WINE_WIDGETS_H + +#include + +#define WM_CTLCOLOR 0x0019 + + + + +#define POPUPMENU_CLASS_NAME L"PopupMenu" +#define DESKTOP_CLASS_NAME L"Desktop" +#define DIALOG_CLASS_NAMEW L"DialogW" +#define DIALOG_CLASS_NAMEA L"DialogA" +#define DIALOG_CLASS_NAME_A "DialogA" +#define WINSWITCH_CLASS_NAME L"WinSwitch" +#define ICONTITLE_CLASS_NAME L"IconTitle" +#define SCROLLBAR_CLASS_NAME L"ScrollBar" +#define BUTTON_CLASS_NAME L"Button" +#define EDIT_CLASS_NAME L"Edit" +#define STATIC_CLASS_NAME L"Static" +#define COMBOLBOX_CLASS_NAME L"ComboLBox" +#define COMBOBOX_CLASS_NAME L"ComboBox" +#define LISTBOX_CLASS_NAME L"ListBox" + +typedef enum +{ + BIC_BUTTON, + BIC_EDIT, + BIC_LISTBOX, + BIC_COMBO, + BIC_COMBOLB, +// BIC_POPUPMENU, + BIC_STATIC, + BIC_SCROLL, +// BIC_MDICLIENT, +// BIC_DESKTOP, + BIC_DIALOG, + BIC_ICONTITLE, + BIC_NB_CLASSES +} BUILTIN_CLASS; + + +/* Window procedures */ + +LRESULT STDCALL EditWndProc( HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam ); +LRESULT STDCALL ComboWndProc( HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam ); +LRESULT STDCALL ComboLBWndProc( HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam ); +LRESULT STDCALL ListBoxWndProc( HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam ); +LRESULT STDCALL PopupMenuWndProc( HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam ); +LRESULT STDCALL IconTitleWndProc( HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam ); +LRESULT WINAPI StaticWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, + LPARAM lParam ); + +WINBOOL WIDGETS_IsControl( WND* pWnd, BUILTIN_CLASS cls ); + +#endif \ No newline at end of file diff --git a/reactos/include/user32/win.h b/reactos/include/user32/win.h index 41c7f9e5c82..fb3d29bef61 100644 --- a/reactos/include/user32/win.h +++ b/reactos/include/user32/win.h @@ -20,37 +20,7 @@ typedef HANDLE HQUEUE; #define WND_MAGIC 0x444e4957 /* 'WIND' */ - /* Built-in class names (see _Undocumented_Windows_ p.418) */ -#define POPUPMENU_CLASS_NAME "#32768" /* PopupMenu */ -#define DESKTOP_CLASS_NAME "#32769" /* Desktop */ -#define DIALOG_CLASS_NAME "#32770" /* Dialog */ -#define WINSWITCH_CLASS_NAME "#32771" /* WinSwitch */ -#define ICONTITLE_CLASS_NAME "#32772" /* IconTitle */ - -#define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */ -#define DESKTOP_CLASS_ATOM ((ATOM)32769) /* Desktop */ -#define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */ -#define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */ -#define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */ - -/* Built-in 32-bit classes */ -typedef enum -{ - BIC32_BUTTON, - BIC32_EDIT, - BIC32_LISTBOX, - BIC32_COMBO, - BIC32_COMBOLB, - BIC32_POPUPMENU, - BIC32_STATIC, - BIC32_SCROLL, - BIC32_MDICLIENT, - BIC32_DESKTOP, - BIC32_DIALOG, - BIC32_ICONTITLE, - BIC32_NB_CLASSES -} BUILTIN_CLASS; - + /* PAINT_RedrawWindow() control flags */ #define RDW_C_USEHRGN 0x0001 #define RDW_C_DELETEHRGN 0x0002