ReactOS 0.4.17-dev-573-g8315b8c
propsheet.c File Reference
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "prsht.h"
#include "comctl32.h"
#include "uxtheme.h"
#include "wine/debug.h"
#include "pshpack2.h"
#include "poppack.h"
Include dependency graph for propsheet.c:

Go to the source code of this file.

Classes

struct  MyDLGTEMPLATEEX
 
struct  MyDLGITEMTEMPLATEEX
 
struct  tagPropPageInfo
 
struct  tagPropSheetInfo
 
struct  PADDING_INFO
 

Macros

#define NONAMELESSUNION
 
#define PSP_INTERNAL_UNICODE   0x80000000
 
#define MAX_CAPTION_LENGTH   255
 
#define MAX_TABTEXT_LENGTH   255
 
#define MAX_BUTTONTEXT_LENGTH   64
 
#define INTRNL_ANY_WIZARD   (PSH_WIZARD | PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE)
 
#define WIZARD_PADDING   7
 
#define WIZARD_HEADER_HEIGHT   36
 
#define add_flag(a)   if (dwFlags & a) {strcat(string, #a );strcat(string," ");}
 

Typedefs

typedef struct tagPropPageInfo PropPageInfo
 
typedef struct tagPropSheetInfo PropSheetInfo
 

Functions

static PADDING_INFO PROPSHEET_GetPaddingInfo (HWND hwndDlg)
 
static void PROPSHEET_SetTitleW (HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
 
static BOOL PROPSHEET_CanSetCurSel (HWND hwndDlg)
 
static BOOL PROPSHEET_SetCurSel (HWND hwndDlg, int index, int skipdir, HPROPSHEETPAGE hpage)
 
static int PROPSHEET_GetPageIndex (HPROPSHEETPAGE hpage, const PropSheetInfo *psInfo, int original_index)
 
static PADDING_INFO PROPSHEET_GetPaddingInfoWizard (HWND hwndDlg, const PropSheetInfo *psInfo)
 
static BOOL PROPSHEET_DoCommand (HWND hwnd, WORD wID)
 
static BOOL PROPSHEET_RemovePage (HWND hwndDlg, int index, HPROPSHEETPAGE hpage)
 
static INT_PTR CALLBACK PROPSHEET_DialogProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
 WINE_DEFAULT_DEBUG_CHANNEL (propsheet)
 
static WCHARheap_strdupW (const WCHAR *str)
 
static WCHARheap_strdupAtoW (const char *str)
 
static VOID PROPSHEET_UnImplementedFlags (DWORD dwFlags)
 
static void PROPSHEET_GetPageRect (const PropSheetInfo *psInfo, HWND hwndDlg, RECT *rc, LPCPROPSHEETPAGEW ppshpage)
 
static INT PROPSHEET_FindPageByResId (const PropSheetInfo *psInfo, LRESULT resId)
 
static void PROPSHEET_CollectSheetInfoCommon (PropSheetInfo *psInfo, DWORD dwFlags)
 
static void PROPSHEET_CollectSheetInfoA (LPCPROPSHEETHEADERA lppsh, PropSheetInfo *psInfo)
 
static void PROPSHEET_CollectSheetInfoW (LPCPROPSHEETHEADERW lppsh, PropSheetInfo *psInfo)
 
static BOOL PROPSHEET_CollectPageInfo (LPCPROPSHEETPAGEW lppsp, PropSheetInfo *psInfo, int index, BOOL resize)
 
static INT_PTR PROPSHEET_CreateDialog (PropSheetInfo *psInfo)
 
static BOOL PROPSHEET_SizeMismatch (HWND hwndDlg, const PropSheetInfo *psInfo)
 
static BOOL PROPSHEET_AdjustSize (HWND hwndDlg, PropSheetInfo *psInfo)
 
static BOOL PROPSHEET_AdjustSizeWizard (HWND hwndDlg, const PropSheetInfo *psInfo)
 
static BOOL PROPSHEET_AdjustButtons (HWND hwndParent, const PropSheetInfo *psInfo)
 
static BOOL PROPSHEET_AdjustButtonsWizard (HWND hwndParent, const PropSheetInfo *psInfo)
 
static BOOL PROPSHEET_CreateTabControl (HWND hwndParent, const PropSheetInfo *psInfo)
 
static LRESULT CALLBACK PROPSHEET_WizardSubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uID, DWORD_PTR dwRef)
 
static UINT GetTemplateSize (const DLGTEMPLATE *pTemplate)
 
static BOOL PROPSHEET_CreatePage (HWND hwndParent, int index, const PropSheetInfo *psInfo, LPCPROPSHEETPAGEW ppshpage)
 
static VOID PROPSHEET_LoadWizardBitmaps (PropSheetInfo *psInfo)
 
static BOOL PROPSHEET_ShowPage (HWND hwndDlg, int index, PropSheetInfo *psInfo)
 
static BOOL PROPSHEET_Back (HWND hwndDlg)
 
static BOOL PROPSHEET_Next (HWND hwndDlg)
 
static BOOL PROPSHEET_Finish (HWND hwndDlg)
 
static BOOL PROPSHEET_Apply (HWND hwndDlg, LPARAM lParam)
 
static void PROPSHEET_Cancel (HWND hwndDlg, LPARAM lParam)
 
static void PROPSHEET_Help (HWND hwndDlg)
 
static void PROPSHEET_Changed (HWND hwndDlg, HWND hwndDirtyPage)
 
static void PROPSHEET_UnChanged (HWND hwndDlg, HWND hwndCleanPage)
 
static void PROPSHEET_PressButton (HWND hwndDlg, int buttonID)
 
static void PROPSHEET_SetCurSelId (HWND hwndDlg, int id)
 
static void PROPSHEET_SetTitleA (HWND hwndDlg, DWORD dwStyle, LPCSTR lpszText)
 
static void PROPSHEET_SetFinishTextA (HWND hwndDlg, LPCSTR lpszText)
 
static void PROPSHEET_SetFinishTextW (HWND hwndDlg, LPCWSTR lpszText)
 
static LRESULT PROPSHEET_QuerySiblings (HWND hwndDlg, WPARAM wParam, LPARAM lParam)
 
static BOOL PROPSHEET_InsertPage (HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage)
 
static BOOL PROPSHEET_AddPage (HWND hwndDlg, HPROPSHEETPAGE hpage)
 
static void PROPSHEET_SetWizButtons (HWND hwndDlg, DWORD dwFlags)
 
static void PROPSHEET_SetHeaderTitleW (HWND hwndDlg, UINT page_index, const WCHAR *title)
 
static void PROPSHEET_SetHeaderTitleA (HWND hwndDlg, UINT page_index, const char *title)
 
static void PROPSHEET_SetHeaderSubTitleW (HWND hwndDlg, UINT page_index, const WCHAR *subtitle)
 
static void PROPSHEET_SetHeaderSubTitleA (HWND hwndDlg, UINT page_index, const char *subtitle)
 
static LRESULT PROPSHEET_HwndToIndex (HWND hwndDlg, HWND hPageDlg)
 
static LRESULT PROPSHEET_IndexToHwnd (HWND hwndDlg, int iPageIndex)
 
static LRESULT PROPSHEET_PageToIndex (HWND hwndDlg, HPROPSHEETPAGE hPage)
 
static LRESULT PROPSHEET_IndexToPage (HWND hwndDlg, int iPageIndex)
 
static LRESULT PROPSHEET_IdToIndex (HWND hwndDlg, int iPageId)
 
static LRESULT PROPSHEET_IndexToId (HWND hwndDlg, int iPageIndex)
 
static LRESULT PROPSHEET_GetResult (HWND hwndDlg)
 
static BOOL PROPSHEET_RecalcPageSizes (HWND hwndDlg)
 
static void PROPSHEET_CleanUp (HWND hwndDlg)
 
static INT do_loop (const PropSheetInfo *psInfo)
 
static INT_PTR PROPSHEET_PropertySheet (PropSheetInfo *psInfo, BOOL unicode)
 
INT_PTR WINAPI PropertySheetA (LPCPROPSHEETHEADERA lppsh)
 
INT_PTR WINAPI PropertySheetW (LPCPROPSHEETHEADERW lppsh)
 
static LPWSTR load_string (HINSTANCE instance, LPCWSTR str)
 
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA (LPCPROPSHEETPAGEA lpPropSheetPage)
 
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW (LPCPROPSHEETPAGEW lpPropSheetPage)
 
BOOL WINAPI DestroyPropertySheetPage (HPROPSHEETPAGE hPropPage)
 
static BOOL PROPSHEET_IsDialogMessage (HWND hwnd, LPMSG lpMsg)
 
static LRESULT PROPSHEET_Paint (HWND hwnd, HDC hdcParam)
 

Variables

static const WCHAR PropSheetInfoStr []
 

Macro Definition Documentation

◆ add_flag

#define add_flag (   a)    if (dwFlags & a) {strcat(string, #a );strcat(string," ");}

Definition at line 196 of file propsheet.c.

◆ INTRNL_ANY_WIZARD

#define INTRNL_ANY_WIZARD   (PSH_WIZARD | PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE)

Definition at line 150 of file propsheet.c.

◆ MAX_BUTTONTEXT_LENGTH

#define MAX_BUTTONTEXT_LENGTH   64

Definition at line 148 of file propsheet.c.

◆ MAX_CAPTION_LENGTH

#define MAX_CAPTION_LENGTH   255

Definition at line 146 of file propsheet.c.

◆ MAX_TABTEXT_LENGTH

#define MAX_TABTEXT_LENGTH   255

Definition at line 147 of file propsheet.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 54 of file propsheet.c.

◆ PSP_INTERNAL_UNICODE

#define PSP_INTERNAL_UNICODE   0x80000000

Definition at line 144 of file propsheet.c.

◆ WIZARD_HEADER_HEIGHT

#define WIZARD_HEADER_HEIGHT   36

Definition at line 154 of file propsheet.c.

◆ WIZARD_PADDING

#define WIZARD_PADDING   7

Definition at line 153 of file propsheet.c.

Typedef Documentation

◆ PropPageInfo

◆ PropSheetInfo

Function Documentation

◆ CreatePropertySheetPageA()

HPROPSHEETPAGE WINAPI CreatePropertySheetPageA ( LPCPROPSHEETPAGEA  lpPropSheetPage)

Definition at line 3036 of file propsheet.c.

3038{
3039 PROPSHEETPAGEW *ppsp;
3040
3041 if (lpPropSheetPage->dwSize < PROPSHEETPAGEA_V1_SIZE)
3042 return NULL;
3043
3044 /* original data is used for callback notifications */
3045 if ((lpPropSheetPage->dwFlags & PSP_USECALLBACK) && lpPropSheetPage->pfnCallback)
3046 {
3047 ppsp = Alloc(2 * sizeof(*ppsp));
3048 memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA)));
3049 memcpy(ppsp + 1, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA)));
3050 }
3051 else
3052 {
3053 ppsp = Alloc(sizeof(*ppsp));
3054 memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA)));
3055 }
3056
3057 ppsp->dwFlags &= ~PSP_INTERNAL_UNICODE;
3058
3059 if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
3060 {
3061 if (!IS_INTRESOURCE( ppsp->u.pszTemplate ))
3062 {
3063 int len = strlen(lpPropSheetPage->u.pszTemplate) + 1;
3064 char *template = Alloc( len );
3065
3066 ppsp->u.pszTemplate = (LPWSTR)strcpy( template, lpPropSheetPage->u.pszTemplate );
3067 }
3068 }
3069
3070 if (ppsp->dwFlags & PSP_USEICONID)
3071 {
3072 if (!IS_INTRESOURCE( ppsp->u2.pszIcon ))
3073 ppsp->u2.pszIcon = heap_strdupAtoW( lpPropSheetPage->u2.pszIcon );
3074 }
3075
3076 if (ppsp->dwFlags & PSP_USETITLE)
3077 {
3078 if (IS_INTRESOURCE( ppsp->pszTitle ))
3079 ppsp->pszTitle = load_string( ppsp->hInstance, ppsp->pszTitle );
3080 else
3081 ppsp->pszTitle = heap_strdupAtoW( lpPropSheetPage->pszTitle );
3082 }
3083 else
3084 ppsp->pszTitle = NULL;
3085
3086 if (ppsp->dwFlags & PSP_HIDEHEADER)
3087 ppsp->dwFlags &= ~(PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE);
3088
3089 if (ppsp->dwFlags & PSP_USEHEADERTITLE)
3090 {
3091 if (IS_INTRESOURCE( ppsp->pszHeaderTitle ))
3092 ppsp->pszHeaderTitle = load_string( ppsp->hInstance, ppsp->pszHeaderTitle );
3093 else
3094 ppsp->pszHeaderTitle = heap_strdupAtoW( lpPropSheetPage->pszHeaderTitle );
3095 }
3096 else
3097 ppsp->pszHeaderTitle = NULL;
3098
3099 if (ppsp->dwFlags & PSP_USEHEADERSUBTITLE)
3100 {
3101 if (IS_INTRESOURCE( ppsp->pszHeaderSubTitle ))
3102 ppsp->pszHeaderSubTitle = load_string( ppsp->hInstance, ppsp->pszHeaderSubTitle );
3103 else
3104 ppsp->pszHeaderSubTitle = heap_strdupAtoW( lpPropSheetPage->pszHeaderSubTitle );
3105 }
3106 else
3107 ppsp->pszHeaderSubTitle = NULL;
3108
3109 if ((ppsp->dwFlags & PSP_USECALLBACK) && ppsp->dwSize > PROPSHEETPAGEA_V1_SIZE && ppsp->pfnCallback)
3110 ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp + 1);
3111
3112 return (HPROPSHEETPAGE)ppsp;
3113}
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
#define NULL
Definition: types.h:112
static WCHAR * heap_strdupAtoW(const char *str)
Definition: propsheet.c:184
static LPWSTR load_string(HINSTANCE instance, LPCWSTR str)
Definition: propsheet.c:2986
#define IS_INTRESOURCE(x)
Definition: loader.c:613
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
GLenum GLsizei len
Definition: glext.h:6722
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define min(a, b)
Definition: monoChain.cc:55
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define PSP_USEICONID
Definition: prsht.h:25
#define PROPSHEETPAGEA_V1_SIZE
Definition: prsht.h:209
#define PSPCB_ADDREF
Definition: prsht.h:171
#define PSP_USETITLE
Definition: prsht.h:26
#define PSP_USECALLBACK
Definition: prsht.h:30
#define PSP_DLGINDIRECT
Definition: prsht.h:23
strcpy
Definition: string.h:131
DWORD dwFlags
Definition: prsht.h:178
LPCSTR pszTemplate
Definition: prsht.h:181
LPCSTR pszIcon
Definition: prsht.h:186
DWORD dwSize
Definition: prsht.h:177
LPCSTR pszTitle
Definition: prsht.h:188
DWORD dwSize
Definition: prsht.h:214
DWORD dwFlags
Definition: prsht.h:215
LPCWSTR pszIcon
Definition: prsht.h:223
LPCWSTR pszTemplate
Definition: prsht.h:218
LPCWSTR pszTitle
Definition: prsht.h:225
HINSTANCE hInstance
Definition: prsht.h:216
uint16_t * LPWSTR
Definition: typedefs.h:56

Referenced by init_functions(), PropertySheetA(), and WINHELP_CreateIndexWindow().

◆ CreatePropertySheetPageW()

HPROPSHEETPAGE WINAPI CreatePropertySheetPageW ( LPCPROPSHEETPAGEW  lpPropSheetPage)

Definition at line 3120 of file propsheet.c.

3121{
3122 PROPSHEETPAGEW *ppsp;
3123
3124 if (lpPropSheetPage->dwSize < PROPSHEETPAGEW_V1_SIZE)
3125 return NULL;
3126
3127 /* original data is used for callback notifications */
3128 if ((lpPropSheetPage->dwFlags & PSP_USECALLBACK) && lpPropSheetPage->pfnCallback)
3129 {
3130 ppsp = Alloc(2 * sizeof(*ppsp));
3131 memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW)));
3132 memcpy(ppsp + 1, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW)));
3133 }
3134 else
3135 {
3136 ppsp = Alloc(sizeof(*ppsp));
3137 memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW)));
3138 }
3139
3141
3142 if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
3143 {
3144 if (!IS_INTRESOURCE( ppsp->u.pszTemplate ))
3145 ppsp->u.pszTemplate = heap_strdupW( lpPropSheetPage->u.pszTemplate );
3146 }
3147
3148 if ( ppsp->dwFlags & PSP_USEICONID )
3149 {
3150 if (!IS_INTRESOURCE( ppsp->u2.pszIcon ))
3151 ppsp->u2.pszIcon = heap_strdupW( lpPropSheetPage->u2.pszIcon );
3152 }
3153
3154 if (ppsp->dwFlags & PSP_USETITLE)
3155 ppsp->pszTitle = load_string( ppsp->hInstance, ppsp->pszTitle );
3156 else
3157 ppsp->pszTitle = NULL;
3158
3159 if (ppsp->dwFlags & PSP_HIDEHEADER)
3160 ppsp->dwFlags &= ~(PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE);
3161
3162 if (ppsp->dwFlags & PSP_USEHEADERTITLE)
3163 ppsp->pszHeaderTitle = load_string( ppsp->hInstance, ppsp->pszHeaderTitle );
3164 else
3165 ppsp->pszHeaderTitle = NULL;
3166
3167 if (ppsp->dwFlags & PSP_USEHEADERSUBTITLE)
3168 ppsp->pszHeaderSubTitle = load_string( ppsp->hInstance, ppsp->pszHeaderSubTitle );
3169 else
3170 ppsp->pszHeaderSubTitle = NULL;
3171
3172 if ((ppsp->dwFlags & PSP_USECALLBACK) && ppsp->dwSize > PROPSHEETPAGEW_V1_SIZE && ppsp->pfnCallback)
3173 ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp + 1);
3174
3175 return (HPROPSHEETPAGE)ppsp;
3176}
#define PSP_INTERNAL_UNICODE
Definition: propsheet.c:144
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:176
#define PROPSHEETPAGEW_V1_SIZE
Definition: prsht.h:246

Referenced by BtrfsPropSheet::AddPages(), BtrfsVolPropSheet::AddPages(), init_functions(), InitializePropertySheetPage(), NetPropPageProvider(), OleCreatePropertyFrameIndirect(), ParallelPortPropPageProvider(), PropertySheetW(), PS2MousePropPageProvider(), SerialPortPropPageProvider(), and SH_CreatePropertySheetPageEx().

◆ DestroyPropertySheetPage()

BOOL WINAPI DestroyPropertySheetPage ( HPROPSHEETPAGE  hPropPage)

Definition at line 3189 of file propsheet.c.

3190{
3191 PROPSHEETPAGEW *psp = (PROPSHEETPAGEW *)hPropPage;
3192
3193 if (!psp)
3194 return FALSE;
3195
3196 if ((psp->dwFlags & PSP_USECALLBACK) && psp->pfnCallback)
3197 psp->pfnCallback(0, PSPCB_RELEASE, psp + 1);
3198
3199 if (!(psp->dwFlags & PSP_DLGINDIRECT) && !IS_INTRESOURCE( psp->u.pszTemplate ))
3200 Free ((LPVOID)psp->u.pszTemplate);
3201
3202 if ((psp->dwFlags & PSP_USEICONID) && !IS_INTRESOURCE( psp->u2.pszIcon ))
3203 Free ((LPVOID)psp->u2.pszIcon);
3204
3205 if ((psp->dwFlags & PSP_USETITLE) && !IS_INTRESOURCE( psp->pszTitle ))
3206 Free ((LPVOID)psp->pszTitle);
3207
3208 if ((psp->dwFlags & PSP_USEHEADERTITLE) && !IS_INTRESOURCE( psp->pszHeaderTitle ))
3209 Free ((LPVOID)psp->pszHeaderTitle);
3210
3211 if ((psp->dwFlags & PSP_USEHEADERSUBTITLE) && !IS_INTRESOURCE( psp->pszHeaderSubTitle ))
3212 Free ((LPVOID)psp->pszHeaderSubTitle);
3213
3214 Free(hPropPage);
3215
3216 return TRUE;
3217}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define PSPCB_RELEASE
Definition: prsht.h:37
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815

Referenced by AddNetIdPage(), CNetConnectionPropertyUi::AddPages(), CVfdShExt::AddPages(), CLayerUIPropPage::AddPages(), BtrfsPropSheet::AddPages(), BtrfsVolPropSheet::AddPages(), AddPropSheetPage(), INetCfgComponentPropertyUi_fnMergePropPages(), init_functions(), NetPropPageProvider(), ParallelPortPropPageProvider(), PropertySheetA(), PropertySheetW(), PROPSHEET_CleanUp(), PROPSHEET_RemovePage(), PropSheetExtProc(), PS2MousePropPageProvider(), and SerialPortPropPageProvider().

◆ do_loop()

static INT do_loop ( const PropSheetInfo psInfo)
static

Definition at line 2834 of file propsheet.c.

2835{
2836 MSG msg = { 0 };
2837 INT ret = 0;
2838 HWND hwnd = psInfo->hwnd;
2839 HWND parent = psInfo->ppshheader.hwndParent;
2840
2841 while(IsWindow(hwnd) && !psInfo->ended && (ret = GetMessageW(&msg, NULL, 0, 0)))
2842 {
2843 if(ret == -1)
2844 break;
2845
2846#ifdef __REACTOS__
2848#else
2849 if(!IsDialogMessageW(hwnd, &msg))
2850#endif
2851 {
2854 }
2855 }
2856
2857 if(ret == 0 && msg.message)
2858 PostQuitMessage(msg.wParam);
2859
2860 if(ret != -1)
2861 ret = psInfo->result;
2862
2863 if(parent)
2865
2867 return ret;
2868}
#define msg(x)
Definition: auth_time.c:54
static BOOL PROPSHEET_IsDialogMessage(HWND hwnd, LPMSG lpMsg)
Definition: propsheet.c:3222
return ret
Definition: mutex.c:146
r parent
Definition: btrfs.c:3010
HWND hwndParent
Definition: prsht.h:295
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:109
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT
Definition: typedefs.h:58
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI IsDialogMessageW(_In_ HWND, _In_ LPMSG)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by PROPSHEET_PropertySheet(), and winetest_loop_todo().

◆ GetTemplateSize()

static UINT GetTemplateSize ( const DLGTEMPLATE pTemplate)
static

Definition at line 1231 of file propsheet.c.

1233{
1234 const WORD* p = (const WORD *)pTemplate;
1235 BOOL istemplateex = (((const MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF);
1236 WORD nrofitems;
1237 UINT ret;
1238
1239 if (istemplateex)
1240 {
1241 /* DLGTEMPLATEEX (not defined in any std. header file) */
1242
1243 TRACE("is DLGTEMPLATEEX\n");
1244 p++; /* dlgVer */
1245 p++; /* signature */
1246 p += 2; /* help ID */
1247 p += 2; /* ext style */
1248 p += 2; /* style */
1249 }
1250 else
1251 {
1252 /* DLGTEMPLATE */
1253
1254 TRACE("is DLGTEMPLATE\n");
1255 p += 2; /* style */
1256 p += 2; /* ext style */
1257 }
1258
1259 nrofitems = (WORD)*p; p++; /* nb items */
1260 p++; /* x */
1261 p++; /* y */
1262 p++; /* width */
1263 p++; /* height */
1264
1265 /* menu */
1266 switch ((WORD)*p)
1267 {
1268 case 0x0000:
1269 p++;
1270 break;
1271 case 0xffff:
1272 p += 2;
1273 break;
1274 default:
1275 TRACE("menu %s\n",debugstr_w( p ));
1276 p += lstrlenW( p ) + 1;
1277 break;
1278 }
1279
1280 /* class */
1281 switch ((WORD)*p)
1282 {
1283 case 0x0000:
1284 p++;
1285 break;
1286 case 0xffff:
1287 p += 2; /* 0xffff plus predefined window class ordinal value */
1288 break;
1289 default:
1290 TRACE("class %s\n",debugstr_w( p ));
1291 p += lstrlenW( p ) + 1;
1292 break;
1293 }
1294
1295 /* title */
1296 TRACE("title %s\n",debugstr_w( p ));
1297 p += lstrlenW( p ) + 1;
1298
1299 /* font, if DS_SETFONT set */
1300 if ((DS_SETFONT & ((istemplateex)? ((const MyDLGTEMPLATEEX*)pTemplate)->style :
1301 pTemplate->style)))
1302 {
1303 p+=(istemplateex)?3:1;
1304 TRACE("font %s\n",debugstr_w( p ));
1305 p += lstrlenW( p ) + 1; /* the font name */
1306 }
1307
1308 /* now process the DLGITEMTEMPLATE(EX) structs (plus custom data)
1309 * that are following the DLGTEMPLATE(EX) data */
1310 TRACE("%d items\n",nrofitems);
1311 while (nrofitems > 0)
1312 {
1313 p = (WORD*)(((DWORD_PTR)p + 3) & ~3); /* DWORD align */
1314
1315 /* skip header */
1316 p += (istemplateex ? sizeof(MyDLGITEMTEMPLATEEX) : sizeof(DLGITEMTEMPLATE))/sizeof(WORD);
1317
1318 /* check class */
1319 switch ((WORD)*p)
1320 {
1321 case 0x0000:
1322 p++;
1323 break;
1324 case 0xffff:
1325 TRACE("class ordinal 0x%08x\n",*(const DWORD*)p);
1326 p += 2;
1327 break;
1328 default:
1329 TRACE("class %s\n",debugstr_w( p ));
1330 p += lstrlenW( p ) + 1;
1331 break;
1332 }
1333
1334 /* check title text */
1335 switch ((WORD)*p)
1336 {
1337 case 0x0000:
1338 p++;
1339 break;
1340 case 0xffff:
1341 TRACE("text ordinal 0x%08x\n",*(const DWORD*)p);
1342 p += 2;
1343 break;
1344 default:
1345 TRACE("text %s\n",debugstr_w( p ));
1346 p += lstrlenW( p ) + 1;
1347 break;
1348 }
1349 p += *p / sizeof(WORD) + 1; /* Skip extra data */
1350 --nrofitems;
1351 }
1352
1353 ret = (p - (const WORD*)pTemplate) * sizeof(WORD);
1354 TRACE("%p %p size 0x%08x\n", p, pTemplate, ret);
1355 return ret;
1356}
Arabic default style
Definition: afstyles.h:94
#define lstrlenW
Definition: compat.h:750
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLfloat GLfloat p
Definition: glext.h:8902
unsigned int UINT
Definition: sysinfo.c:13
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define DS_SETFONT
Definition: winuser.h:378

Referenced by PROPSHEET_CreatePage().

◆ heap_strdupAtoW()

static WCHAR * heap_strdupAtoW ( const char str)
static

Definition at line 184 of file propsheet.c.

185{
186 WCHAR *ret;
187 INT len;
188
189 len = MultiByteToWideChar(CP_ACP, 0, str, -1, 0, 0);
190 ret = Alloc(len * sizeof(WCHAR));
192
193 return ret;
194}
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
short WCHAR
Definition: pedump.c:58
const WCHAR * str

Referenced by CreatePropertySheetPageA(), PROPSHEET_SetHeaderSubTitleA(), and PROPSHEET_SetHeaderTitleA().

◆ heap_strdupW()

static WCHAR * heap_strdupW ( const WCHAR str)
static

Definition at line 176 of file propsheet.c.

177{
178 int len = lstrlenW(str) + 1;
179 WCHAR *ret = Alloc(len * sizeof(WCHAR));
180 lstrcpyW(ret, str);
181 return ret;
182}
#define lstrcpyW
Definition: compat.h:749

Referenced by CreatePropertySheetPageW(), PROPSHEET_CollectPageInfo(), PROPSHEET_CollectSheetInfoW(), PROPSHEET_SetHeaderSubTitleW(), and PROPSHEET_SetHeaderTitleW().

◆ load_string()

static LPWSTR load_string ( HINSTANCE  instance,
LPCWSTR  str 
)
static

Definition at line 2986 of file propsheet.c.

2987{
2988 LPWSTR ret;
2989
2990 if (IS_INTRESOURCE(str))
2991 {
2992 HRSRC hrsrc;
2993 HGLOBAL hmem;
2994 WCHAR *ptr;
2995 WORD i, id = LOWORD(str);
2996 UINT len;
2997
2998 if (!(hrsrc = FindResourceW( instance, MAKEINTRESOURCEW((id >> 4) + 1), (LPWSTR)RT_STRING )))
2999 return NULL;
3000 if (!(hmem = LoadResource( instance, hrsrc ))) return NULL;
3001 if (!(ptr = LockResource( hmem ))) return NULL;
3002 for (i = id & 0x0f; i > 0; i--) ptr += *ptr + 1;
3003 len = *ptr;
3004 if (!len) return NULL;
3005 ret = Alloc( (len + 1) * sizeof(WCHAR) );
3006 if (ret)
3007 {
3008 memcpy( ret, ptr + 1, len * sizeof(WCHAR) );
3009 ret[len] = 0;
3010 }
3011 }
3012 else
3013 {
3014 int len = (lstrlenW(str) + 1) * sizeof(WCHAR);
3015 ret = Alloc( len );
3016 if (ret) memcpy( ret, str, len );
3017 }
3018 return ret;
3019}
static HINSTANCE instance
Definition: main.c:40
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static PVOID ptr
Definition: dispmode.c:27
#define LOWORD(l)
Definition: pedump.c:82
#define RT_STRING
Definition: pedump.c:368
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CreatePropertySheetPageA(), and CreatePropertySheetPageW().

◆ PropertySheetA()

INT_PTR WINAPI PropertySheetA ( LPCPROPSHEETHEADERA  lppsh)

Definition at line 2909 of file propsheet.c.

2910{
2911 PropSheetInfo* psInfo = GlobalAlloc(GPTR, sizeof(PropSheetInfo));
2912 UINT i, n;
2913 const BYTE* pByte;
2914
2915 TRACE("(%p)\n", lppsh);
2916
2917 PROPSHEET_CollectSheetInfoA(lppsh, psInfo);
2918
2919 psInfo->proppage = Alloc(sizeof(PropPageInfo) * lppsh->nPages);
2920 pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp;
2921
2922 for (n = i = 0; i < lppsh->nPages; i++, n++)
2923 {
2924 if (!psInfo->usePropPage)
2925 psInfo->proppage[n].hpage = psInfo->ppshheader.u3.phpage[i];
2926 else
2927 {
2929 pByte += ((LPCPROPSHEETPAGEA)pByte)->dwSize;
2930 }
2931
2933 psInfo, n, TRUE))
2934 {
2935 if (psInfo->usePropPage)
2937 n--;
2938 psInfo->nPages--;
2939 }
2940 }
2941
2942 return PROPSHEET_PropertySheet(psInfo, FALSE);
2943}
static void PROPSHEET_CollectSheetInfoA(LPCPROPSHEETHEADERA lppsh, PropSheetInfo *psInfo)
Definition: propsheet.c:339
static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, PropSheetInfo *psInfo, int index, BOOL resize)
Definition: propsheet.c:421
static INT_PTR PROPSHEET_PropertySheet(PropSheetInfo *psInfo, BOOL unicode)
Definition: propsheet.c:2875
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA lpPropSheetPage)
Definition: propsheet.c:3036
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
Definition: propsheet.c:3189
GLdouble n
Definition: glext.h:7729
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
const PROPSHEETPAGEA * LPCPROPSHEETPAGEA
Definition: prsht.h:208
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:308
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
HPROPSHEETPAGE hpage
Definition: propsheet.c:97
PropPageInfo * proppage
Definition: propsheet.c:121
#define GPTR
Definition: winbase.h:320
unsigned char BYTE
Definition: xxhash.c:193

Referenced by init_functions(), and WINHELP_CreateIndexWindow().

◆ PropertySheetW()

INT_PTR WINAPI PropertySheetW ( LPCPROPSHEETHEADERW  lppsh)

Definition at line 2950 of file propsheet.c.

2951{
2952 PropSheetInfo* psInfo = GlobalAlloc(GPTR, sizeof(PropSheetInfo));
2953 UINT i, n;
2954 const BYTE* pByte;
2955
2956 TRACE("(%p)\n", lppsh);
2957
2958 PROPSHEET_CollectSheetInfoW(lppsh, psInfo);
2959
2960 psInfo->proppage = Alloc(sizeof(PropPageInfo) * lppsh->nPages);
2961 pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp;
2962
2963 for (n = i = 0; i < lppsh->nPages; i++, n++)
2964 {
2965 if (!psInfo->usePropPage)
2966 psInfo->proppage[n].hpage = psInfo->ppshheader.u3.phpage[i];
2967 else
2968 {
2970 pByte += ((LPCPROPSHEETPAGEW)pByte)->dwSize;
2971 }
2972
2974 psInfo, n, TRUE))
2975 {
2976 if (psInfo->usePropPage)
2978 n--;
2979 psInfo->nPages--;
2980 }
2981 }
2982
2983 return PROPSHEET_PropertySheet(psInfo, TRUE);
2984}
static void PROPSHEET_CollectSheetInfoW(LPCPROPSHEETHEADERW lppsh, PropSheetInfo *psInfo)
Definition: propsheet.c:383
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3120
const PROPSHEETPAGEW * LPCPROPSHEETPAGEW
Definition: prsht.h:245

Referenced by _tWinMain(), Applet(), CreatePropSheet(), CustomizeLocalePropertySheet(), dialog_viewproperties(), display_cpl_sheets(), EventLogProperties(), INetCfgComponent_fnRaisePropertyUi(), InitApplet(), LaunchAdvancedTcpipSettings(), MmSysApplet(), OleCreatePropertyFrameIndirect(), PropSheetThread(), CCleanMgrModule::Run(), CZipExtract::runWizard(), SHELL32_PropertySheet(), show_cert_dialog(), show_edit_cert_properties_dialog(), show_export_ui(), show_import_ui(), ShowAudioPropertySheet(), ShowFolderOptionsDialogThreadProc(), ShowFullControlPanel(), ShowNetConnectionProperties(), ShowPerformanceOptions(), ShowPropSheetW(), ShowStatusPropertyDialog(), SpeakerVolume(), SystemApplet(), and wmain().

◆ PROPSHEET_AddPage()

static BOOL PROPSHEET_AddPage ( HWND  hwndDlg,
HPROPSHEETPAGE  hpage 
)
static

Definition at line 2382 of file propsheet.c.

2383{
2384 PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2385 TRACE("hwndDlg %p, hpage %p\n", hwndDlg, hpage);
2386 return PROPSHEET_InsertPage(hwndDlg, UlongToPtr(psInfo->nPages), hpage);
2387}
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:141
static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage)
Definition: propsheet.c:2288
#define UlongToPtr(u)
Definition: config.h:106
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_AdjustButtons()

static BOOL PROPSHEET_AdjustButtons ( HWND  hwndParent,
const PropSheetInfo psInfo 
)
static

Definition at line 861 of file propsheet.c.

862{
863 HWND hwndButton = GetDlgItem(hwndParent, IDOK);
864 RECT rcSheet;
865 int x, y;
866 int num_buttons = 2;
867 int buttonWidth, buttonHeight;
869
870 if (psInfo->hasApply)
871 num_buttons++;
872
873 if (psInfo->hasHelp)
874 num_buttons++;
875
876 /*
877 * Obtain the size of the buttons.
878 */
879 GetClientRect(hwndButton, &rcSheet);
880 buttonWidth = rcSheet.right;
881 buttonHeight = rcSheet.bottom;
882
883 /*
884 * Get the size of the property sheet.
885 */
886 GetClientRect(hwndParent, &rcSheet);
887
888 /*
889 * All buttons will be at this y coordinate.
890 */
891 y = rcSheet.bottom - (padding.y + buttonHeight);
892
893 /*
894 * Position OK button and make it default.
895 */
896 hwndButton = GetDlgItem(hwndParent, IDOK);
897
898 x = rcSheet.right - ((padding.x + buttonWidth) * num_buttons);
899
900 SetWindowPos(hwndButton, 0, x, y, 0, 0,
902
904
905
906 /*
907 * Position Cancel button.
908 */
909 hwndButton = GetDlgItem(hwndParent, IDCANCEL);
910
911 x += padding.x + buttonWidth;
912
913 SetWindowPos(hwndButton, 0, x, y, 0, 0,
915
916 /*
917 * Position Apply button.
918 */
920
921 if(psInfo->hasApply)
922 x += padding.x + buttonWidth;
923 else
924 ShowWindow(hwndButton, SW_HIDE);
925
926 SetWindowPos(hwndButton, 0, x, y, 0, 0,
928 EnableWindow(hwndButton, FALSE);
929
930 /*
931 * Position Help button.
932 */
933 hwndButton = GetDlgItem(hwndParent, IDHELP);
934
935 x += padding.x + buttonWidth;
936 SetWindowPos(hwndButton, 0, x, y, 0, 0,
938
939 if(!psInfo->hasHelp)
940 ShowWindow(hwndButton, SW_HIDE);
941
942 return TRUE;
943}
#define IDC_APPLY_BUTTON
Definition: comctl32.h:54
static HWND hwndParent
Definition: cryptui.c:299
static PADDING_INFO PROPSHEET_GetPaddingInfo(HWND hwndDlg)
Definition: propsheet.c:1077
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static const DWORD padding[]
Definition: mciwnd.c:89
#define IDHELP
Definition: resource_2.h:8
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
#define SW_HIDE
Definition: winuser.h:779
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define DM_SETDEFID
Definition: winuser.h:2135
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IDCANCEL
Definition: winuser.h:842
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOSIZE
Definition: winuser.h:1256
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SWP_NOZORDER
Definition: winuser.h:1258
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_AdjustButtonsWizard()

static BOOL PROPSHEET_AdjustButtonsWizard ( HWND  hwndParent,
const PropSheetInfo psInfo 
)
static

Definition at line 950 of file propsheet.c.

952{
953 HWND hwndButton = GetDlgItem(hwndParent, IDCANCEL);
956 RECT rcSheet;
957 int x, y;
958 int num_buttons = 3;
959 int buttonWidth, buttonHeight, lineHeight, lineWidth;
961
962 if (psInfo->hasHelp)
963 num_buttons++;
964 if (psInfo->hasFinish)
965 num_buttons++;
966
967 /*
968 * Obtain the size of the buttons.
969 */
970 GetClientRect(hwndButton, &rcSheet);
971 buttonWidth = rcSheet.right;
972 buttonHeight = rcSheet.bottom;
973
974 GetClientRect(hwndLine, &rcSheet);
975 lineHeight = rcSheet.bottom;
976
977 /*
978 * Get the size of the property sheet.
979 */
980 GetClientRect(hwndParent, &rcSheet);
981
982 /*
983 * All buttons will be at this y coordinate.
984 */
985 y = rcSheet.bottom - (padding.y + buttonHeight);
986
987 /*
988 * Position the Back button.
989 */
991
992 x = rcSheet.right - ((padding.x + buttonWidth) * (num_buttons - 1)) - buttonWidth;
993
994 SetWindowPos(hwndButton, 0, x, y, 0, 0,
996
997 /*
998 * Position the Next button.
999 */
1000 hwndButton = GetDlgItem(hwndParent, IDC_NEXT_BUTTON);
1001
1002 x += buttonWidth;
1003
1004 SetWindowPos(hwndButton, 0, x, y, 0, 0,
1006
1007 /*
1008 * Position the Finish button.
1009 */
1011
1012 if (psInfo->hasFinish)
1013 x += padding.x + buttonWidth;
1014
1015 SetWindowPos(hwndButton, 0, x, y, 0, 0,
1017
1018 if (!psInfo->hasFinish)
1019 ShowWindow(hwndButton, SW_HIDE);
1020
1021 /*
1022 * Position the Cancel button.
1023 */
1024 hwndButton = GetDlgItem(hwndParent, IDCANCEL);
1025
1026 x += padding.x + buttonWidth;
1027
1028 SetWindowPos(hwndButton, 0, x, y, 0, 0,
1030
1031 /*
1032 * Position Help button.
1033 */
1034 hwndButton = GetDlgItem(hwndParent, IDHELP);
1035
1036 if (psInfo->hasHelp)
1037 {
1038 x += padding.x + buttonWidth;
1039
1040 SetWindowPos(hwndButton, 0, x, y, 0, 0,
1042 }
1043 else
1044 ShowWindow(hwndButton, SW_HIDE);
1045
1046 if (psInfo->ppshheader.dwFlags &
1047 (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE))
1048 padding.x = 0;
1049
1050 /*
1051 * Position and resize the sunken line.
1052 */
1053 x = padding.x;
1054 y = rcSheet.bottom - ((padding.y * 2) + buttonHeight + lineHeight);
1055
1056 lineWidth = rcSheet.right - (padding.x * 2);
1057 SetWindowPos(hwndLine, 0, x, y, lineWidth, 2,
1059
1060 /*
1061 * Position and resize the header sunken line.
1062 */
1063
1064 SetWindowPos(hwndLineHeader, 0, 0, 0, rcSheet.right, 2,
1066 if (!(psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)))
1067 ShowWindow(hwndLineHeader, SW_HIDE);
1068
1069 return TRUE;
1070}
#define IDC_NEXT_BUTTON
Definition: comctl32.h:56
#define IDC_SUNKEN_LINEHEADER
Definition: comctl32.h:59
#define IDC_FINISH_BUTTON
Definition: comctl32.h:57
#define IDC_BACK_BUTTON
Definition: comctl32.h:55
#define IDC_SUNKEN_LINE
Definition: comctl32.h:58
static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheetInfo *psInfo)
Definition: propsheet.c:1104
DWORD dwFlags
Definition: prsht.h:294
#define SWP_NOMOVE
Definition: winuser.h:1255

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_AdjustSize()

static BOOL PROPSHEET_AdjustSize ( HWND  hwndDlg,
PropSheetInfo psInfo 
)
static

Definition at line 745 of file propsheet.c.

746{
747 HWND hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
748 HWND hwndButton = GetDlgItem(hwndDlg, IDOK);
749 RECT rc,tabRect;
750 int buttonHeight;
752 RECT units;
753 LONG style;
754
755 /* Get the height of buttons */
756 GetClientRect(hwndButton, &rc);
757 buttonHeight = rc.bottom;
758
759 /*
760 * Biggest page size.
761 */
762 SetRect(&rc, 0, 0, psInfo->width, psInfo->height);
763 MapDialogRect(hwndDlg, &rc);
764
765 /* retrieve the dialog units */
766 units.left = units.right = 4;
767 units.top = units.bottom = 8;
768 MapDialogRect(hwndDlg, &units);
769
770 /*
771 * Resize the tab control.
772 */
773 GetClientRect(hwndTabCtrl,&tabRect);
774
775 SendMessageW(hwndTabCtrl, TCM_ADJUSTRECT, FALSE, (LPARAM)&tabRect);
776
777 if ((rc.bottom - rc.top) < (tabRect.bottom - tabRect.top))
778 {
779 rc.bottom = rc.top + tabRect.bottom - tabRect.top;
780 psInfo->height = MulDiv((rc.bottom - rc.top),8,units.top);
781 }
782
783 if ((rc.right - rc.left) < (tabRect.right - tabRect.left))
784 {
785 rc.right = rc.left + tabRect.right - tabRect.left;
786 psInfo->width = MulDiv((rc.right - rc.left),4,units.left);
787 }
788
789 SendMessageW(hwndTabCtrl, TCM_ADJUSTRECT, TRUE, (LPARAM)&rc);
790
791 rc.right -= rc.left;
792 rc.bottom -= rc.top;
793 TRACE("setting tab %p, rc (0,0)-(%d,%d)\n",
794 hwndTabCtrl, rc.right, rc.bottom);
795 SetWindowPos(hwndTabCtrl, 0, 0, 0, rc.right, rc.bottom,
797
798 GetClientRect(hwndTabCtrl, &rc);
799
800 TRACE("tab client rc %s\n", wine_dbgstr_rect(&rc));
801
802 rc.right += (padding.x * 2);
803 rc.bottom += buttonHeight + (3 * padding.y);
804
805 style = GetWindowLongW(hwndDlg, GWL_STYLE);
806 if (!(style & WS_CHILD))
808
809 rc.right -= rc.left;
810 rc.bottom -= rc.top;
811
812 /*
813 * Resize the property sheet.
814 */
815 TRACE("setting dialog %p, rc (0,0)-(%d,%d)\n",
816 hwndDlg, rc.right, rc.bottom);
817 SetWindowPos(hwndDlg, 0, 0, 0, rc.right, rc.bottom,
819 return TRUE;
820}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define IDC_TABCONTROL
Definition: comctl32.h:53
GLfloat units
Definition: glext.h:11727
LONG_PTR LPARAM
Definition: minwindef.h:175
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
#define WS_CHILD
Definition: pedump.c:617
long LONG
Definition: pedump.c:60
#define TCM_ADJUSTRECT
Definition: commctrl.h:4090
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
BOOL WINAPI MapDialogRect(_In_ HWND, _Inout_ LPRECT)
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define GWL_STYLE
Definition: winuser.h:863
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_AdjustSizeWizard()

static BOOL PROPSHEET_AdjustSizeWizard ( HWND  hwndDlg,
const PropSheetInfo psInfo 
)
static

Definition at line 827 of file propsheet.c.

828{
829 HWND hwndLine = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE);
830 RECT rc, lineRect, dialogRect;
831
832 /* Biggest page size */
833 SetRect(&rc, 0, 0, psInfo->width, psInfo->height);
834 MapDialogRect(hwndDlg, &rc);
835
836 TRACE("Biggest page %s\n", wine_dbgstr_rect(&rc));
837
838 /* Add space for the buttons row */
839 GetWindowRect(hwndLine, &lineRect);
840 MapWindowPoints(NULL, hwndDlg, (LPPOINT)&lineRect, 2);
841 GetClientRect(hwndDlg, &dialogRect);
842 rc.bottom += dialogRect.bottom - lineRect.top - 1;
843
844 /* Convert the client coordinates to window coordinates */
846
847 /* Resize the property sheet */
848 TRACE("setting dialog %p, rc (0,0)-(%d,%d)\n",
849 hwndDlg, rc.right, rc.bottom);
850 SetWindowPos(hwndDlg, 0, 0, 0, rc.right - rc.left, rc.bottom - rc.top,
852
853 return TRUE;
854}
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_Apply()

static BOOL PROPSHEET_Apply ( HWND  hwndDlg,
LPARAM  lParam 
)
static

Definition at line 1737 of file propsheet.c.

1738{
1739 int i;
1740 HWND hwndPage;
1741 PSHNOTIFY psn;
1742 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1743
1744 TRACE("active_page %d\n", psInfo->active_page);
1745 if (psInfo->active_page < 0)
1746 return FALSE;
1747
1748 psn.hdr.hwndFrom = hwndDlg;
1749 psn.hdr.idFrom = 0;
1750 psn.lParam = 0;
1751
1752
1753 /*
1754 * Send PSN_KILLACTIVE to the current page.
1755 */
1756 psn.hdr.code = PSN_KILLACTIVE;
1757
1758 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1759
1760 if (SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn) != FALSE)
1761 return FALSE;
1762
1763 /*
1764 * Send PSN_APPLY to all pages.
1765 */
1766 psn.hdr.code = PSN_APPLY;
1767 psn.lParam = lParam;
1768
1769 for (i = 0; i < psInfo->nPages; i++)
1770 {
1771 hwndPage = psInfo->proppage[i].hwndPage;
1772 if (hwndPage)
1773 {
1774 switch (SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn))
1775 {
1776 case PSNRET_INVALID:
1777 PROPSHEET_ShowPage(hwndDlg, i, psInfo);
1778 /* fall through */
1780 return FALSE;
1781 }
1782 }
1783 }
1784
1785 if(lParam)
1786 {
1787 psInfo->activeValid = FALSE;
1788 }
1789 else if(psInfo->active_page >= 0)
1790 {
1791 psn.hdr.code = PSN_SETACTIVE;
1792 psn.lParam = 0;
1793 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1794 SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1795#ifdef __REACTOS__
1796 PROPSHEET_SetInitialFocus(hwndPage, psInfo->active_page, psInfo);
1797#endif
1798 }
1799
1800 return TRUE;
1801}
LPARAM lParam
Definition: combotst.c:139
static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo *psInfo)
Definition: propsheet.c:1545
#define PSNRET_INVALID_NOCHANGEPAGE
Definition: prsht.h:131
#define PSNRET_INVALID
Definition: prsht.h:130
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define PSN_APPLY
Definition: prsht.h:117
#define PSN_SETACTIVE
Definition: prsht.h:115
#define WM_NOTIFY
Definition: richedit.h:61
LPARAM lParam
Definition: prsht.h:331
NMHDR hdr
Definition: prsht.h:330
UINT_PTR idFrom
Definition: winuser.h:3266
UINT code
Definition: winuser.h:3267
HWND hwndFrom
Definition: winuser.h:3265

Referenced by PROPSHEET_DialogProc(), and PROPSHEET_DoCommand().

◆ PROPSHEET_Back()

static BOOL PROPSHEET_Back ( HWND  hwndDlg)
static

Definition at line 1614 of file propsheet.c.

1615{
1616 PSHNOTIFY psn;
1617 HWND hwndPage;
1618 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1620 int idx;
1621
1622 TRACE("active_page %d\n", psInfo->active_page);
1623 if (psInfo->active_page < 0)
1624 return FALSE;
1625
1626 psn.hdr.code = PSN_WIZBACK;
1627 psn.hdr.hwndFrom = hwndDlg;
1628 psn.hdr.idFrom = 0;
1629 psn.lParam = 0;
1630
1631 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1632
1633 result = SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1634 if (result == -1)
1635 return FALSE;
1636 else if (result == 0)
1637 idx = psInfo->active_page - 1;
1638 else
1640
1641 if (idx >= 0 && idx < psInfo->nPages)
1642 {
1643 if (PROPSHEET_CanSetCurSel(hwndDlg))
1644 {
1647 PROPSHEET_SetCurSel(hwndDlg, idx, -1, 0);
1648 }
1649 }
1650 return TRUE;
1651}
unsigned int idx
Definition: utils.c:41
static INT PROPSHEET_FindPageByResId(const PropSheetInfo *psInfo, LRESULT resId)
Definition: propsheet.c:296
static BOOL PROPSHEET_SetCurSel(HWND hwndDlg, int index, int skipdir, HPROPSHEETPAGE hpage)
Definition: propsheet.c:2015
static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg)
Definition: propsheet.c:1976
GLuint64EXT * result
Definition: glext.h:11304
LONG_PTR LRESULT
Definition: minwindef.h:176
#define PSN_WIZBACK
Definition: prsht.h:120
HWND WINAPI SetFocus(_In_opt_ HWND)

Referenced by PROPSHEET_DoCommand(), and PROPSHEET_PressButton().

◆ PROPSHEET_Cancel()

static void PROPSHEET_Cancel ( HWND  hwndDlg,
LPARAM  lParam 
)
static

Definition at line 1806 of file propsheet.c.

1807{
1808 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1809 HWND hwndPage;
1810 PSHNOTIFY psn;
1811 int i;
1812
1813 TRACE("active_page %d\n", psInfo->active_page);
1814 if (psInfo->active_page < 0)
1815 return;
1816
1817 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1818 psn.hdr.code = PSN_QUERYCANCEL;
1819 psn.hdr.hwndFrom = hwndDlg;
1820 psn.hdr.idFrom = 0;
1821 psn.lParam = 0;
1822
1823 if (SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn))
1824 return;
1825
1826 psn.hdr.code = PSN_RESET;
1827 psn.lParam = lParam;
1828
1829 for (i = 0; i < psInfo->nPages; i++)
1830 {
1831 hwndPage = psInfo->proppage[i].hwndPage;
1832
1833 if (hwndPage)
1834 SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1835 }
1836
1837 if (psInfo->isModeless)
1838 {
1839 /* makes PSM_GETCURRENTPAGEHWND return NULL */
1840 psInfo->activeValid = FALSE;
1841 }
1842 else
1843 psInfo->ended = TRUE;
1844}
#define PSN_QUERYCANCEL
Definition: prsht.h:123
#define PSN_RESET
Definition: prsht.h:118

Referenced by PROPSHEET_DialogProc(), and PROPSHEET_DoCommand().

◆ PROPSHEET_CanSetCurSel()

static BOOL PROPSHEET_CanSetCurSel ( HWND  hwndDlg)
static

Definition at line 1976 of file propsheet.c.

1977{
1978 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1979 HWND hwndPage;
1980 PSHNOTIFY psn;
1981 BOOL res = FALSE;
1982
1983 if (!psInfo)
1984 {
1985 res = FALSE;
1986 goto end;
1987 }
1988
1989 TRACE("active_page %d\n", psInfo->active_page);
1990 if (psInfo->active_page < 0)
1991 {
1992 res = TRUE;
1993 goto end;
1994 }
1995
1996 /*
1997 * Notify the current page.
1998 */
1999 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
2000 psn.hdr.code = PSN_KILLACTIVE;
2001 psn.hdr.hwndFrom = hwndDlg;
2002 psn.hdr.idFrom = 0;
2003 psn.lParam = 0;
2004
2005 res = !SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
2006
2007end:
2008 TRACE("<-- %d\n", res);
2009 return res;
2010}
GLuint GLuint end
Definition: gl.h:1545
GLuint res
Definition: glext.h:9613

Referenced by PROPSHEET_Back(), PROPSHEET_DialogProc(), PROPSHEET_IsDialogMessage(), PROPSHEET_Next(), and PROPSHEET_SetCurSelId().

◆ PROPSHEET_Changed()

static void PROPSHEET_Changed ( HWND  hwndDlg,
HWND  hwndDirtyPage 
)
static

Definition at line 1871 of file propsheet.c.

1872{
1873 int i;
1874 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1875
1876 TRACE("\n");
1877 if (!psInfo) return;
1878 /*
1879 * Set the dirty flag of this page.
1880 */
1881 for (i = 0; i < psInfo->nPages; i++)
1882 {
1883 if (psInfo->proppage[i].hwndPage == hwndDirtyPage)
1884 psInfo->proppage[i].isDirty = TRUE;
1885 }
1886
1887 /*
1888 * Enable the Apply button.
1889 */
1890 if (psInfo->hasApply)
1891 {
1892 HWND hwndApplyBtn = GetDlgItem(hwndDlg, IDC_APPLY_BUTTON);
1893
1894 EnableWindow(hwndApplyBtn, TRUE);
1895 }
1896}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_CleanUp()

static void PROPSHEET_CleanUp ( HWND  hwndDlg)
static

Definition at line 2778 of file propsheet.c.

2779{
2780 int i;
2781 PropSheetInfo* psInfo = RemovePropW(hwndDlg, PropSheetInfoStr);
2782
2783 TRACE("\n");
2784 if (!psInfo) return;
2785 if (!IS_INTRESOURCE(psInfo->ppshheader.pszCaption))
2786 Free ((LPVOID)psInfo->ppshheader.pszCaption);
2787
2788 for (i = 0; i < psInfo->nPages; i++)
2789 {
2790 PROPSHEETPAGEA* psp = (PROPSHEETPAGEA*)psInfo->proppage[i].hpage;
2791
2792 /* Unsubclass the page dialog window */
2793 if((psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD)) &&
2794 (psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
2795 (psp->dwFlags & PSP_HIDEHEADER))
2796 {
2799 }
2800
2801 if(psInfo->proppage[i].hwndPage)
2802 DestroyWindow(psInfo->proppage[i].hwndPage);
2803
2804 if(psp)
2805 {
2806 if (psp->dwFlags & PSP_USETITLE)
2807 Free ((LPVOID)psInfo->proppage[i].pszText);
2808
2810 }
2811 }
2812
2813 DeleteObject(psInfo->hFont);
2814 DeleteObject(psInfo->hFontBold);
2815 /* If we created the bitmaps, destroy them */
2816 if ((psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
2817 (!(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK)) )
2818 DeleteObject(psInfo->ppshheader.u4.hbmWatermark);
2819 if ((psInfo->ppshheader.dwFlags & PSH_HEADER) &&
2820 (!(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER)) )
2821 DeleteObject(psInfo->ppshheader.u5.hbmHeader);
2822
2823 Free(psInfo->proppage);
2824 Free(psInfo->strPropertiesFor);
2826
2827 GlobalFree(psInfo);
2828}
BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
Definition: commctrl.c:1401
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
static LRESULT CALLBACK PROPSHEET_WizardSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uID, DWORD_PTR dwRef)
Definition: propsheet.c:1209
pKey DeleteObject()
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
LPCWSTR pszCaption
Definition: prsht.h:301
LPCWSTR pszText
Definition: propsheet.c:100
HIMAGELIST hImageList
Definition: propsheet.c:126
LPWSTR strPropertiesFor
Definition: propsheet.c:111
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_CollectPageInfo()

static BOOL PROPSHEET_CollectPageInfo ( LPCPROPSHEETPAGEW  lppsp,
PropSheetInfo psInfo,
int  index,
BOOL  resize 
)
static

Definition at line 421 of file propsheet.c.

424{
425 const DLGTEMPLATE* pTemplate;
426 const WORD* p;
428 int width, height;
429
430 if (!lppsp)
431 return FALSE;
432
433 TRACE("\n");
434 psInfo->proppage[index].hpage = (HPROPSHEETPAGE)lppsp;
435 psInfo->proppage[index].hwndPage = 0;
436 psInfo->proppage[index].isDirty = FALSE;
437
438 /*
439 * Process property page flags.
440 */
441 dwFlags = lppsp->dwFlags;
442 psInfo->proppage[index].useCallback = (dwFlags & PSP_USECALLBACK) && (lppsp->pfnCallback);
445
446 /* as soon as we have a page with the help flag, set the sheet flag on */
447 if (psInfo->proppage[index].hasHelp)
448 psInfo->hasHelp = TRUE;
449
450 /*
451 * Process page template.
452 */
454 pTemplate = lppsp->u.pResource;
455 else if(dwFlags & PSP_INTERNAL_UNICODE )
456 {
457 HRSRC hResource = FindResourceW(lppsp->hInstance,
458 lppsp->u.pszTemplate,
460 HGLOBAL hTemplate = LoadResource(lppsp->hInstance,
461 hResource);
462 pTemplate = LockResource(hTemplate);
463 }
464 else
465 {
466 HRSRC hResource = FindResourceA(lppsp->hInstance,
467 (LPCSTR)lppsp->u.pszTemplate,
469 HGLOBAL hTemplate = LoadResource(lppsp->hInstance,
470 hResource);
471 pTemplate = LockResource(hTemplate);
472 }
473
474 /*
475 * Extract the size of the page and the caption.
476 */
477 if (!pTemplate)
478 return FALSE;
479
480 p = (const WORD *)pTemplate;
481
482 if (((const MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF)
483 {
484 /* DLGTEMPLATEEX (not defined in any std. header file) */
485
486 p++; /* dlgVer */
487 p++; /* signature */
488 p += 2; /* help ID */
489 p += 2; /* ext style */
490 p += 2; /* style */
491 }
492 else
493 {
494 /* DLGTEMPLATE */
495
496 p += 2; /* style */
497 p += 2; /* ext style */
498 }
499
500 p++; /* nb items */
501 p++; /* x */
502 p++; /* y */
503 width = (WORD)*p; p++;
504 height = (WORD)*p; p++;
505
506 if (lppsp->dwFlags & (PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE))
507 psInfo->ppshheader.dwFlags |= PSH_HEADER;
508
509 /* Special calculation for interior wizard pages so the largest page is
510 * calculated correctly. We need to add all the padding and space occupied
511 * by the header so the width and height sums up to the whole wizard client
512 * area. */
513 if ((psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) &&
514 (psInfo->ppshheader.dwFlags & PSH_HEADER) &&
515 !(dwFlags & PSP_HIDEHEADER))
516 {
518 width += 2 * WIZARD_PADDING;
519 }
520 if (psInfo->ppshheader.dwFlags & PSH_WIZARD)
521 {
522 height += 2 * WIZARD_PADDING;
523 width += 2 * WIZARD_PADDING;
524 }
525
526 /* remember the largest width and height */
527 if (resize)
528 {
529 if (width > psInfo->width)
530 psInfo->width = width;
531
532 if (height > psInfo->height)
533 psInfo->height = height;
534 }
535
536 /* menu */
537 switch ((WORD)*p)
538 {
539 case 0x0000:
540 p++;
541 break;
542 case 0xffff:
543 p += 2;
544 break;
545 default:
546 p += lstrlenW( p ) + 1;
547 break;
548 }
549
550 /* class */
551 switch ((WORD)*p)
552 {
553 case 0x0000:
554 p++;
555 break;
556 case 0xffff:
557 p += 2;
558 break;
559 default:
560 p += lstrlenW( p ) + 1;
561 break;
562 }
563
564 /* Extract the caption */
565 psInfo->proppage[index].pszText = p;
566 TRACE("Tab %d %s\n",index,debugstr_w( p ));
567
568 if (dwFlags & PSP_USETITLE)
569 {
570 WCHAR szTitle[256];
571 const WCHAR *pTitle;
572 static const WCHAR pszNull[] = { '(','n','u','l','l',')',0 };
573
574 if (IS_INTRESOURCE( lppsp->pszTitle ))
575 {
577 pTitle = szTitle;
578 else if (*p)
579 pTitle = p;
580 else
581 pTitle = pszNull;
582 }
583 else
584 pTitle = lppsp->pszTitle;
585
586 psInfo->proppage[index].pszText = heap_strdupW( pTitle );
587 }
588
589 /*
590 * Build the image list for icons
591 */
593 {
594 HICON hIcon;
595 int icon_cx = GetSystemMetrics(SM_CXSMICON);
596 int icon_cy = GetSystemMetrics(SM_CYSMICON);
597
599 hIcon = LoadImageW(lppsp->hInstance, lppsp->u2.pszIcon, IMAGE_ICON,
600 icon_cx, icon_cy, LR_DEFAULTCOLOR);
601 else
602 hIcon = lppsp->u2.hIcon;
603
604 if ( hIcon )
605 {
606 if (psInfo->hImageList == 0 )
607 psInfo->hImageList = ImageList_Create(icon_cx, icon_cy, ILC_COLOR, 1, 1);
608
610 }
611
612 }
613
614 return TRUE;
615}
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
#define WIZARD_HEADER_HEIGHT
Definition: propsheet.c:154
#define WIZARD_PADDING
Definition: propsheet.c:153
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint index
Definition: glext.h:6031
if(dx< 0)
Definition: linetemp.h:194
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
static HICON
Definition: imagelist.c:80
HICON hIcon
Definition: msconfig.c:44
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
#define RT_DIALOG
Definition: pedump.c:367
#define PSP_HASHELP
Definition: prsht.h:28
#define PSP_USEHICON
Definition: prsht.h:24
#define PSH_WIZARD
Definition: prsht.h:45
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define ILC_COLOR
Definition: commctrl.h:352
#define LoadStringW
Definition: utils.h:64
HICON hIcon
Definition: prsht.h:222
LPCDLGTEMPLATE pResource
Definition: prsht.h:219
const char * LPCSTR
Definition: typedefs.h:52
char * LPSTR
Definition: typedefs.h:51
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2572
#define SM_CYSMICON
Definition: winuser.h:1024
#define SM_CXSMICON
Definition: winuser.h:1023
#define LR_DEFAULTCOLOR
Definition: winuser.h:1098
int WINAPI GetSystemMetrics(_In_ int)

Referenced by PropertySheetA(), PropertySheetW(), and PROPSHEET_InsertPage().

◆ PROPSHEET_CollectSheetInfoA()

static void PROPSHEET_CollectSheetInfoA ( LPCPROPSHEETHEADERA  lppsh,
PropSheetInfo psInfo 
)
static

Definition at line 339 of file propsheet.c.

341{
342 DWORD dwSize = min(lppsh->dwSize,sizeof(PROPSHEETHEADERA));
343 DWORD dwFlags = lppsh->dwFlags;
344
345 psInfo->useCallback = (dwFlags & PSH_USECALLBACK )&& (lppsh->pfnCallback);
346
347 memcpy(&psInfo->ppshheader,lppsh,dwSize);
348 TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%d\ndwFlags\t\t%08x\nhwndParent\t%p\nhInstance\t%p\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
349 lppsh->dwSize, lppsh->dwFlags, lppsh->hwndParent, lppsh->hInstance,
350 debugstr_a(lppsh->pszCaption), lppsh->nPages, lppsh->pfnCallback);
351
352 if (lppsh->dwFlags & INTRNL_ANY_WIZARD)
353 psInfo->ppshheader.pszCaption = NULL;
354 else
355 {
356 if (!IS_INTRESOURCE(lppsh->pszCaption))
357 {
358 int len = MultiByteToWideChar(CP_ACP, 0, lppsh->pszCaption, -1, NULL, 0);
359 WCHAR *caption = Alloc( len*sizeof (WCHAR) );
360
361 MultiByteToWideChar(CP_ACP, 0, lppsh->pszCaption, -1, caption, len);
362 psInfo->ppshheader.pszCaption = caption;
363 }
364 }
365 psInfo->nPages = lppsh->nPages;
366
368 {
369 TRACE("PSH_USEPSTARTPAGE is on\n");
370 psInfo->active_page = 0;
371 }
372 else
373 psInfo->active_page = lppsh->u2.nStartPage;
374
376}
#define INTRNL_ANY_WIZARD
Definition: propsheet.c:150
static void PROPSHEET_CollectSheetInfoCommon(PropSheetInfo *psInfo, DWORD dwFlags)
Definition: propsheet.c:317
#define debugstr_a
Definition: kernel32.h:31
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define PSH_USEPSTARTPAGE
Definition: prsht.h:46
#define PSH_USECALLBACK
Definition: prsht.h:48
DWORD dwFlags
Definition: prsht.h:259
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:276
DWORD dwSize
Definition: prsht.h:258
HINSTANCE hInstance
Definition: prsht.h:261
HWND hwndParent
Definition: prsht.h:260
UINT nStartPage
Definition: prsht.h:269
LPCSTR pszCaption
Definition: prsht.h:266

Referenced by PropertySheetA().

◆ PROPSHEET_CollectSheetInfoCommon()

static void PROPSHEET_CollectSheetInfoCommon ( PropSheetInfo psInfo,
DWORD  dwFlags 
)
static

Definition at line 317 of file propsheet.c.

318{
320
321 psInfo->hasHelp = dwFlags & PSH_HASHELP;
322 psInfo->hasApply = !(dwFlags & PSH_NOAPPLYNOW);
324 psInfo->isModeless = dwFlags & PSH_MODELESS;
326 if (psInfo->active_page < 0 || psInfo->active_page >= psInfo->nPages)
327 psInfo->active_page = 0;
328
329 psInfo->result = 0;
330 psInfo->hImageList = 0;
331 psInfo->activeValid = FALSE;
332}
static VOID PROPSHEET_UnImplementedFlags(DWORD dwFlags)
Definition: propsheet.c:226
#define PSH_MODELESS
Definition: prsht.h:50
#define PSH_HASHELP
Definition: prsht.h:49
#define PSH_WIZARDHASFINISH
Definition: prsht.h:44
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_NOAPPLYNOW
Definition: prsht.h:47

Referenced by PROPSHEET_CollectSheetInfoA(), and PROPSHEET_CollectSheetInfoW().

◆ PROPSHEET_CollectSheetInfoW()

static void PROPSHEET_CollectSheetInfoW ( LPCPROPSHEETHEADERW  lppsh,
PropSheetInfo psInfo 
)
static

Definition at line 383 of file propsheet.c.

385{
386 DWORD dwSize = min(lppsh->dwSize,sizeof(PROPSHEETHEADERW));
387 DWORD dwFlags = lppsh->dwFlags;
388
389 psInfo->useCallback = (dwFlags & PSH_USECALLBACK) && (lppsh->pfnCallback);
390
391 memcpy(&psInfo->ppshheader,lppsh,dwSize);
392 TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%d\ndwFlags\t\t%08x\nhwndParent\t%p\nhInstance\t%p\npszCaption\t%s\nnPages\t\t%d\npfnCallback\t%p\n",
393 lppsh->dwSize, lppsh->dwFlags, lppsh->hwndParent, lppsh->hInstance, debugstr_w(lppsh->pszCaption), lppsh->nPages, lppsh->pfnCallback);
394
395 if (lppsh->dwFlags & INTRNL_ANY_WIZARD)
396 psInfo->ppshheader.pszCaption = NULL;
397 else
398 {
399 if (!IS_INTRESOURCE(lppsh->pszCaption))
400 psInfo->ppshheader.pszCaption = heap_strdupW( lppsh->pszCaption );
401 }
402 psInfo->nPages = lppsh->nPages;
403
405 {
406 TRACE("PSH_USEPSTARTPAGE is on\n");
407 psInfo->active_page = 0;
408 }
409 else
410 psInfo->active_page = lppsh->u2.nStartPage;
411
413}
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
UINT nStartPage
Definition: prsht.h:304

Referenced by PropertySheetW().

◆ PROPSHEET_CreateDialog()

static INT_PTR PROPSHEET_CreateDialog ( PropSheetInfo psInfo)
static

Definition at line 622 of file propsheet.c.

623{
624 LRESULT ret;
625 LPCVOID template;
626 LPVOID temp = 0;
627 HRSRC hRes;
628 DWORD resSize;
629 WORD resID = IDD_PROPSHEET;
630
631 TRACE("(%p)\n", psInfo);
633 resID = IDD_WIZARD;
634
635 if( psInfo->unicode )
636 {
638 MAKEINTRESOURCEW(resID),
639 (LPWSTR)RT_DIALOG)))
640 return -1;
641 }
642 else
643 {
645 MAKEINTRESOURCEA(resID),
646 (LPSTR)RT_DIALOG)))
647 return -1;
648 }
649
650 if(!(template = LoadResource(COMCTL32_hModule, hRes)))
651 return -1;
652
653 /*
654 * Make a copy of the dialog template.
655 */
656 resSize = SizeofResource(COMCTL32_hModule, hRes);
657
658 temp = Alloc(2 * resSize);
659
660 if (!temp)
661 return -1;
662
663 memcpy(temp, template, resSize);
664
665 if (psInfo->ppshheader.dwFlags & PSH_NOCONTEXTHELP)
666 {
667 if (((MyDLGTEMPLATEEX*)temp)->signature == 0xFFFF)
668 ((MyDLGTEMPLATEEX*)temp)->style &= ~DS_CONTEXTHELP;
669 else
671 }
672 if ((psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) &&
674 {
675 if (((MyDLGTEMPLATEEX*)temp)->signature == 0xFFFF)
676 ((MyDLGTEMPLATEEX*)temp)->style |= DS_CONTEXTHELP;
677 else
679 }
680
681 if (psInfo->useCallback)
683
684 /* NOTE: MSDN states "Returns a positive value if successful, or -1
685 * otherwise for modal property sheets.", but this is wrong. The
686 * actual return value is either TRUE (success), FALSE (cancel) or
687 * -1 (error). */
688 if( psInfo->unicode )
689 {
691 temp, psInfo->ppshheader.hwndParent,
693 if ( !ret ) ret = -1;
694 }
695 else
696 {
698 temp, psInfo->ppshheader.hwndParent,
700 if ( !ret ) ret = -1;
701 }
702
703 Free(temp);
704
705 return ret;
706}
#define IDD_WIZARD
Definition: comctl32.h:51
#define IDD_PROPSHEET
Definition: comctl32.h:50
HMODULE COMCTL32_hModule
Definition: commctrl.c:79
static INT_PTR CALLBACK PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.c:3542
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
CONST void * LPCVOID
Definition: minwindef.h:164
#define PSCB_PRECREATE
Definition: prsht.h:76
#define PSH_WIZARDCONTEXTHELP
Definition: prsht.h:52
static calc_node_t temp
Definition: rpn_ieee.c:38
int32_t INT_PTR
Definition: typedefs.h:64
HWND WINAPI CreateDialogIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define DS_CONTEXTHELP
Definition: winuser.h:371
HWND WINAPI CreateDialogIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)

Referenced by PROPSHEET_PropertySheet().

◆ PROPSHEET_CreatePage()

static BOOL PROPSHEET_CreatePage ( HWND  hwndParent,
int  index,
const PropSheetInfo psInfo,
LPCPROPSHEETPAGEW  ppshpage 
)
static

Definition at line 1366 of file propsheet.c.

1370{
1371 const DLGTEMPLATE* pTemplate;
1372 HWND hwndPage;
1373 DWORD resSize;
1374 DLGTEMPLATE* pTemplateCopy = NULL;
1375
1376 TRACE("index %d\n", index);
1377
1378 if (ppshpage == NULL)
1379 {
1380 return FALSE;
1381 }
1382
1383 if (ppshpage->dwFlags & PSP_DLGINDIRECT)
1384 {
1385 pTemplate = ppshpage->u.pResource;
1386 resSize = GetTemplateSize(pTemplate);
1387 }
1388 else if(ppshpage->dwFlags & PSP_INTERNAL_UNICODE)
1389 {
1390 HRSRC hResource;
1391 HANDLE hTemplate;
1392
1393 hResource = FindResourceW(ppshpage->hInstance,
1394 ppshpage->u.pszTemplate,
1395 (LPWSTR)RT_DIALOG);
1396 if(!hResource)
1397 return FALSE;
1398
1399 resSize = SizeofResource(ppshpage->hInstance, hResource);
1400
1401 hTemplate = LoadResource(ppshpage->hInstance, hResource);
1402 if(!hTemplate)
1403 return FALSE;
1404
1405 pTemplate = LockResource(hTemplate);
1406 /*
1407 * Make a copy of the dialog template to make it writable
1408 */
1409 }
1410 else
1411 {
1412 HRSRC hResource;
1413 HANDLE hTemplate;
1414
1415 hResource = FindResourceA(ppshpage->hInstance,
1416 (LPCSTR)ppshpage->u.pszTemplate,
1417 (LPSTR)RT_DIALOG);
1418 if(!hResource)
1419 return FALSE;
1420
1421 resSize = SizeofResource(ppshpage->hInstance, hResource);
1422
1423 hTemplate = LoadResource(ppshpage->hInstance, hResource);
1424 if(!hTemplate)
1425 return FALSE;
1426
1427 pTemplate = LockResource(hTemplate);
1428 /*
1429 * Make a copy of the dialog template to make it writable
1430 */
1431 }
1432 pTemplateCopy = Alloc(resSize);
1433 if (!pTemplateCopy)
1434 return FALSE;
1435
1436 TRACE("copying pTemplate %p into pTemplateCopy %p (%d)\n", pTemplate, pTemplateCopy, resSize);
1437 memcpy(pTemplateCopy, pTemplate, resSize);
1438
1439 if (((MyDLGTEMPLATEEX*)pTemplateCopy)->signature == 0xFFFF)
1440 {
1441 ((MyDLGTEMPLATEEX*)pTemplateCopy)->style |= WS_CHILD | WS_TABSTOP | DS_CONTROL;
1442 ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~DS_MODALFRAME;
1443 ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_CAPTION;
1444 ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_SYSMENU;
1445 ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_POPUP;
1446 ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_DISABLED;
1447 ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_VISIBLE;
1448 ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_THICKFRAME;
1449
1450 ((MyDLGTEMPLATEEX*)pTemplateCopy)->exStyle |= WS_EX_CONTROLPARENT;
1451 }
1452 else
1453 {
1454 pTemplateCopy->style |= WS_CHILD | WS_TABSTOP | DS_CONTROL;
1455 pTemplateCopy->style &= ~DS_MODALFRAME;
1456 pTemplateCopy->style &= ~WS_CAPTION;
1457 pTemplateCopy->style &= ~WS_SYSMENU;
1458 pTemplateCopy->style &= ~WS_POPUP;
1459 pTemplateCopy->style &= ~WS_DISABLED;
1460 pTemplateCopy->style &= ~WS_VISIBLE;
1461 pTemplateCopy->style &= ~WS_THICKFRAME;
1462
1463 pTemplateCopy->dwExtendedStyle |= WS_EX_CONTROLPARENT;
1464 }
1465
1466 if (psInfo->proppage[index].useCallback)
1467 (*(ppshpage->pfnCallback))(0, PSPCB_CREATE,
1468 (LPPROPSHEETPAGEW)ppshpage);
1469
1470 if(ppshpage->dwFlags & PSP_INTERNAL_UNICODE)
1471 hwndPage = CreateDialogIndirectParamW(ppshpage->hInstance,
1472 pTemplateCopy,
1473 hwndParent,
1474 ppshpage->pfnDlgProc,
1475 (LPARAM)ppshpage);
1476 else
1477 hwndPage = CreateDialogIndirectParamA(ppshpage->hInstance,
1478 pTemplateCopy,
1479 hwndParent,
1480 ppshpage->pfnDlgProc,
1481 (LPARAM)ppshpage);
1482 /* Free a no more needed copy */
1483 Free(pTemplateCopy);
1484
1485 if(!hwndPage)
1486 return FALSE;
1487
1488 psInfo->proppage[index].hwndPage = hwndPage;
1489
1490 /* Subclass exterior wizard pages */
1491 if((psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD)) &&
1492 (psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
1493 (ppshpage->dwFlags & PSP_HIDEHEADER))
1494 {
1495#ifdef __REACTOS__
1496 if (psInfo->ppshheader.u4.hbmWatermark)
1497#endif
1499 (DWORD_PTR)ppshpage);
1500 }
1501 if (!(psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD))
1503
1504#ifdef __REACTOS__
1506#endif
1507 return TRUE;
1508}
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
Definition: commctrl.c:1272
static void PROPSHEET_UnChanged(HWND hwndDlg, HWND hwndCleanPage)
Definition: propsheet.c:1901
static UINT GetTemplateSize(const DLGTEMPLATE *pTemplate)
Definition: propsheet.c:1231
#define ETDT_ENABLETAB
Definition: dxdiag.c:30
#define WS_TABSTOP
Definition: pedump.c:634
#define PSPCB_CREATE
Definition: prsht.h:38
struct _PROPSHEETPAGEW * LPPROPSHEETPAGEW
DLGPROC pfnDlgProc
Definition: prsht.h:226
HRESULT WINAPI EnableThemeDialogTexture(_In_ HWND hwnd, _In_ DWORD dwFlags)
Definition: uxthemesupp.c:55
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
#define DS_CONTROL
Definition: winuser.h:372

Referenced by PROPSHEET_InsertPage(), PROPSHEET_SetCurSel(), and PROPSHEET_ShowPage().

◆ PROPSHEET_CreateTabControl()

static BOOL PROPSHEET_CreateTabControl ( HWND  hwndParent,
const PropSheetInfo psInfo 
)
static

Definition at line 1159 of file propsheet.c.

1161{
1162 HWND hwndTabCtrl = GetDlgItem(hwndParent, IDC_TABCONTROL);
1163 TCITEMW item;
1164 int i, nTabs;
1165 int iImage = 0;
1166
1167 TRACE("\n");
1168 item.mask = TCIF_TEXT;
1169 item.cchTextMax = MAX_TABTEXT_LENGTH;
1170
1171 nTabs = psInfo->nPages;
1172
1173 /*
1174 * Set the image list for icons.
1175 */
1176 if (psInfo->hImageList)
1177 {
1178 SendMessageW(hwndTabCtrl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList);
1179 }
1180
1181 SendMessageW(hwndTabCtrl, WM_SETREDRAW, 0, 0);
1182 for (i = 0; i < nTabs; i++)
1183 {
1184 if ( psInfo->proppage[i].hasIcon )
1185 {
1186 item.mask |= TCIF_IMAGE;
1187 item.iImage = iImage++;
1188 }
1189 else
1190 {
1191 item.mask &= ~TCIF_IMAGE;
1192 }
1193
1194 item.pszText = (LPWSTR) psInfo->proppage[i].pszText;
1195 SendMessageW(hwndTabCtrl, TCM_INSERTITEMW, i, (LPARAM)&item);
1196 }
1197 SendMessageW(hwndTabCtrl, WM_SETREDRAW, 1, 0);
1198
1199 return TRUE;
1200}
#define MAX_TABTEXT_LENGTH
Definition: propsheet.c:147
#define TCM_SETIMAGELIST
Definition: commctrl.h:3970
#define TCM_INSERTITEMW
Definition: commctrl.h:4052
#define TCIF_TEXT
Definition: commctrl.h:3976
#define TCIF_IMAGE
Definition: commctrl.h:3977
#define WM_SETREDRAW
Definition: winuser.h:1644

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_DialogProc()

static INT_PTR CALLBACK PROPSHEET_DialogProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 3542 of file propsheet.c.

3543{
3544 TRACE("hwnd=%p msg=0x%04x wparam=%lx lparam=%lx\n",
3545 hwnd, uMsg, wParam, lParam);
3546
3547 switch (uMsg)
3548 {
3549 case WM_INITDIALOG:
3550 {
3551 PropSheetInfo* psInfo = (PropSheetInfo*) lParam;
3552 WCHAR* strCaption = Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR));
3553 HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL);
3554 int idx;
3555 LOGFONTW logFont;
3556
3557 /* Using PropSheetInfoStr to store extra data doesn't match the native
3558 * common control: native uses TCM_[GS]ETITEM
3559 */
3560 SetPropW(hwnd, PropSheetInfoStr, psInfo);
3561
3562 /*
3563 * psInfo->hwnd is not being used by WINE code - it exists
3564 * for compatibility with "real" Windoze. The same about
3565 * SetWindowLongPtr - WINE is only using the PropSheetInfoStr
3566 * property.
3567 */
3568 psInfo->hwnd = hwnd;
3570
3571 if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
3572 {
3573 /* set up the Next and Back buttons by default */
3575 }
3576
3577 /* Set up fonts */
3579 psInfo->hFont = CreateFontIndirectW (&logFont);
3580 logFont.lfWeight = FW_BOLD;
3581 psInfo->hFontBold = CreateFontIndirectW (&logFont);
3582
3583 /*
3584 * Small icon in the title bar.
3585 */
3586 if ((psInfo->ppshheader.dwFlags & PSH_USEICONID) ||
3587 (psInfo->ppshheader.dwFlags & PSH_USEHICON))
3588 {
3589 HICON hIcon;
3590 int icon_cx = GetSystemMetrics(SM_CXSMICON);
3591 int icon_cy = GetSystemMetrics(SM_CYSMICON);
3592
3593 if (psInfo->ppshheader.dwFlags & PSH_USEICONID)
3595 psInfo->ppshheader.u.pszIcon,
3596 IMAGE_ICON,
3597 icon_cx, icon_cy,
3599 else
3600 hIcon = psInfo->ppshheader.u.hIcon;
3601
3602 SendMessageW(hwnd, WM_SETICON, 0, (LPARAM)hIcon);
3603 }
3604
3605 if (psInfo->ppshheader.dwFlags & PSH_USEHICON)
3606 SendMessageW(hwnd, WM_SETICON, 0, (LPARAM)psInfo->ppshheader.u.hIcon);
3607
3608 psInfo->strPropertiesFor = strCaption;
3609
3611
3613
3615
3616 if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
3617 {
3618 ShowWindow(hwndTabCtrl, SW_HIDE);
3622 }
3623 else
3624 {
3625 if (PROPSHEET_SizeMismatch(hwnd, psInfo))
3626 {
3627 PROPSHEET_AdjustSize(hwnd, psInfo);
3629 }
3631 }
3632#ifdef __REACTOS__
3633 /* Move the window position if necessary */
3634 {
3635 INT dx, dy;
3636 RECT rcInit;
3638 BOOL bMove = FALSE;
3639
3640 GetWindowRect(hwnd, &rcInit);
3641 dx = rcInit.right - rcInit.left;
3642 dy = rcInit.bottom - rcInit.top;
3643
3644 if (IsWindow(hwndParent))
3645 {
3646 WINDOWPLACEMENT wndpl = { sizeof(wndpl) };
3647 bMove = TRUE;
3648
3649 /* hwndParent can be minimized (See Control_ShowAppletInTaskbar).
3650 Use normal position. */
3652 rcInit = wndpl.rcNormalPosition;
3654 {
3655 /* Is it Right-to-Left layout? */
3657 rcInit.left = rcInit.right - dx - GetSystemMetrics(SM_CXSMICON);
3658 else
3660
3661 rcInit.top += GetSystemMetrics(SM_CYSMICON);
3662 }
3663 }
3664 else
3665 {
3666 /* We cannot foresee CW_USEDEFAULT's position without communicating with USER32.
3667 Use a top-level STATIC control to get the proper position. */
3668 HWND hwndDummy = CreateWindowExW(0, WC_STATICW, NULL, 0,
3671 if (hwndDummy)
3672 {
3673 bMove = TRUE;
3674 GetWindowRect(hwndDummy, &rcInit);
3675 DestroyWindow(hwndDummy);
3676 }
3677 }
3678
3679 if (bMove)
3680 {
3681 MONITORINFO mi = { sizeof(mi) };
3682 HMONITOR hMonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
3683 if (GetMonitorInfo(hMonitor, &mi))
3684 {
3685 /* Try to fit it onto the desktop */
3686 if (mi.rcWork.right < rcInit.left + dx)
3687 rcInit.left = mi.rcWork.right - dx;
3688 if (mi.rcWork.bottom < rcInit.top + dy)
3689 rcInit.top = mi.rcWork.bottom - dy;
3690 if (rcInit.left < mi.rcWork.left)
3691 rcInit.left = mi.rcWork.left;
3692 if (rcInit.top < mi.rcWork.top)
3693 rcInit.top = mi.rcWork.top;
3694 SetWindowPos(hwnd, NULL, rcInit.left, rcInit.top, 0, 0,
3696 }
3697 }
3698 }
3699#endif
3700
3701 if (IS_INTRESOURCE(psInfo->ppshheader.pszCaption) &&
3702 psInfo->ppshheader.hInstance)
3703 {
3704 WCHAR szText[256];
3705
3706 if (LoadStringW(psInfo->ppshheader.hInstance,
3707 (UINT_PTR)psInfo->ppshheader.pszCaption, szText, 255))
3708 PROPSHEET_SetTitleW(hwnd, psInfo->ppshheader.dwFlags, szText);
3709 }
3710 else
3711 {
3713 psInfo->ppshheader.pszCaption);
3714 }
3715
3716
3717 if (psInfo->useCallback)
3718 (*(psInfo->ppshheader.pfnCallback))(hwnd, PSCB_INITIALIZED, 0);
3719
3720 idx = psInfo->active_page;
3721 psInfo->active_page = -1;
3722
3724
3725 /* doing TCM_SETCURSEL seems to be needed even in case of PSH_WIZARD,
3726 * as some programs call TCM_GETCURSEL to get the current selection
3727 * from which to switch to the next page */
3728 SendMessageW(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
3729
3731
3732 /* wizards set their focus during init */
3733 if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
3734 return FALSE;
3735
3736#ifdef __REACTOS__
3737 return FALSE;
3738#else
3739 return TRUE;
3740#endif
3741 }
3742
3743 case WM_PRINTCLIENT:
3744 case WM_PAINT:
3746 return TRUE;
3747
3748 case WM_DESTROY:
3750 return TRUE;
3751
3752 case WM_CLOSE:
3754 return FALSE; /* let DefDlgProc post us WM_COMMAND/IDCANCEL */
3755
3756 case WM_COMMAND:
3758 {
3760
3761 if (!psInfo)
3762 return FALSE;
3763
3764 /* No default handler, forward notification to active page */
3765 if (psInfo->activeValid && psInfo->active_page != -1)
3766 {
3767 HWND hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
3768 SendMessageW(hwndPage, WM_COMMAND, wParam, lParam);
3769 }
3770 }
3771 return TRUE;
3772
3773 case WM_NOTIFY:
3774 {
3775 NMHDR* pnmh = (LPNMHDR) lParam;
3776
3777 if (pnmh->code == TCN_SELCHANGE)
3778 {
3779 int index = SendMessageW(pnmh->hwndFrom, TCM_GETCURSEL, 0, 0);
3781 }
3782
3783 if(pnmh->code == TCN_SELCHANGING)
3784 {
3787 return TRUE;
3788 }
3789
3790 return FALSE;
3791 }
3792
3793 case WM_SYSCOLORCHANGE:
3795#ifndef __REACTOS__
3796 return FALSE;
3797#else
3798 case WM_DISPLAYCHANGE:
3799 case WM_WININICHANGE:
3800 {
3802 INT i;
3803 for (i = 0; i < psInfo->nPages; i++)
3804 {
3805 HWND hwndPage = psInfo->proppage[i].hwndPage;
3806 SendMessageW(hwndPage, uMsg, wParam, lParam);
3807 }
3809 return FALSE;
3810 }
3811#endif
3812
3813#ifdef __REACTOS__
3814 case WM_ENABLE:
3815 case WM_QUERYENDSESSION:
3816 case WM_ENDSESSION:
3817 case WM_DEVICECHANGE:
3818 {
3819 /* Send to the tab control, before forwarding it to the active page */
3822 }
3823 case WM_ACTIVATE:
3824 case WM_ACTIVATEAPP:
3825 {
3827 if (!psInfo)
3828 return FALSE;
3829
3830 /* Forward notification to active page */
3831 if (psInfo->activeValid && psInfo->active_page != -1)
3832 {
3833 HWND hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
3834 LRESULT msgResult = SendMessageW(hwndPage, uMsg, wParam, lParam);
3835 /* The message is handled, set the dialog return value
3836 * to whatever the page returned */
3838 return TRUE;
3839 }
3840 return FALSE;
3841 }
3842#endif // __REACTOS__
3843
3845 {
3847 HWND hwndPage = 0;
3848
3849 if (!psInfo)
3850 return FALSE;
3851
3852 if (psInfo->activeValid && psInfo->active_page != -1)
3853 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
3854
3856
3857 return TRUE;
3858 }
3859
3860 case PSM_CHANGED:
3862 return TRUE;
3863
3864 case PSM_UNCHANGED:
3866 return TRUE;
3867
3868 case PSM_GETTABCONTROL:
3869 {
3870 HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL);
3871
3873
3874 return TRUE;
3875 }
3876
3877 case PSM_SETCURSEL:
3878 {
3879 BOOL msgResult;
3880
3881 msgResult = PROPSHEET_CanSetCurSel(hwnd);
3882 if(msgResult != FALSE)
3883 {
3884 msgResult = PROPSHEET_SetCurSel(hwnd,
3885 (int)wParam,
3886 1,
3888 }
3889
3891
3892 return TRUE;
3893 }
3894
3895 case PSM_CANCELTOCLOSE:
3896 {
3898 HWND hwndOK = GetDlgItem(hwnd, IDOK);
3899 HWND hwndCancel = GetDlgItem(hwnd, IDCANCEL);
3900
3901 EnableWindow(hwndCancel, FALSE);
3903 SetWindowTextW(hwndOK, buf);
3904
3905 return FALSE;
3906 }
3907
3908 case PSM_RESTARTWINDOWS:
3909 {
3911
3912 if (!psInfo)
3913 return FALSE;
3914
3915 /* reboot system takes precedence over restart windows */
3916 if (psInfo->result != ID_PSREBOOTSYSTEM)
3917 psInfo->result = ID_PSRESTARTWINDOWS;
3918
3919 return TRUE;
3920 }
3921
3922 case PSM_REBOOTSYSTEM:
3923 {
3925
3926 if (!psInfo)
3927 return FALSE;
3928
3929 psInfo->result = ID_PSREBOOTSYSTEM;
3930
3931 return TRUE;
3932 }
3933
3934 case PSM_SETTITLEA:
3936 return TRUE;
3937
3938 case PSM_SETTITLEW:
3940 return TRUE;
3941
3942 case PSM_APPLY:
3943 {
3944 BOOL msgResult = PROPSHEET_Apply(hwnd, 0);
3945
3947
3948 return TRUE;
3949 }
3950
3951 case PSM_QUERYSIBLINGS:
3952 {
3954
3956
3957 return TRUE;
3958 }
3959
3960 case PSM_ADDPAGE:
3961 {
3962 /*
3963 * Note: MSVC++ 6.0 documentation says that PSM_ADDPAGE does not have
3964 * a return value. This is not true. PSM_ADDPAGE returns TRUE
3965 * on success or FALSE otherwise, as specified on MSDN Online.
3966 * Also see the MFC code for
3967 * CPropertySheet::AddPage(CPropertyPage* pPage).
3968 */
3969
3971
3973
3974 return TRUE;
3975 }
3976
3977 case PSM_REMOVEPAGE:
3979 return TRUE;
3980
3982 {
3985 return TRUE;
3986 }
3987
3988 case PSM_PRESSBUTTON:
3990 return TRUE;
3991
3992 case PSM_SETFINISHTEXTA:
3994 return TRUE;
3995
3996 case PSM_SETWIZBUTTONS:
3998 return TRUE;
3999
4000 case PSM_SETCURSELID:
4002 return TRUE;
4003
4004 case PSM_SETFINISHTEXTW:
4006 return FALSE;
4007
4008 case PSM_INSERTPAGE:
4009 {
4012 return TRUE;
4013 }
4014
4015 case PSM_SETHEADERTITLEW:
4017 return TRUE;
4018
4019 case PSM_SETHEADERTITLEA:
4021 return TRUE;
4022
4023 case PSM_SETHEADERSUBTITLEW:
4025 return TRUE;
4026
4027 case PSM_SETHEADERSUBTITLEA:
4029 return TRUE;
4030
4031 case PSM_HWNDTOINDEX:
4032 {
4035 return TRUE;
4036 }
4037
4038 case PSM_INDEXTOHWND:
4039 {
4040 LRESULT msgResult = PROPSHEET_IndexToHwnd(hwnd, (int)wParam);
4042 return TRUE;
4043 }
4044
4045 case PSM_PAGETOINDEX:
4046 {
4049 return TRUE;
4050 }
4051
4052 case PSM_INDEXTOPAGE:
4053 {
4054 LRESULT msgResult = PROPSHEET_IndexToPage(hwnd, (int)wParam);
4056 return TRUE;
4057 }
4058
4059 case PSM_IDTOINDEX:
4060 {
4061 LRESULT msgResult = PROPSHEET_IdToIndex(hwnd, (int)lParam);
4063 return TRUE;
4064 }
4065
4066 case PSM_INDEXTOID:
4067 {
4068 LRESULT msgResult = PROPSHEET_IndexToId(hwnd, (int)wParam);
4070 return TRUE;
4071 }
4072
4073 case PSM_GETRESULT:
4074 {
4075 LRESULT msgResult = PROPSHEET_GetResult(hwnd);
4077 return TRUE;
4078 }
4079
4080 case PSM_RECALCPAGESIZES:
4081 {
4084 return TRUE;
4085 }
4086
4087 default:
4088 return FALSE;
4089 }
4090}
#define IDS_CLOSE
Definition: reactos.h:41
WPARAM wParam
Definition: combotst.c:138
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
Definition: commctrl.c:1597
static LRESULT PROPSHEET_HwndToIndex(HWND hwndDlg, HWND hPageDlg)
Definition: propsheet.c:2644
static void PROPSHEET_SetHeaderSubTitleA(HWND hwndDlg, UINT page_index, const char *subtitle)
Definition: propsheet.c:2630
static LRESULT PROPSHEET_IdToIndex(HWND hwndDlg, int iPageId)
Definition: propsheet.c:2703
static void PROPSHEET_PressButton(HWND hwndDlg, int buttonID)
Definition: propsheet.c:1931
static void PROPSHEET_SetHeaderSubTitleW(HWND hwndDlg, UINT page_index, const WCHAR *subtitle)
Definition: propsheet.c:2608
static void PROPSHEET_SetFinishTextA(HWND hwndDlg, LPCSTR lpszText)
Definition: propsheet.c:2209
static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent, const PropSheetInfo *psInfo)
Definition: propsheet.c:950
static void PROPSHEET_CleanUp(HWND hwndDlg)
Definition: propsheet.c:2778
static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo *psInfo)
Definition: propsheet.c:745
static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam)
Definition: propsheet.c:1806
static void PROPSHEET_SetHeaderTitleW(HWND hwndDlg, UINT page_index, const WCHAR *title)
Definition: propsheet.c:2572
static void PROPSHEET_SetCurSelId(HWND hwndDlg, int id)
Definition: propsheet.c:2146
static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam)
Definition: propsheet.c:1737
static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, const PropSheetInfo *psInfo)
Definition: propsheet.c:861
static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
Definition: propsheet.c:2661
static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID)
Definition: propsheet.c:3275
static BOOL PROPSHEET_CreateTabControl(HWND hwndParent, const PropSheetInfo *psInfo)
Definition: propsheet.c:1159
static BOOL PROPSHEET_RecalcPageSizes(HWND hwndDlg)
Definition: propsheet.c:2749
static void PROPSHEET_Changed(HWND hwndDlg, HWND hwndDirtyPage)
Definition: propsheet.c:1871
static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
Definition: propsheet.c:2498
static BOOL PROPSHEET_SizeMismatch(HWND hwndDlg, const PropSheetInfo *psInfo)
Definition: propsheet.c:714
static LRESULT PROPSHEET_IndexToPage(HWND hwndDlg, int iPageIndex)
Definition: propsheet.c:2689
#define MAX_BUTTONTEXT_LENGTH
Definition: propsheet.c:148
static LRESULT PROPSHEET_IndexToId(HWND hwndDlg, int iPageIndex)
Definition: propsheet.c:2721
static BOOL PROPSHEET_RemovePage(HWND hwndDlg, int index, HPROPSHEETPAGE hpage)
Definition: propsheet.c:2392
static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, const PropSheetInfo *psInfo)
Definition: propsheet.c:827
static void PROPSHEET_SetHeaderTitleA(HWND hwndDlg, UINT page_index, const char *title)
Definition: propsheet.c:2594
static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
Definition: propsheet.c:3341
static BOOL PROPSHEET_AddPage(HWND hwndDlg, HPROPSHEETPAGE hpage)
Definition: propsheet.c:2382
static LRESULT PROPSHEET_PageToIndex(HWND hwndDlg, HPROPSHEETPAGE hPage)
Definition: propsheet.c:2677
static LRESULT PROPSHEET_GetResult(HWND hwndDlg)
Definition: propsheet.c:2740
static void PROPSHEET_SetTitleA(HWND hwndDlg, DWORD dwStyle, LPCSTR lpszText)
Definition: propsheet.c:2162
static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo)
Definition: propsheet.c:1515
static void PROPSHEET_SetFinishTextW(HWND hwndDlg, LPCWSTR lpszText)
Definition: propsheet.c:2238
static LRESULT PROPSHEET_QuerySiblings(HWND hwndDlg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.c:2267
#define MAX_CAPTION_LENGTH
Definition: propsheet.c:146
static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
Definition: propsheet.c:2179
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
static HDC
Definition: imagelist.c:88
static MONITORINFO mi
Definition: win.c:9400
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
#define ID_PSRESTARTWINDOWS
Definition: prsht.h:132
#define PSM_GETTABCONTROL
Definition: prsht.h:80
#define PSM_CHANGED
Definition: prsht.h:164
#define PSM_ISDIALOGMESSAGE
Definition: prsht.h:96
#define PSM_SETWIZBUTTONS
Definition: prsht.h:157
#define PSH_USEHICON
Definition: prsht.h:41
#define PSM_REMOVEPAGE
Definition: prsht.h:166
#define PSM_ADDPAGE
Definition: prsht.h:165
#define PSM_UNCHANGED
Definition: prsht.h:159
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSM_GETCURRENTPAGEHWND
Definition: prsht.h:81
#define PSM_RESTARTWINDOWS
Definition: prsht.h:163
#define PSWIZB_BACK
Definition: prsht.h:153
#define PSM_SETTITLEA
Definition: prsht.h:168
#define PSM_SETCURSELID
Definition: prsht.h:104
#define PSM_SETTITLEW
Definition: prsht.h:169
#define PSM_SETFINISHTEXTW
Definition: prsht.h:105
#define PSM_SETFINISHTEXTA
Definition: prsht.h:106
#define PSM_CANCELTOCLOSE
Definition: prsht.h:161
#define ID_PSREBOOTSYSTEM
Definition: prsht.h:133
#define PSH_USEICONID
Definition: prsht.h:42
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define PSM_APPLY
Definition: prsht.h:158
#define PSM_SETCURSEL
Definition: prsht.h:167
#define PSM_PRESSBUTTON
Definition: prsht.h:100
#define PSM_REBOOTSYSTEM
Definition: prsht.h:162
#define PSM_QUERYSIBLINGS
Definition: prsht.h:160
#define TCM_GETCURSEL
Definition: commctrl.h:4067
#define TCN_SELCHANGING
Definition: commctrl.h:4138
#define TCN_SELCHANGE
Definition: commctrl.h:4137
#define TCM_SETCURSEL
Definition: commctrl.h:4070
#define WC_STATICW
Definition: commctrl.h:4685
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define __fallthrough
Definition: sal_old.h:314
LONG lfWeight
Definition: dimm.idl:63
LPCWSTR pszIcon
Definition: prsht.h:299
RECT rcNormalPosition
Definition: winuser.h:3403
const uint16_t * LPCWSTR
Definition: typedefs.h:57
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382
#define FW_BOLD
Definition: wingdi.h:378
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
#define WM_PAINT
Definition: winuser.h:1648
#define GetMonitorInfo
Definition: winuser.h:5957
#define WM_CLOSE
Definition: winuser.h:1649
#define DWLP_USER
Definition: winuser.h:883
#define GetWindowLongPtrW
Definition: winuser.h:4983
#define WM_ENABLE
Definition: winuser.h:1643
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
#define WM_COMMAND
Definition: winuser.h:1768
#define WM_WININICHANGE
Definition: winuser.h:1658
#define WM_INITDIALOG
Definition: winuser.h:1767
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1391
#define WM_DEVICECHANGE
Definition: winuser.h:1839
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1654
BOOL WINAPI IsIconic(_In_ HWND)
#define WM_ACTIVATE
Definition: winuser.h:1640
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WM_QUERYENDSESSION
Definition: winuser.h:1650
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
struct tagNMHDR * LPNMHDR
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define CW_USEDEFAULT
Definition: winuser.h:225
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define WM_ACTIVATEAPP
Definition: winuser.h:1660
#define WM_DESTROY
Definition: winuser.h:1637
#define WM_ENDSESSION
Definition: winuser.h:1655
#define SetWindowLongPtrW
Definition: winuser.h:5512
#define WS_EX_RTLREADING
Definition: winuser.h:402
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define GWL_EXSTYLE
Definition: winuser.h:862

Referenced by PROPSHEET_CreateDialog().

◆ PROPSHEET_DoCommand()

static BOOL PROPSHEET_DoCommand ( HWND  hwnd,
WORD  wID 
)
static

Definition at line 3275 of file propsheet.c.

3276{
3277
3278 switch (wID) {
3279
3280 case IDOK:
3281 case IDC_APPLY_BUTTON:
3282 {
3283 HWND hwndApplyBtn = GetDlgItem(hwnd, IDC_APPLY_BUTTON);
3284
3285 if (PROPSHEET_Apply(hwnd, wID == IDOK ? 1: 0) == FALSE)
3286 break;
3287
3288 if (wID == IDOK)
3289 {
3291
3292#ifdef __REACTOS__
3293 if (psInfo == NULL) break;
3294#endif
3295
3296 /* don't overwrite ID_PSRESTARTWINDOWS or ID_PSREBOOTSYSTEM */
3297 if (psInfo->result == 0)
3298 psInfo->result = IDOK;
3299
3300 if (psInfo->isModeless)
3301 psInfo->activeValid = FALSE;
3302 else
3303 psInfo->ended = TRUE;
3304 }
3305 else
3306 EnableWindow(hwndApplyBtn, FALSE);
3307
3308 break;
3309 }
3310
3311 case IDC_BACK_BUTTON:
3313 break;
3314
3315 case IDC_NEXT_BUTTON:
3317 break;
3318
3319 case IDC_FINISH_BUTTON:
3321 break;
3322
3323 case IDCANCEL:
3325 break;
3326
3327 case IDHELP:
3329 break;
3330
3331 default:
3332 return FALSE;
3333 }
3334
3335 return TRUE;
3336}
static BOOL PROPSHEET_Finish(HWND hwndDlg)
Definition: propsheet.c:1699
static BOOL PROPSHEET_Next(HWND hwndDlg)
Definition: propsheet.c:1656
static void PROPSHEET_Help(HWND hwndDlg)
Definition: propsheet.c:1849
static BOOL PROPSHEET_Back(HWND hwndDlg)
Definition: propsheet.c:1614

Referenced by PROPSHEET_DialogProc(), and PROPSHEET_PressButton().

◆ PROPSHEET_FindPageByResId()

static INT PROPSHEET_FindPageByResId ( const PropSheetInfo psInfo,
LRESULT  resId 
)
static

Definition at line 296 of file propsheet.c.

297{
298 INT i;
299
300 for (i = 0; i < psInfo->nPages; i++)
301 {
303
304 /* Fixme: if resource ID is a string shall we use strcmp ??? */
305 if (lppsp->u.pszTemplate == (LPVOID)resId)
306 break;
307 }
308
309 return i;
310}

Referenced by PROPSHEET_Back(), PROPSHEET_Next(), PROPSHEET_SetCurSel(), and PROPSHEET_SetCurSelId().

◆ PROPSHEET_Finish()

static BOOL PROPSHEET_Finish ( HWND  hwndDlg)
static

Definition at line 1699 of file propsheet.c.

1700{
1701 PSHNOTIFY psn;
1702 HWND hwndPage;
1703 LRESULT msgResult = 0;
1704 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1705
1706 TRACE("active_page %d\n", psInfo->active_page);
1707 if (psInfo->active_page < 0)
1708 return FALSE;
1709
1710 psn.hdr.code = PSN_WIZFINISH;
1711 psn.hdr.hwndFrom = hwndDlg;
1712 psn.hdr.idFrom = 0;
1713 psn.lParam = 0;
1714
1715 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1716
1717 msgResult = SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1718
1719 TRACE("msg result %ld\n", msgResult);
1720
1721 if (msgResult != 0)
1722 return FALSE;
1723
1724 if (psInfo->result == 0)
1725 psInfo->result = IDOK;
1726 if (psInfo->isModeless)
1727 psInfo->activeValid = FALSE;
1728 else
1729 psInfo->ended = TRUE;
1730
1731 return TRUE;
1732}
#define PSN_WIZFINISH
Definition: prsht.h:122

Referenced by PROPSHEET_DoCommand(), and PROPSHEET_PressButton().

◆ PROPSHEET_GetPaddingInfo()

static PADDING_INFO PROPSHEET_GetPaddingInfo ( HWND  hwndDlg)
static

Definition at line 1077 of file propsheet.c.

1078{
1079 HWND hwndTab = GetDlgItem(hwndDlg, IDC_TABCONTROL);
1080 RECT rcTab;
1082
1083 GetWindowRect(hwndTab, &rcTab);
1084 MapWindowPoints( 0, hwndDlg, (POINT *)&rcTab, 2 );
1085
1086 padding.x = rcTab.left;
1087 padding.y = rcTab.top;
1088
1089 return padding;
1090}

Referenced by PROPSHEET_AdjustButtons(), and PROPSHEET_AdjustSize().

◆ PROPSHEET_GetPaddingInfoWizard()

static PADDING_INFO PROPSHEET_GetPaddingInfoWizard ( HWND  hwndDlg,
const PropSheetInfo psInfo 
)
static

Definition at line 1104 of file propsheet.c.

1106{
1108 RECT rc;
1109 HWND hwndControl;
1110 INT idButton;
1111 POINT ptButton, ptLine;
1112
1113 TRACE("\n");
1114 if (psInfo->hasHelp)
1115 {
1116 idButton = IDHELP;
1117 }
1118 else
1119 {
1120 if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
1121 {
1122 idButton = IDC_NEXT_BUTTON;
1123 }
1124 else
1125 {
1126 /* hopefully this is ok */
1127 idButton = IDCANCEL;
1128 }
1129 }
1130
1131 hwndControl = GetDlgItem(hwndDlg, idButton);
1132 GetWindowRect(hwndControl, &rc);
1133 MapWindowPoints( 0, hwndDlg, (POINT *)&rc, 2 );
1134 ptButton.x = rc.left;
1135 ptButton.y = rc.top;
1136
1137 /* Line */
1138 hwndControl = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE);
1139 GetWindowRect(hwndControl, &rc);
1140 MapWindowPoints( 0, hwndDlg, (POINT *)&rc, 2 );
1141 ptLine.x = rc.left;
1142 ptLine.y = rc.bottom;
1143
1144 padding.y = ptButton.y - ptLine.y;
1145
1146 if (padding.y < 0)
1147 ERR("padding negative ! Please report this !\n");
1148
1149 /* this is most probably not correct, but the best we have now */
1150 padding.x = padding.y;
1151 return padding;
1152}
#define ERR(fmt,...)
Definition: precomp.h:57
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48

Referenced by PROPSHEET_AdjustButtonsWizard().

◆ PROPSHEET_GetPageIndex()

static int PROPSHEET_GetPageIndex ( HPROPSHEETPAGE  hpage,
const PropSheetInfo psInfo,
int  original_index 
)
static

Definition at line 2762 of file propsheet.c.

2763{
2764 int index;
2765
2766 TRACE("page %p index %d\n", page, original_index);
2767
2768 for (index = 0; index < psInfo->nPages; index++)
2769 if (psInfo->proppage[index].hpage == page)
2770 return index;
2771
2772 return original_index;
2773}
Definition: module.h:576

Referenced by PROPSHEET_InsertPage(), PROPSHEET_PageToIndex(), PROPSHEET_RemovePage(), and PROPSHEET_SetCurSel().

◆ PROPSHEET_GetPageRect()

static void PROPSHEET_GetPageRect ( const PropSheetInfo psInfo,
HWND  hwndDlg,
RECT rc,
LPCPROPSHEETPAGEW  ppshpage 
)
static

Definition at line 252 of file propsheet.c.

254{
255 if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) {
256 HWND hwndChild;
257 RECT r;
258
259 if (((psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD)) &&
260 (psInfo->ppshheader.dwFlags & PSH_HEADER) &&
261 !(ppshpage->dwFlags & PSP_HIDEHEADER)) ||
262 (psInfo->ppshheader.dwFlags & PSH_WIZARD))
263 {
264 rc->left = rc->top = WIZARD_PADDING;
265 }
266 else
267 {
268 rc->left = rc->top = 0;
269 }
270 rc->right = psInfo->width - rc->left;
271 rc->bottom = psInfo->height - rc->top;
272 MapDialogRect(hwndDlg, rc);
273
274 if ((psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD)) &&
275 (psInfo->ppshheader.dwFlags & PSH_HEADER) &&
276 !(ppshpage->dwFlags & PSP_HIDEHEADER))
277 {
278 hwndChild = GetDlgItem(hwndDlg, IDC_SUNKEN_LINEHEADER);
279 GetClientRect(hwndChild, &r);
280 MapWindowPoints(hwndChild, hwndDlg, (LPPOINT) &r, 2);
281 rc->top += r.bottom + 1;
282 }
283 } else {
284 HWND hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
285 GetClientRect(hwndTabCtrl, rc);
286 SendMessageW(hwndTabCtrl, TCM_ADJUSTRECT, FALSE, (LPARAM)rc);
287 MapWindowPoints(hwndTabCtrl, hwndDlg, (LPPOINT)rc, 2);
288 }
289}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

Referenced by PROPSHEET_SetCurSel().

◆ PROPSHEET_GetResult()

static LRESULT PROPSHEET_GetResult ( HWND  hwndDlg)
static

Definition at line 2740 of file propsheet.c.

2741{
2742 PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2743 return psInfo->result;
2744}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_Help()

static void PROPSHEET_Help ( HWND  hwndDlg)
static

Definition at line 1849 of file propsheet.c.

1850{
1851 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1852 HWND hwndPage;
1853 PSHNOTIFY psn;
1854
1855 TRACE("active_page %d\n", psInfo->active_page);
1856 if (psInfo->active_page < 0)
1857 return;
1858
1859 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1860 psn.hdr.code = PSN_HELP;
1861 psn.hdr.hwndFrom = hwndDlg;
1862 psn.hdr.idFrom = 0;
1863 psn.lParam = 0;
1864
1865 SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1866}
#define PSN_HELP
Definition: prsht.h:119

Referenced by PROPSHEET_DoCommand().

◆ PROPSHEET_HwndToIndex()

static LRESULT PROPSHEET_HwndToIndex ( HWND  hwndDlg,
HWND  hPageDlg 
)
static

Definition at line 2644 of file propsheet.c.

2645{
2646 int index;
2647 PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2648
2649 TRACE("(%p, %p)\n", hwndDlg, hPageDlg);
2650
2651 for (index = 0; index < psInfo->nPages; index++)
2652 if (psInfo->proppage[index].hwndPage == hPageDlg)
2653 return index;
2654 WARN("%p not found\n", hPageDlg);
2655 return -1;
2656}
#define WARN(fmt,...)
Definition: precomp.h:61

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_IdToIndex()

static LRESULT PROPSHEET_IdToIndex ( HWND  hwndDlg,
int  iPageId 
)
static

Definition at line 2703 of file propsheet.c.

2704{
2705 int index;
2707 PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2708 TRACE("(%p, %d)\n", hwndDlg, iPageId);
2709 for (index = 0; index < psInfo->nPages; index++) {
2710 psp = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage;
2711 if (psp->u.pszTemplate == MAKEINTRESOURCEW(iPageId))
2712 return index;
2713 }
2714
2715 return -1;
2716}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_IndexToHwnd()

static LRESULT PROPSHEET_IndexToHwnd ( HWND  hwndDlg,
int  iPageIndex 
)
static

Definition at line 2661 of file propsheet.c.

2662{
2663 PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2664 TRACE("(%p, %d)\n", hwndDlg, iPageIndex);
2665 if (!psInfo)
2666 return 0;
2667 if (iPageIndex<0 || iPageIndex>=psInfo->nPages) {
2668 WARN("%d out of range.\n", iPageIndex);
2669 return 0;
2670 }
2671 return (LRESULT)psInfo->proppage[iPageIndex].hwndPage;
2672}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_IndexToId()

static LRESULT PROPSHEET_IndexToId ( HWND  hwndDlg,
int  iPageIndex 
)
static

Definition at line 2721 of file propsheet.c.

2722{
2723 PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2725 TRACE("(%p, %d)\n", hwndDlg, iPageIndex);
2726 if (iPageIndex<0 || iPageIndex>=psInfo->nPages) {
2727 WARN("%d out of range.\n", iPageIndex);
2728 return 0;
2729 }
2730 psp = (LPCPROPSHEETPAGEW)psInfo->proppage[iPageIndex].hpage;
2731 if (psp->dwFlags & PSP_DLGINDIRECT || !IS_INTRESOURCE(psp->u.pszTemplate)) {
2732 return 0;
2733 }
2734 return (LRESULT)psp->u.pszTemplate;
2735}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_IndexToPage()

static LRESULT PROPSHEET_IndexToPage ( HWND  hwndDlg,
int  iPageIndex 
)
static

Definition at line 2689 of file propsheet.c.

2690{
2691 PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2692 TRACE("(%p, %d)\n", hwndDlg, iPageIndex);
2693 if (iPageIndex<0 || iPageIndex>=psInfo->nPages) {
2694 WARN("%d out of range.\n", iPageIndex);
2695 return 0;
2696 }
2697 return (LRESULT)psInfo->proppage[iPageIndex].hpage;
2698}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_InsertPage()

static BOOL PROPSHEET_InsertPage ( HWND  hwndDlg,
HPROPSHEETPAGE  hpageInsertAfter,
HPROPSHEETPAGE  hpage 
)
static

Definition at line 2288 of file propsheet.c.

2289{
2290 PropSheetInfo *psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2291 PropPageInfo *ppi, *prev_ppi = psInfo->proppage;
2292 HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
2294 TCITEMW item;
2295 int index;
2296
2297 TRACE("hwndDlg %p, hpageInsertAfter %p, hpage %p\n", hwndDlg, hpageInsertAfter, hpage);
2298
2299 if (IS_INTRESOURCE(hpageInsertAfter))
2300 index = LOWORD(hpageInsertAfter);
2301 else
2302 {
2303 index = PROPSHEET_GetPageIndex(hpageInsertAfter, psInfo, -1);
2304 if (index < 0)
2305 {
2306 TRACE("Could not find page to insert after!\n");
2307 return FALSE;
2308 }
2309 index++;
2310 }
2311
2312 if (index > psInfo->nPages)
2313 index = psInfo->nPages;
2314
2315 ppi = Alloc(sizeof(PropPageInfo) * (psInfo->nPages + 1));
2316 if (!ppi)
2317 return FALSE;
2318
2319 /*
2320 * Fill in a new PropPageInfo entry.
2321 */
2322 if (index > 0)
2323 memcpy(ppi, prev_ppi, index * sizeof(PropPageInfo));
2324 memset(&ppi[index], 0, sizeof(PropPageInfo));
2325 if (index < psInfo->nPages)
2326 memcpy(&ppi[index + 1], &prev_ppi[index], (psInfo->nPages - index) * sizeof(PropPageInfo));
2327 psInfo->proppage = ppi;
2328
2329 if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, index, FALSE))
2330 {
2331 psInfo->proppage = prev_ppi;
2332 Free(ppi);
2333 return FALSE;
2334 }
2335
2336 psInfo->proppage[index].hpage = hpage;
2337
2338 if (ppsp->dwFlags & PSP_PREMATURE)
2339 {
2340 /* Create the page but don't show it */
2341 if (!PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppsp))
2342 {
2343 psInfo->proppage = prev_ppi;
2344 Free(ppi);
2345 return FALSE;
2346 }
2347 }
2348
2349 Free(prev_ppi);
2350 psInfo->nPages++;
2351 if (index <= psInfo->active_page)
2352 psInfo->active_page++;
2353
2354 /*
2355 * Add a new tab to the tab control.
2356 */
2357 item.mask = TCIF_TEXT;
2358 item.pszText = (LPWSTR) psInfo->proppage[index].pszText;
2359 item.cchTextMax = MAX_TABTEXT_LENGTH;
2360
2361 if (psInfo->hImageList)
2362 SendMessageW(hwndTabControl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList);
2363
2364 if (psInfo->proppage[index].hasIcon)
2365 {
2366 item.mask |= TCIF_IMAGE;
2367 item.iImage = index;
2368 }
2369
2370 SendMessageW(hwndTabControl, TCM_INSERTITEMW, index, (LPARAM)&item);
2371
2372 /* If it is the only page - show it */
2373 if (psInfo->nPages == 1)
2374 PROPSHEET_SetCurSel(hwndDlg, 0, 1, 0);
2375
2376 return TRUE;
2377}
static BOOL PROPSHEET_CreatePage(HWND hwndParent, int index, const PropSheetInfo *psInfo, LPCPROPSHEETPAGEW ppshpage)
Definition: propsheet.c:1366
static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo *psInfo, int original_index)
Definition: propsheet.c:2762
static LONG active_page
Definition: propsheet.c:37
#define PSP_PREMATURE
Definition: prsht.h:31
#define memset(x, y, z)
Definition: compat.h:39

Referenced by PROPSHEET_AddPage(), and PROPSHEET_DialogProc().

◆ PROPSHEET_IsDialogMessage()

static BOOL PROPSHEET_IsDialogMessage ( HWND  hwnd,
LPMSG  lpMsg 
)
static

Definition at line 3222 of file propsheet.c.

3223{
3225
3226 TRACE("\n");
3227 if (!psInfo || (hwnd != lpMsg->hwnd && !IsChild(hwnd, lpMsg->hwnd)))
3228 return FALSE;
3229
3230 if (lpMsg->message == WM_KEYDOWN && (GetKeyState(VK_CONTROL) & 0x8000))
3231 {
3232 int new_page = 0;
3233 INT dlgCode = SendMessageW(lpMsg->hwnd, WM_GETDLGCODE, 0, (LPARAM)lpMsg);
3234
3235 if (!(dlgCode & DLGC_WANTMESSAGE))
3236 {
3237 switch (lpMsg->wParam)
3238 {
3239 case VK_TAB:
3240 if (GetKeyState(VK_SHIFT) & 0x8000)
3241 new_page = -1;
3242 else
3243 new_page = 1;
3244 break;
3245
3246 case VK_NEXT: new_page = 1; break;
3247 case VK_PRIOR: new_page = -1; break;
3248 }
3249 }
3250
3251 if (new_page)
3252 {
3254 {
3255 new_page += psInfo->active_page;
3256
3257 if (new_page < 0)
3258 new_page = psInfo->nPages - 1;
3259 else if (new_page >= psInfo->nPages)
3260 new_page = 0;
3261
3262 PROPSHEET_SetCurSel(hwnd, new_page, 1, 0);
3263 }
3264
3265 return TRUE;
3266 }
3267 }
3268
3269 return IsDialogMessageW(hwnd, lpMsg);
3270}
UINT message
Definition: winuser.h:3223
HWND hwnd
Definition: winuser.h:3222
WPARAM wParam
Definition: winuser.h:3224
#define VK_TAB
Definition: winuser.h:2235
#define VK_CONTROL
Definition: winuser.h:2239
#define VK_NEXT
Definition: winuser.h:2257
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
#define VK_SHIFT
Definition: winuser.h:2238
#define DLGC_WANTMESSAGE
Definition: winuser.h:2655
#define VK_PRIOR
Definition: winuser.h:2256
#define WM_KEYDOWN
Definition: winuser.h:1743
#define WM_GETDLGCODE
Definition: winuser.h:1717
SHORT WINAPI GetKeyState(_In_ int)

Referenced by do_loop(), and PROPSHEET_DialogProc().

◆ PROPSHEET_LoadWizardBitmaps()

static VOID PROPSHEET_LoadWizardBitmaps ( PropSheetInfo psInfo)
static

Definition at line 1515 of file propsheet.c.

1516{
1517 if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD))
1518 {
1519 /* if PSH_USEHBMWATERMARK is not set, load the resource from pszbmWatermark
1520 and put the HBITMAP in hbmWatermark. Thus all the rest of the code always
1521 considers hbmWatermark as valid. */
1522 if ((psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
1523 !(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK))
1524 {
1525 psInfo->ppshheader.u4.hbmWatermark =
1526 CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0);
1527 }
1528
1529 /* Same behavior as for watermarks */
1530 if ((psInfo->ppshheader.dwFlags & PSH_HEADER) &&
1531 !(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER))
1532 {
1533 psInfo->ppshheader.u5.hbmHeader =
1534 CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0);
1535 }
1536 }
1537}
HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags, LPCOLORMAP lpColorMap, INT iNumMaps)
Definition: commctrl.c:1009

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_Next()

static BOOL PROPSHEET_Next ( HWND  hwndDlg)
static

Definition at line 1656 of file propsheet.c.

1657{
1658 PSHNOTIFY psn;
1659 HWND hwndPage;
1660 LRESULT msgResult = 0;
1661 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1662 int idx;
1663
1664 TRACE("active_page %d\n", psInfo->active_page);
1665 if (psInfo->active_page < 0)
1666 return FALSE;
1667
1668 psn.hdr.code = PSN_WIZNEXT;
1669 psn.hdr.hwndFrom = hwndDlg;
1670 psn.hdr.idFrom = 0;
1671 psn.lParam = 0;
1672
1673 hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1674
1675 msgResult = SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1676 if (msgResult == -1)
1677 return FALSE;
1678 else if (msgResult == 0)
1679 idx = psInfo->active_page + 1;
1680 else
1681 idx = PROPSHEET_FindPageByResId(psInfo, msgResult);
1682
1683 if (idx < psInfo->nPages )
1684 {
1685 if (PROPSHEET_CanSetCurSel(hwndDlg) != FALSE)
1686 {
1689 PROPSHEET_SetCurSel(hwndDlg, idx, 1, 0);
1690 }
1691 }
1692
1693 return TRUE;
1694}
#define PSN_WIZNEXT
Definition: prsht.h:121

Referenced by PROPSHEET_DoCommand(), and PROPSHEET_PressButton().

◆ PROPSHEET_PageToIndex()

static LRESULT PROPSHEET_PageToIndex ( HWND  hwndDlg,
HPROPSHEETPAGE  hPage 
)
static

Definition at line 2677 of file propsheet.c.

2678{
2679 PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2680
2681 TRACE("(%p, %p)\n", hwndDlg, hPage);
2682
2683 return PROPSHEET_GetPageIndex(hPage, psInfo, -1);
2684}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_Paint()

static LRESULT PROPSHEET_Paint ( HWND  hwnd,
HDC  hdcParam 
)
static

Definition at line 3341 of file propsheet.c.

3342{
3344 PAINTSTRUCT ps;
3345 HDC hdc, hdcSrc;
3346 BITMAP bm;
3347 HBITMAP hbmp;
3348 HPALETTE hOldPal = 0;
3349 int offsety = 0;
3350 HBRUSH hbr;
3351 RECT r, rzone;
3352 LPCPROPSHEETPAGEW ppshpage;
3353 WCHAR szBuffer[256];
3354 int nLength;
3355
3356 hdc = hdcParam ? hdcParam : BeginPaint(hwnd, &ps);
3357 if (!hdc) return 1;
3358
3360
3361 if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK)
3362 hOldPal = SelectPalette(hdc, psInfo->ppshheader.hplWatermark, FALSE);
3363
3364 if (psInfo->active_page < 0)
3365 ppshpage = NULL;
3366 else
3367 ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[psInfo->active_page].hpage;
3368
3369 if ( (ppshpage && !(ppshpage->dwFlags & PSP_HIDEHEADER)) &&
3370 (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) &&
3371 (psInfo->ppshheader.dwFlags & PSH_HEADER) )
3372 {
3373 HWND hwndLineHeader = GetDlgItem(hwnd, IDC_SUNKEN_LINEHEADER);
3374 HFONT hOldFont;
3375 COLORREF clrOld = 0;
3376 int oldBkMode = 0;
3377
3378 GetClientRect(hwndLineHeader, &r);
3379 MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2);
3380 SetRect(&rzone, 0, 0, r.right + 1, r.top - 1);
3381
3382 hOldFont = SelectObject(hdc, psInfo->hFontBold);
3383
3384#ifdef __REACTOS__
3385 if (psInfo->ppshheader.u5.hbmHeader)
3386#else
3387 if (psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER)
3388#endif
3389 {
3390 hbmp = SelectObject(hdcSrc, psInfo->ppshheader.u5.hbmHeader);
3391
3392 GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), &bm);
3393 if (psInfo->ppshheader.dwFlags & PSH_WIZARD97_OLD)
3394 {
3395 /* Fill the unoccupied part of the header with color of the
3396 * left-top pixel, but do it only when needed.
3397 */
3398 if (bm.bmWidth < r.right || bm.bmHeight < r.bottom)
3399 {
3400 hbr = CreateSolidBrush(GetPixel(hdcSrc, 0, 0));
3401 r = rzone;
3402 if (bm.bmWidth < r.right)
3403 {
3404 r.left = bm.bmWidth;
3405 FillRect(hdc, &r, hbr);
3406 }
3407 if (bm.bmHeight < r.bottom)
3408 {
3409 r.left = 0;
3410 r.top = bm.bmHeight;
3411 FillRect(hdc, &r, hbr);
3412 }
3413 DeleteObject(hbr);
3414 }
3415
3416 /* Draw the header itself. */
3417 BitBlt(hdc, 0, 0, bm.bmWidth, min(bm.bmHeight, rzone.bottom),
3418 hdcSrc, 0, 0, SRCCOPY);
3419 }
3420 else
3421 {
3422 int margin;
3424 FillRect(hdc, &rzone, hbr);
3425
3426 /* Draw the header bitmap. It's always centered like a
3427 * common 49 x 49 bitmap. */
3428 margin = (rzone.bottom - 49) / 2;
3429 BitBlt(hdc, rzone.right - 49 - margin, margin,
3430 min(bm.bmWidth, 49), min(bm.bmHeight, 49),
3431 hdcSrc, 0, 0, SRCCOPY);
3432
3433 /* NOTE: Native COMCTL32 draws a white stripe over the bitmap
3434 * if its height is smaller than 49 pixels. Because the reason
3435 * for this bug is unknown the current code doesn't try to
3436 * replicate it. */
3437 }
3438
3440 }
3441
3442 clrOld = SetTextColor (hdc, 0x00000000);
3443 oldBkMode = SetBkMode (hdc, TRANSPARENT);
3444
3445 if (ppshpage->dwFlags & PSP_USEHEADERTITLE) {
3446 SetRect(&r, 20, 10, 0, 0);
3447 if (!IS_INTRESOURCE(ppshpage->pszHeaderTitle))
3448 DrawTextW(hdc, ppshpage->pszHeaderTitle, -1, &r, DT_LEFT | DT_SINGLELINE | DT_NOCLIP);
3449 else
3450 {
3451 nLength = LoadStringW(ppshpage->hInstance, (UINT_PTR)ppshpage->pszHeaderTitle,
3452 szBuffer, 256);
3453 if (nLength != 0)
3454 {
3456 }
3457 }
3458 }
3459
3460 if (ppshpage->dwFlags & PSP_USEHEADERSUBTITLE) {
3461 SelectObject(hdc, psInfo->hFont);
3462 SetRect(&r, 40, 25, rzone.right - 69, rzone.bottom);
3463#ifdef __REACTOS__
3464 if (!IS_INTRESOURCE(ppshpage->pszHeaderSubTitle))
3465#else
3466 if (!IS_INTRESOURCE(ppshpage->pszHeaderTitle))
3467#endif
3468 DrawTextW(hdc, ppshpage->pszHeaderSubTitle, -1, &r, DT_LEFT | DT_WORDBREAK);
3469 else
3470 {
3471 nLength = LoadStringW(ppshpage->hInstance, (UINT_PTR)ppshpage->pszHeaderSubTitle,
3472 szBuffer, 256);
3473 if (nLength != 0)
3474 {
3475 DrawTextW(hdc, szBuffer, nLength, &r, DT_LEFT | DT_WORDBREAK);
3476 }
3477 }
3478 }
3479
3480 offsety = rzone.bottom + 2;
3481
3482 SetTextColor(hdc, clrOld);
3483 SetBkMode(hdc, oldBkMode);
3484 SelectObject(hdc, hOldFont);
3485 }
3486
3487 if ( (ppshpage && (ppshpage->dwFlags & PSP_HIDEHEADER)) &&
3488 (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) &&
3489#ifdef __REACTOS__
3490 (psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
3491 (psInfo->ppshheader.u4.hbmWatermark) )
3492#else
3493 (psInfo->ppshheader.dwFlags & PSH_WATERMARK) )
3494#endif
3495 {
3496 HWND hwndLine = GetDlgItem(hwnd, IDC_SUNKEN_LINE);
3497
3498 GetClientRect(hwndLine, &r);
3499 MapWindowPoints(hwndLine, hwnd, (LPPOINT) &r, 2);
3500 SetRect(&rzone, 0, 0, r.right, r.top - 1);
3501
3503 FillRect(hdc, &rzone, hbr);
3504
3505 GetObjectW(psInfo->ppshheader.u4.hbmWatermark, sizeof(BITMAP), &bm);
3506 hbmp = SelectObject(hdcSrc, psInfo->ppshheader.u4.hbmWatermark);
3507
3508 /* The watermark is truncated to a width of 164 pixels */
3509 r.right = min(r.right, 164);
3510 BitBlt(hdc, 0, offsety, min(bm.bmWidth, r.right),
3511 min(bm.bmHeight, r.bottom), hdcSrc, 0, 0, SRCCOPY);
3512
3513 /* If the bitmap is not big enough, fill the remaining area
3514 with the color of pixel (0,0) of bitmap - see MSDN */
3515 if (r.top > bm.bmHeight) {
3516 r.bottom = r.top - 1;
3517 r.top = bm.bmHeight;
3518 r.left = 0;
3519 r.right = bm.bmWidth;
3520 hbr = CreateSolidBrush(GetPixel(hdcSrc, 0, 0));
3521 FillRect(hdc, &r, hbr);
3522 DeleteObject(hbr);
3523 }
3524
3526 }
3527
3528 if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK)
3529 SelectPalette(hdc, hOldPal, FALSE);
3530
3532
3533 if (!hdcParam) EndPaint(hwnd, &ps);
3534
3535 return 0;
3536}
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
HBITMAP hbmp
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Height *Stride) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Stride)
Definition: common.c:42
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
LONG bmHeight
Definition: wingdi.h:1869
LONG bmWidth
Definition: wingdi.h:1868
WINBASEAPI _In_ DWORD nLength
Definition: wincon.h:682
DWORD COLORREF
Definition: windef.h:100
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define TRANSPARENT
Definition: wingdi.h:950
#define SRCCOPY
Definition: wingdi.h:333
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:917
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
#define COLOR_WINDOW
Definition: winuser.h:929
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define DT_SINGLELINE
Definition: winuser.h:540
#define DT_NOCLIP
Definition: winuser.h:536
#define DT_LEFT
Definition: winuser.h:534
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define DT_WORDBREAK
Definition: winuser.h:544
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
static HDC hdcSrc
Definition: xlate.c:32

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_PressButton()

static void PROPSHEET_PressButton ( HWND  hwndDlg,
int  buttonID 
)
static

Definition at line 1931 of file propsheet.c.

1932{
1933 TRACE("buttonID %d\n", buttonID);
1934 switch (buttonID)
1935 {
1936 case PSBTN_APPLYNOW:
1938 break;
1939 case PSBTN_BACK:
1940 PROPSHEET_Back(hwndDlg);
1941 break;
1942 case PSBTN_CANCEL:
1943 PROPSHEET_DoCommand(hwndDlg, IDCANCEL);
1944 break;
1945 case PSBTN_FINISH:
1946 PROPSHEET_Finish(hwndDlg);
1947 break;
1948 case PSBTN_HELP:
1949 PROPSHEET_DoCommand(hwndDlg, IDHELP);
1950 break;
1951 case PSBTN_NEXT:
1952 PROPSHEET_Next(hwndDlg);
1953 break;
1954 case PSBTN_OK:
1955 PROPSHEET_DoCommand(hwndDlg, IDOK);
1956 break;
1957 default:
1958 FIXME("Invalid button index %d\n", buttonID);
1959 }
1960}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define PSBTN_CANCEL
Definition: prsht.h:151
#define PSBTN_FINISH
Definition: prsht.h:148
#define PSBTN_NEXT
Definition: prsht.h:147
#define PSBTN_BACK
Definition: prsht.h:146
#define PSBTN_APPLYNOW
Definition: prsht.h:150
#define PSBTN_HELP
Definition: prsht.h:152
#define PSBTN_OK
Definition: prsht.h:149

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_PropertySheet()

static INT_PTR PROPSHEET_PropertySheet ( PropSheetInfo psInfo,
BOOL  unicode 
)
static

Definition at line 2875 of file propsheet.c.

2876{
2877 INT_PTR bRet = 0;
2878 HWND parent = NULL;
2879 if (psInfo->active_page >= psInfo->nPages) psInfo->active_page = 0;
2880 TRACE("startpage: %d of %d pages\n", psInfo->active_page, psInfo->nPages);
2881
2882 psInfo->unicode = unicode;
2883 psInfo->ended = FALSE;
2884
2885 if(!psInfo->isModeless)
2886 {
2887 parent = psInfo->ppshheader.hwndParent;
2889 }
2890 bRet = PROPSHEET_CreateDialog(psInfo);
2891 if(!psInfo->isModeless)
2892 bRet = do_loop(psInfo);
2893 return bRet;
2894}
static INT_PTR PROPSHEET_CreateDialog(PropSheetInfo *psInfo)
Definition: propsheet.c:622
static INT do_loop(const PropSheetInfo *psInfo)
Definition: propsheet.c:2834

Referenced by PropertySheetA(), and PropertySheetW().

◆ PROPSHEET_QuerySiblings()

static LRESULT PROPSHEET_QuerySiblings ( HWND  hwndDlg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2267 of file propsheet.c.

2269{
2270 int i = 0;
2271 HWND hwndPage;
2272 LRESULT msgResult = 0;
2273 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2274
2275 while ((i < psInfo->nPages) && (msgResult == 0))
2276 {
2277 hwndPage = psInfo->proppage[i].hwndPage;
2278 msgResult = SendMessageW(hwndPage, PSM_QUERYSIBLINGS, wParam, lParam);
2279 i++;
2280 }
2281
2282 return msgResult;
2283}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_RecalcPageSizes()

static BOOL PROPSHEET_RecalcPageSizes ( HWND  hwndDlg)
static

Definition at line 2749 of file propsheet.c.

2750{
2751 FIXME("(%p): stub\n", hwndDlg);
2752 return FALSE;
2753}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_RemovePage()

static BOOL PROPSHEET_RemovePage ( HWND  hwndDlg,
int  index,
HPROPSHEETPAGE  hpage 
)
static

Definition at line 2392 of file propsheet.c.

2395{
2396 PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2397 HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
2398 PropPageInfo* oldPages;
2399
2400 TRACE("index %d, hpage %p\n", index, hpage);
2401 if (!psInfo) {
2402 return FALSE;
2403 }
2404
2405 index = PROPSHEET_GetPageIndex(hpage, psInfo, index);
2406
2407 /* Make sure that index is within range */
2408 if (index < 0 || index >= psInfo->nPages)
2409 {
2410 TRACE("Could not find page to remove!\n");
2411 return FALSE;
2412 }
2413
2414 TRACE("total pages %d removing page %d active page %d\n",
2415 psInfo->nPages, index, psInfo->active_page);
2416 /*
2417 * Check if we're removing the active page.
2418 */
2419 if (index == psInfo->active_page)
2420 {
2421 if (psInfo->nPages > 1)
2422 {
2423 if (index > 0)
2424 {
2425 /* activate previous page */
2426 PROPSHEET_SetCurSel(hwndDlg, index - 1, -1, 0);
2427 }
2428 else
2429 {
2430 /* activate the next page */
2431 PROPSHEET_SetCurSel(hwndDlg, index + 1, 1, 0);
2432 psInfo->active_page = index;
2433 }
2434 }
2435 else
2436 {
2437 psInfo->active_page = -1;
2438 if (!psInfo->isModeless)
2439 {
2440 psInfo->ended = TRUE;
2441 return TRUE;
2442 }
2443 }
2444 }
2445 else if (index < psInfo->active_page)
2446 psInfo->active_page--;
2447
2448 /* Unsubclass the page dialog window */
2449 if((psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD) &&
2450 (psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
2451 ((PROPSHEETPAGEW*)psInfo->proppage[index].hpage)->dwFlags & PSP_HIDEHEADER))
2452 {
2455 }
2456
2457 /* Destroy page dialog window */
2459
2460 /* Free page resources */
2461 if(psInfo->proppage[index].hpage)
2462 {
2464
2465 if (psp->dwFlags & PSP_USETITLE)
2466 Free ((LPVOID)psInfo->proppage[index].pszText);
2467
2469 }
2470
2471 /* Remove the tab */
2472 SendMessageW(hwndTabControl, TCM_DELETEITEM, index, 0);
2473
2474 oldPages = psInfo->proppage;
2475 psInfo->nPages--;
2476 psInfo->proppage = Alloc(sizeof(PropPageInfo) * psInfo->nPages);
2477
2478 if (index > 0)
2479 memcpy(&psInfo->proppage[0], &oldPages[0], index * sizeof(PropPageInfo));
2480
2481 if (index < psInfo->nPages)
2482 memcpy(&psInfo->proppage[index], &oldPages[index + 1],
2483 (psInfo->nPages - index) * sizeof(PropPageInfo));
2484
2485 Free(oldPages);
2486
2487 return FALSE;
2488}
#define TCM_DELETEITEM
Definition: commctrl.h:4058

Referenced by PROPSHEET_DialogProc(), and PROPSHEET_SetCurSel().

◆ PROPSHEET_SetCurSel()

static BOOL PROPSHEET_SetCurSel ( HWND  hwndDlg,
int  index,
int  skipdir,
HPROPSHEETPAGE  hpage 
)
static

Definition at line 2015 of file propsheet.c.

2020{
2021 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2022 HWND hwndHelp = GetDlgItem(hwndDlg, IDHELP);
2023 HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
2024
2025 TRACE("index %d, skipdir %d, hpage %p\n", index, skipdir, hpage);
2026
2027 index = PROPSHEET_GetPageIndex(hpage, psInfo, index);
2028
2029 if (index < 0 || index >= psInfo->nPages)
2030 {
2031 TRACE("Could not find page to select!\n");
2032 return FALSE;
2033 }
2034
2035 /* unset active page while doing this transition. */
2036 if (psInfo->active_page != -1)
2037 ShowWindow(psInfo->proppage[psInfo->active_page].hwndPage, SW_HIDE);
2038 psInfo->active_page = -1;
2039
2040 while (1) {
2041 int result;
2042 PSHNOTIFY psn;
2043 RECT rc;
2045
2046 if (hwndTabControl)
2047 SendMessageW(hwndTabControl, TCM_SETCURSEL, index, 0);
2048
2049 psn.hdr.code = PSN_SETACTIVE;
2050 psn.hdr.hwndFrom = hwndDlg;
2051 psn.hdr.idFrom = 0;
2052 psn.lParam = 0;
2053
2054 if (!psInfo->proppage[index].hwndPage) {
2055 if(!PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage)) {
2056 PROPSHEET_RemovePage(hwndDlg, index, NULL);
2057
2058 if (!psInfo->isModeless)
2059 {
2060 DestroyWindow(hwndDlg);
2061 return FALSE;
2062 }
2063
2064 if(index >= psInfo->nPages)
2065 index--;
2066 if(index < 0)
2067 return FALSE;
2068 continue;
2069 }
2070 }
2071
2072 /* Resize the property sheet page to the fit in the Tab control
2073 * (for regular property sheets) or to fit in the client area (for
2074 * wizards).
2075 * NOTE: The resizing happens every time the page is selected and
2076 * not only when it's created (some applications depend on it). */
2077 PROPSHEET_GetPageRect(psInfo, hwndDlg, &rc, ppshpage);
2078 TRACE("setting page %p, rc (%s) w=%d, h=%d\n",
2079 psInfo->proppage[index].hwndPage, wine_dbgstr_rect(&rc),
2080 rc.right - rc.left, rc.bottom - rc.top);
2082 rc.left, rc.top,
2083 rc.right - rc.left, rc.bottom - rc.top, 0);
2084
2085 result = SendMessageW(psInfo->proppage[index].hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
2086 if (!result)
2087 break;
2088 if (result == -1) {
2089 index+=skipdir;
2090 if (index < 0) {
2091 index = 0;
2092 WARN("Tried to skip before first property sheet page!\n");
2093 break;
2094 }
2095 if (index >= psInfo->nPages) {
2096 WARN("Tried to skip after last property sheet page!\n");
2097 index = psInfo->nPages-1;
2098 break;
2099 }
2100 }
2101 else if (result != 0)
2102 {
2103 int old_index = index;
2105 if(index >= psInfo->nPages) {
2106 index = old_index;
2107 WARN("Tried to skip to nonexistent page by res id\n");
2108 break;
2109 }
2110 continue;
2111 }
2112 }
2113
2114 /* Invalidate the header area */
2115 if ( (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) &&
2116 (psInfo->ppshheader.dwFlags & PSH_HEADER) )
2117 {
2118 HWND hwndLineHeader = GetDlgItem(hwndDlg, IDC_SUNKEN_LINEHEADER);
2119 RECT r;
2120
2121 GetClientRect(hwndLineHeader, &r);
2122 MapWindowPoints(hwndLineHeader, hwndDlg, (LPPOINT) &r, 2);
2123 SetRect(&r, 0, 0, r.right + 1, r.top - 1);
2124
2125 InvalidateRect(hwndDlg, &r, TRUE);
2126 }
2127
2128 /*
2129 * Display the new page.
2130 */
2131 PROPSHEET_ShowPage(hwndDlg, index, psInfo);
2132
2133 if (psInfo->proppage[index].hasHelp)
2134 EnableWindow(hwndHelp, TRUE);
2135 else
2136 EnableWindow(hwndHelp, FALSE);
2137
2138 return TRUE;
2139}
static void PROPSHEET_GetPageRect(const PropSheetInfo *psInfo, HWND hwndDlg, RECT *rc, LPCPROPSHEETPAGEW ppshpage)
Definition: propsheet.c:252
#define HWND_TOP
Definition: winuser.h:1218
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

Referenced by PROPSHEET_Back(), PROPSHEET_DialogProc(), PROPSHEET_InsertPage(), PROPSHEET_IsDialogMessage(), PROPSHEET_Next(), PROPSHEET_RemovePage(), and PROPSHEET_SetCurSelId().

◆ PROPSHEET_SetCurSelId()

static void PROPSHEET_SetCurSelId ( HWND  hwndDlg,
int  id 
)
static

Definition at line 2146 of file propsheet.c.

2147{
2148 int idx;
2149 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2150
2151 idx = PROPSHEET_FindPageByResId(psInfo, id);
2152 if (idx < psInfo->nPages )
2153 {
2154 if (PROPSHEET_CanSetCurSel(hwndDlg) != FALSE)
2155 PROPSHEET_SetCurSel(hwndDlg, idx, 1, 0);
2156 }
2157}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_SetFinishTextA()

static void PROPSHEET_SetFinishTextA ( HWND  hwndDlg,
LPCSTR  lpszText 
)
static

Definition at line 2209 of file propsheet.c.

2210{
2211 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2212 HWND hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
2213
2214 TRACE("'%s'\n", lpszText);
2215 /* Set text, show and enable the Finish button */
2216 SetWindowTextA(hwndButton, lpszText);
2217 ShowWindow(hwndButton, SW_SHOW);
2218 EnableWindow(hwndButton, TRUE);
2219
2220 /* Make it default pushbutton */
2222
2223 /* Hide Back button */
2224 hwndButton = GetDlgItem(hwndDlg, IDC_BACK_BUTTON);
2225 ShowWindow(hwndButton, SW_HIDE);
2226
2227 if (!psInfo->hasFinish)
2228 {
2229 /* Hide Next button */
2230 hwndButton = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
2231 ShowWindow(hwndButton, SW_HIDE);
2232 }
2233}
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
#define SW_SHOW
Definition: winuser.h:786

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_SetFinishTextW()

static void PROPSHEET_SetFinishTextW ( HWND  hwndDlg,
LPCWSTR  lpszText 
)
static

Definition at line 2238 of file propsheet.c.

2239{
2240 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2241 HWND hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
2242
2243 TRACE("%s\n", debugstr_w(lpszText));
2244 /* Set text, show and enable the Finish button */
2245 SetWindowTextW(hwndButton, lpszText);
2246 ShowWindow(hwndButton, SW_SHOW);
2247 EnableWindow(hwndButton, TRUE);
2248
2249 /* Make it default pushbutton */
2251
2252 /* Hide Back button */
2253 hwndButton = GetDlgItem(hwndDlg, IDC_BACK_BUTTON);
2254 ShowWindow(hwndButton, SW_HIDE);
2255
2256 if (!psInfo->hasFinish)
2257 {
2258 /* Hide Next button */
2259 hwndButton = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
2260 ShowWindow(hwndButton, SW_HIDE);
2261 }
2262}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_SetHeaderSubTitleA()

static void PROPSHEET_SetHeaderSubTitleA ( HWND  hwndDlg,
UINT  page_index,
const char subtitle 
)
static

Definition at line 2630 of file propsheet.c.

2631{
2632 WCHAR *subtitleW;
2633
2634 TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_a(subtitle));
2635
2636 subtitleW = heap_strdupAtoW(subtitle);
2637 PROPSHEET_SetHeaderSubTitleW(hwndDlg, page_index, subtitleW);
2638 Free(subtitleW);
2639}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_SetHeaderSubTitleW()

static void PROPSHEET_SetHeaderSubTitleW ( HWND  hwndDlg,
UINT  page_index,
const WCHAR subtitle 
)
static

Definition at line 2608 of file propsheet.c.

2609{
2610 PropSheetInfo *psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2612
2613 TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_w(subtitle));
2614
2615 if (page_index >= psInfo->nPages)
2616 return;
2617
2618 page = (PROPSHEETPAGEW *)psInfo->proppage[page_index].hpage;
2619
2620 if (!IS_INTRESOURCE(page->pszHeaderSubTitle))
2621 Free((void *)page->pszHeaderSubTitle);
2622
2623 page->pszHeaderSubTitle = heap_strdupW(subtitle);
2624 page->dwFlags |= PSP_USEHEADERSUBTITLE;
2625}

Referenced by PROPSHEET_DialogProc(), and PROPSHEET_SetHeaderSubTitleA().

◆ PROPSHEET_SetHeaderTitleA()

static void PROPSHEET_SetHeaderTitleA ( HWND  hwndDlg,
UINT  page_index,
const char title 
)
static

Definition at line 2594 of file propsheet.c.

2595{
2596 WCHAR *titleW;
2597
2598 TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_a(title));
2599
2601 PROPSHEET_SetHeaderTitleW(hwndDlg, page_index, titleW);
2602 Free(titleW);
2603}
static const WCHAR titleW[]
Definition: htmlelem.c:1067
static char title[]
Definition: ps.c:92

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_SetHeaderTitleW()

static void PROPSHEET_SetHeaderTitleW ( HWND  hwndDlg,
UINT  page_index,
const WCHAR title 
)
static

Definition at line 2572 of file propsheet.c.

2573{
2574 PropSheetInfo *psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2576
2577 TRACE("(%p, %u, %s)\n", hwndDlg, page_index, debugstr_w(title));
2578
2579 if (page_index >= psInfo->nPages)
2580 return;
2581
2582 page = (PROPSHEETPAGEW *)psInfo->proppage[page_index].hpage;
2583
2584 if (!IS_INTRESOURCE(page->pszHeaderTitle))
2585 Free((void *)page->pszHeaderTitle);
2586
2587 page->pszHeaderTitle = heap_strdupW(title);
2588 page->dwFlags |= PSP_USEHEADERTITLE;
2589}

Referenced by PROPSHEET_DialogProc(), and PROPSHEET_SetHeaderTitleA().

◆ PROPSHEET_SetTitleA()

static void PROPSHEET_SetTitleA ( HWND  hwndDlg,
DWORD  dwStyle,
LPCSTR  lpszText 
)
static

Definition at line 2162 of file propsheet.c.

2163{
2164 if(!IS_INTRESOURCE(lpszText))
2165 {
2166 WCHAR szTitle[256];
2168 PROPSHEET_SetTitleW(hwndDlg, dwStyle, szTitle);
2169 }
2170 else
2171 {
2172 PROPSHEET_SetTitleW(hwndDlg, dwStyle, (LPCWSTR)lpszText);
2173 }
2174}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_SetTitleW()

static void PROPSHEET_SetTitleW ( HWND  hwndDlg,
DWORD  dwStyle,
LPCWSTR  lpszText 
)
static

Definition at line 2179 of file propsheet.c.

2180{
2181 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2182 WCHAR szTitle[256];
2183
2184 TRACE("%s (style %08x)\n", debugstr_w(lpszText), dwStyle);
2185 if (IS_INTRESOURCE(lpszText)) {
2186 if (!LoadStringW(psInfo->ppshheader.hInstance, LOWORD(lpszText), szTitle, ARRAY_SIZE(szTitle)))
2187 return;
2188 lpszText = szTitle;
2189 }
2190 if (dwStyle & PSH_PROPTITLE)
2191 {
2192 WCHAR* dest;
2193 int lentitle = lstrlenW(lpszText);
2194 int lenprop = lstrlenW(psInfo->strPropertiesFor);
2195
2196 dest = Alloc( (lentitle + lenprop + 1)*sizeof (WCHAR));
2197 wsprintfW(dest, psInfo->strPropertiesFor, lpszText);
2198
2199 SetWindowTextW(hwndDlg, dest);
2200 Free(dest);
2201 }
2202 else
2203 SetWindowTextW(hwndDlg, lpszText);
2204}
static char * dest
Definition: rtl.c:149
#define PSH_PROPTITLE
Definition: prsht.h:40
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by PROPSHEET_DialogProc(), PROPSHEET_SetTitleA(), and PROPSHEET_ShowPage().

◆ PROPSHEET_SetWizButtons()

static void PROPSHEET_SetWizButtons ( HWND  hwndDlg,
DWORD  dwFlags 
)
static

Definition at line 2498 of file propsheet.c.

2499{
2500 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2501 HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON);
2502 HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
2503 HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
2504 BOOL enable_finish = ((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH);
2505
2506#ifdef __REACTOS__
2507 HWND hwndCancel = GetDlgItem(hwndDlg, IDCANCEL);
2508 INT iDefItem = 0;
2509 HWND hwndFocus;
2510#endif
2511
2512 TRACE("%d\n", dwFlags);
2513
2514 EnableWindow(hwndBack, dwFlags & PSWIZB_BACK);
2515 EnableWindow(hwndNext, dwFlags & PSWIZB_NEXT);
2516 EnableWindow(hwndFinish, enable_finish);
2517
2518#ifndef __REACTOS__
2519 /* set the default pushbutton to an enabled button */
2520 if (enable_finish)
2522 else if (dwFlags & PSWIZB_NEXT)
2524 else if (dwFlags & PSWIZB_BACK)
2526 else
2527 SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0);
2528#endif
2529
2530 if (!psInfo->hasFinish)
2531 {
2533 {
2534 /* Hide the Next button */
2535 ShowWindow(hwndNext, SW_HIDE);
2536
2537 /* Show the Finish button */
2538 ShowWindow(hwndFinish, SW_SHOW);
2539 }
2540 else
2541 {
2542 /* Hide the Finish button */
2543 ShowWindow(hwndFinish, SW_HIDE);
2544 /* Show the Next button */
2545 ShowWindow(hwndNext, SW_SHOW);
2546 }
2547 }
2548
2549#ifdef __REACTOS__
2550 /* set the default pushbutton to an enabled button */
2551 if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH))
2552 iDefItem = IDC_FINISH_BUTTON;
2553 else if (dwFlags & PSWIZB_NEXT)
2554 iDefItem = IDC_NEXT_BUTTON;
2555 else if (dwFlags & PSWIZB_BACK)
2556 iDefItem = IDC_BACK_BUTTON;
2557 else
2558 iDefItem = IDCANCEL;
2559 SendMessageW(hwndDlg, DM_SETDEFID, iDefItem, 0);
2560
2561 /* Set focus if no control has it */
2562 hwndFocus = GetFocus();
2563 if (!hwndFocus || hwndFocus == hwndCancel)
2564 SetFocus(GetDlgItem(hwndDlg, iDefItem));
2565#endif
2566
2567}
#define PSWIZB_DISABLEDFINISH
Definition: prsht.h:156
#define PSWIZB_FINISH
Definition: prsht.h:155
HWND WINAPI GetFocus(void)
Definition: window.c:1887

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_ShowPage()

static BOOL PROPSHEET_ShowPage ( HWND  hwndDlg,
int  index,
PropSheetInfo psInfo 
)
static

Definition at line 1545 of file propsheet.c.

1546{
1547 HWND hwndTabCtrl;
1548 HWND hwndLineHeader;
1549#ifndef __REACTOS__
1550 HWND control;
1551#endif
1552 LPCPROPSHEETPAGEW ppshpage;
1553
1554 TRACE("active_page %d, index %d\n", psInfo->active_page, index);
1555 if (index == psInfo->active_page)
1556 {
1557 if (GetTopWindow(hwndDlg) != psInfo->proppage[index].hwndPage)
1559 return TRUE;
1560 }
1561
1562 ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage;
1563 if (psInfo->proppage[index].hwndPage == 0)
1564 {
1565 PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage);
1566 }
1567
1568 if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
1569 {
1570 PROPSHEET_SetTitleW(hwndDlg, psInfo->ppshheader.dwFlags,
1571 psInfo->proppage[index].pszText);
1572#ifndef __REACTOS__
1573
1575 if(control != NULL)
1577#endif
1578 }
1579
1580 if (psInfo->active_page != -1)
1581 ShowWindow(psInfo->proppage[psInfo->active_page].hwndPage, SW_HIDE);
1582
1584
1585 /* Synchronize current selection with tab control
1586 * It seems to be needed even in case of PSH_WIZARD (no tab controls there) */
1587 hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
1588 SendMessageW(hwndTabCtrl, TCM_SETCURSEL, index, 0);
1589
1590 psInfo->active_page = index;
1591 psInfo->activeValid = TRUE;
1592
1593#ifdef __REACTOS__
1594 PROPSHEET_SetInitialFocus(hwndDlg, index, psInfo);
1595#endif
1596
1597 if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW) )
1598 {
1599 hwndLineHeader = GetDlgItem(hwndDlg, IDC_SUNKEN_LINEHEADER);
1600 ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage;
1601
1602 if ((ppshpage->dwFlags & PSP_HIDEHEADER) || (!(psInfo->ppshheader.dwFlags & PSH_HEADER)) )
1603 ShowWindow(hwndLineHeader, SW_HIDE);
1604 else
1605 ShowWindow(hwndLineHeader, SW_SHOW);
1606 }
1607
1608 return TRUE;
1609}
Definition: dialog.c:52
HWND WINAPI GetTopWindow(_In_opt_ HWND)
HWND WINAPI GetNextDlgTabItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)

Referenced by PROPSHEET_Apply(), and PROPSHEET_SetCurSel().

◆ PROPSHEET_SizeMismatch()

static BOOL PROPSHEET_SizeMismatch ( HWND  hwndDlg,
const PropSheetInfo psInfo 
)
static

Definition at line 714 of file propsheet.c.

715{
716 HWND hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
717 RECT rcOrigTab, rcPage;
718
719 /*
720 * Original tab size.
721 */
722 GetClientRect(hwndTabCtrl, &rcOrigTab);
723 TRACE("orig tab %s\n", wine_dbgstr_rect(&rcOrigTab));
724
725 /*
726 * Biggest page size.
727 */
728 SetRect(&rcPage, 0, 0, psInfo->width, psInfo->height);
729 MapDialogRect(hwndDlg, &rcPage);
730 TRACE("biggest page %s\n", wine_dbgstr_rect(&rcPage));
731
732 if ( (rcPage.right - rcPage.left) != (rcOrigTab.right - rcOrigTab.left) )
733 return TRUE;
734 if ( (rcPage.bottom - rcPage.top) != (rcOrigTab.bottom - rcOrigTab.top) )
735 return TRUE;
736
737 return FALSE;
738}

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_UnChanged()

static void PROPSHEET_UnChanged ( HWND  hwndDlg,
HWND  hwndCleanPage 
)
static

Definition at line 1901 of file propsheet.c.

1902{
1903 int i;
1904 BOOL noPageDirty = TRUE;
1905 HWND hwndApplyBtn = GetDlgItem(hwndDlg, IDC_APPLY_BUTTON);
1906 PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1907
1908 TRACE("\n");
1909 if ( !psInfo ) return;
1910 for (i = 0; i < psInfo->nPages; i++)
1911 {
1912 /* set the specified page as clean */
1913 if (psInfo->proppage[i].hwndPage == hwndCleanPage)
1914 psInfo->proppage[i].isDirty = FALSE;
1915
1916 /* look to see if there are any dirty pages */
1917 if (psInfo->proppage[i].isDirty)
1918 noPageDirty = FALSE;
1919 }
1920
1921 /*
1922 * Disable Apply button.
1923 */
1924 if (noPageDirty)
1925 EnableWindow(hwndApplyBtn, FALSE);
1926}

Referenced by PROPSHEET_CreatePage(), and PROPSHEET_DialogProc().

◆ PROPSHEET_UnImplementedFlags()

static VOID PROPSHEET_UnImplementedFlags ( DWORD  dwFlags)
static

Definition at line 226 of file propsheet.c.

227{
228 CHAR string[256];
229
230 string[0] = '\0';
231
232 /*
233 * unhandled header flags:
234 * PSH_RTLREADING 0x00000800
235 * PSH_STRETCHWATERMARK 0x00040000
236 * PSH_USEPAGELANG 0x00200000
237 */
238
240 add_flag(PSH_STRETCHWATERMARK);
241 add_flag(PSH_USEPAGELANG);
242 if (string[0] != '\0')
243 FIXME("%s\n", string);
244}
#define add_flag(a)
Definition: propsheet.c:196
char CHAR
Definition: pedump.c:57
#define PSH_RTLREADING
Definition: prsht.h:51

Referenced by PROPSHEET_CollectSheetInfoCommon().

◆ PROPSHEET_WizardSubclassProc()

static LRESULT CALLBACK PROPSHEET_WizardSubclassProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
UINT_PTR  uID,
DWORD_PTR  dwRef 
)
static

Definition at line 1209 of file propsheet.c.

1210{
1211 switch (uMsg)
1212 {
1213 case WM_ERASEBKGND:
1214 return TRUE;
1215
1216 case WM_CTLCOLORSTATIC:
1219 }
1220
1221 return DefSubclassProc(hwnd, uMsg, wParam, lParam);
1222}
LRESULT WINAPI DefSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: commctrl.c:1507
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
#define WM_ERASEBKGND
Definition: winuser.h:1653
DWORD WINAPI GetSysColor(_In_ int)
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1800

Referenced by PROPSHEET_CleanUp(), PROPSHEET_CreatePage(), and PROPSHEET_RemovePage().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( propsheet  )

Variable Documentation

◆ PropSheetInfoStr