ReactOS  0.4.14-dev-608-gd495a4f
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 "wine/unicode.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 198 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 152 of file propsheet.c.

◆ MAX_BUTTONTEXT_LENGTH

#define MAX_BUTTONTEXT_LENGTH   64

Definition at line 150 of file propsheet.c.

◆ MAX_CAPTION_LENGTH

#define MAX_CAPTION_LENGTH   255

Definition at line 148 of file propsheet.c.

◆ MAX_TABTEXT_LENGTH

#define MAX_TABTEXT_LENGTH   255

Definition at line 149 of file propsheet.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 55 of file propsheet.c.

◆ PSP_INTERNAL_UNICODE

#define PSP_INTERNAL_UNICODE   0x80000000

Definition at line 146 of file propsheet.c.

◆ WIZARD_HEADER_HEIGHT

#define WIZARD_HEADER_HEIGHT   36

Definition at line 156 of file propsheet.c.

◆ WIZARD_PADDING

#define WIZARD_PADDING   7

Definition at line 155 of file propsheet.c.

Typedef Documentation

◆ PropPageInfo

◆ PropSheetInfo

Function Documentation

◆ CreatePropertySheetPageA()

HPROPSHEETPAGE WINAPI CreatePropertySheetPageA ( LPCPROPSHEETPAGEA  lpPropSheetPage)

Definition at line 2991 of file propsheet.c.

2993 {
2994  PROPSHEETPAGEW *ppsp;
2995 
2996  if (lpPropSheetPage->dwSize < PROPSHEETPAGEA_V1_SIZE)
2997  return NULL;
2998 
2999  /* original data is used for callback notifications */
3000  if ((lpPropSheetPage->dwFlags & PSP_USECALLBACK) && lpPropSheetPage->pfnCallback)
3001  {
3002  ppsp = Alloc(2 * sizeof(*ppsp));
3003  memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA)));
3004  memcpy(ppsp + 1, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA)));
3005  }
3006  else
3007  {
3008  ppsp = Alloc(sizeof(*ppsp));
3009  memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA)));
3010  }
3011 
3012  ppsp->dwFlags &= ~PSP_INTERNAL_UNICODE;
3013 
3014  if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
3015  {
3016  if (!IS_INTRESOURCE( ppsp->u.pszTemplate ))
3017  {
3018  int len = strlen(lpPropSheetPage->u.pszTemplate) + 1;
3019  char *template = Alloc( len );
3020 
3021  ppsp->u.pszTemplate = (LPWSTR)strcpy( template, lpPropSheetPage->u.pszTemplate );
3022  }
3023  }
3024 
3025  if (ppsp->dwFlags & PSP_USEICONID)
3026  {
3027  if (!IS_INTRESOURCE( ppsp->u2.pszIcon ))
3028  ppsp->u2.pszIcon = heap_strdupAtoW( lpPropSheetPage->u2.pszIcon );
3029  }
3030 
3031  if (ppsp->dwFlags & PSP_USETITLE)
3032  {
3033  if (IS_INTRESOURCE( ppsp->pszTitle ))
3034  ppsp->pszTitle = load_string( ppsp->hInstance, ppsp->pszTitle );
3035  else
3036  ppsp->pszTitle = heap_strdupAtoW( lpPropSheetPage->pszTitle );
3037  }
3038  else
3039  ppsp->pszTitle = NULL;
3040 
3041  if (ppsp->dwFlags & PSP_HIDEHEADER)
3042  ppsp->dwFlags &= ~(PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE);
3043 
3044  if (ppsp->dwFlags & PSP_USEHEADERTITLE)
3045  {
3046  if (IS_INTRESOURCE( ppsp->pszHeaderTitle ))
3047  ppsp->pszHeaderTitle = load_string( ppsp->hInstance, ppsp->pszHeaderTitle );
3048  else
3049  ppsp->pszHeaderTitle = heap_strdupAtoW( lpPropSheetPage->pszHeaderTitle );
3050  }
3051  else
3052  ppsp->pszHeaderTitle = NULL;
3053 
3054  if (ppsp->dwFlags & PSP_USEHEADERSUBTITLE)
3055  {
3056  if (IS_INTRESOURCE( ppsp->pszHeaderSubTitle ))
3057  ppsp->pszHeaderSubTitle = load_string( ppsp->hInstance, ppsp->pszHeaderSubTitle );
3058  else
3059  ppsp->pszHeaderSubTitle = heap_strdupAtoW( lpPropSheetPage->pszHeaderSubTitle );
3060  }
3061  else
3062  ppsp->pszHeaderSubTitle = NULL;
3063 
3064  if ((ppsp->dwFlags & PSP_USECALLBACK) && ppsp->dwSize > PROPSHEETPAGEA_V1_SIZE && ppsp->pfnCallback)
3065  ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp + 1);
3066 
3067  return (HPROPSHEETPAGE)ppsp;
3068 }
LPCWSTR pszTemplate
Definition: prsht.h:209
DWORD dwSize
Definition: prsht.h:177
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
LPCSTR pszTitle
Definition: prsht.h:188
LPCSTR pszTemplate
Definition: prsht.h:181
#define PSP_USEICONID
Definition: prsht.h:25
#define PSP_USECALLBACK
Definition: prsht.h:30
DWORD dwSize
Definition: prsht.h:205
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
LPCSTR pszIcon
Definition: prsht.h:186
LPCWSTR pszTitle
Definition: prsht.h:216
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define PROPSHEETPAGEA_V1_SIZE
Definition: prsht.h:200
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
static WCHAR * heap_strdupAtoW(const char *str)
Definition: propsheet.c:186
HINSTANCE hInstance
Definition: prsht.h:207
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
DWORD dwFlags
Definition: prsht.h:178
#define PSP_USETITLE
Definition: prsht.h:26
#define min(a, b)
Definition: monoChain.cc:55
#define PSP_INTERNAL_UNICODE
Definition: propsheet.c:146
#define PSPCB_ADDREF
Definition: prsht.h:171
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
LPCWSTR pszIcon
Definition: prsht.h:214
static LPWSTR load_string(HINSTANCE instance, LPCWSTR str)
Definition: propsheet.c:2941
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DWORD dwFlags
Definition: prsht.h:206
#define PSP_DLGINDIRECT
Definition: prsht.h:23

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

◆ CreatePropertySheetPageW()

HPROPSHEETPAGE WINAPI CreatePropertySheetPageW ( LPCPROPSHEETPAGEW  lpPropSheetPage)

Definition at line 3075 of file propsheet.c.

3076 {
3077  PROPSHEETPAGEW *ppsp;
3078 
3079  if (lpPropSheetPage->dwSize < PROPSHEETPAGEW_V1_SIZE)
3080  return NULL;
3081 
3082  /* original data is used for callback notifications */
3083  if ((lpPropSheetPage->dwFlags & PSP_USECALLBACK) && lpPropSheetPage->pfnCallback)
3084  {
3085  ppsp = Alloc(2 * sizeof(*ppsp));
3086  memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW)));
3087  memcpy(ppsp + 1, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW)));
3088  }
3089  else
3090  {
3091  ppsp = Alloc(sizeof(*ppsp));
3092  memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW)));
3093  }
3094 
3095  ppsp->dwFlags |= PSP_INTERNAL_UNICODE;
3096 
3097  if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
3098  {
3099  if (!IS_INTRESOURCE( ppsp->u.pszTemplate ))
3100  ppsp->u.pszTemplate = heap_strdupW( lpPropSheetPage->u.pszTemplate );
3101  }
3102 
3103  if ( ppsp->dwFlags & PSP_USEICONID )
3104  {
3105  if (!IS_INTRESOURCE( ppsp->u2.pszIcon ))
3106  ppsp->u2.pszIcon = heap_strdupW( lpPropSheetPage->u2.pszIcon );
3107  }
3108 
3109  if (ppsp->dwFlags & PSP_USETITLE)
3110  ppsp->pszTitle = load_string( ppsp->hInstance, ppsp->pszTitle );
3111  else
3112  ppsp->pszTitle = NULL;
3113 
3114  if (ppsp->dwFlags & PSP_HIDEHEADER)
3115  ppsp->dwFlags &= ~(PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE);
3116 
3117  if (ppsp->dwFlags & PSP_USEHEADERTITLE)
3118  ppsp->pszHeaderTitle = load_string( ppsp->hInstance, ppsp->pszHeaderTitle );
3119  else
3120  ppsp->pszHeaderTitle = NULL;
3121 
3122  if (ppsp->dwFlags & PSP_USEHEADERSUBTITLE)
3123  ppsp->pszHeaderSubTitle = load_string( ppsp->hInstance, ppsp->pszHeaderSubTitle );
3124  else
3125  ppsp->pszHeaderSubTitle = NULL;
3126 
3127  if ((ppsp->dwFlags & PSP_USECALLBACK) && ppsp->dwSize > PROPSHEETPAGEW_V1_SIZE && ppsp->pfnCallback)
3128  ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp + 1);
3129 
3130  return (HPROPSHEETPAGE)ppsp;
3131 }
LPCWSTR pszTemplate
Definition: prsht.h:209
#define PSP_USEICONID
Definition: prsht.h:25
#define PSP_USECALLBACK
Definition: prsht.h:30
DWORD dwSize
Definition: prsht.h:205
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR pszTitle
Definition: prsht.h:216
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
HINSTANCE hInstance
Definition: prsht.h:207
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define PSP_USETITLE
Definition: prsht.h:26
#define min(a, b)
Definition: monoChain.cc:55
#define PROPSHEETPAGEW_V1_SIZE
Definition: prsht.h:228
#define PSP_INTERNAL_UNICODE
Definition: propsheet.c:146
#define PSPCB_ADDREF
Definition: prsht.h:171
LPCWSTR pszIcon
Definition: prsht.h:214
static LPWSTR load_string(HINSTANCE instance, LPCWSTR str)
Definition: propsheet.c:2941
DWORD dwFlags
Definition: prsht.h:206
#define PSP_DLGINDIRECT
Definition: prsht.h:23

Referenced by init_functions(), InitializePropertySheetPage(), NetPropPageProvider(), OleCreatePropertyFrameIndirect(), ParallelPortPropPageProvider(), PropertySheetW(), PS2MousePropPageProvider(), SerialPortPropPageProvider(), and SH_CreatePropertySheetPage().

◆ DestroyPropertySheetPage()

BOOL WINAPI DestroyPropertySheetPage ( HPROPSHEETPAGE  hPropPage)

Definition at line 3144 of file propsheet.c.

3145 {
3146  PROPSHEETPAGEW *psp = (PROPSHEETPAGEW *)hPropPage;
3147 
3148  if (!psp)
3149  return FALSE;
3150 
3151  if ((psp->dwFlags & PSP_USECALLBACK) && psp->pfnCallback)
3152  psp->pfnCallback(0, PSPCB_RELEASE, psp + 1);
3153 
3154  if (!(psp->dwFlags & PSP_DLGINDIRECT) && !IS_INTRESOURCE( psp->u.pszTemplate ))
3155  Free ((LPVOID)psp->u.pszTemplate);
3156 
3157  if ((psp->dwFlags & PSP_USEICONID) && !IS_INTRESOURCE( psp->u2.pszIcon ))
3158  Free ((LPVOID)psp->u2.pszIcon);
3159 
3160  if ((psp->dwFlags & PSP_USETITLE) && !IS_INTRESOURCE( psp->pszTitle ))
3161  Free ((LPVOID)psp->pszTitle);
3162 
3163  if ((psp->dwFlags & PSP_USEHEADERTITLE) && !IS_INTRESOURCE( psp->pszHeaderTitle ))
3164  Free ((LPVOID)psp->pszHeaderTitle);
3165 
3166  if ((psp->dwFlags & PSP_USEHEADERSUBTITLE) && !IS_INTRESOURCE( psp->pszHeaderSubTitle ))
3167  Free ((LPVOID)psp->pszHeaderSubTitle);
3168 
3169  Free(hPropPage);
3170 
3171  return TRUE;
3172 }
#define TRUE
Definition: types.h:120
LPCWSTR pszTemplate
Definition: prsht.h:209
#define PSP_USEICONID
Definition: prsht.h:25
#define PSP_USECALLBACK
Definition: prsht.h:30
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
LPCWSTR pszTitle
Definition: prsht.h:216
#define PSPCB_RELEASE
Definition: prsht.h:37
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define PSP_USETITLE
Definition: prsht.h:26
LPCWSTR pszIcon
Definition: prsht.h:214
DWORD dwFlags
Definition: prsht.h:206
#define PSP_DLGINDIRECT
Definition: prsht.h:23

Referenced by AddNetIdPage(), CLayerUIPropPage::AddPages(), CNetConnectionPropertyUi::AddPages(), CVfdShExt::AddPages(), BtrfsVolPropSheet::AddPages(), BtrfsPropSheet::AddPages(), 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 2790 of file propsheet.c.

2791 {
2792  MSG msg;
2793  INT ret = -1;
2794  HWND hwnd = psInfo->hwnd;
2795  HWND parent = psInfo->ppshheader.hwndParent;
2796 
2797  while(IsWindow(hwnd) && !psInfo->ended && (ret = GetMessageW(&msg, NULL, 0, 0)))
2798  {
2799  if(ret == -1)
2800  break;
2801 
2802  if(!IsDialogMessageW(hwnd, &msg))
2803  {
2806  }
2807  }
2808 
2809  if(ret == 0)
2810  {
2811  PostQuitMessage(msg.wParam);
2812  ret = -1;
2813  }
2814 
2815  if(ret != -1)
2816  ret = psInfo->result;
2817 
2818  if(parent)
2820 
2822  return ret;
2823 }
HWND hwndParent
Definition: prsht.h:277
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TRUE
Definition: types.h:120
BOOL WINAPI IsWindow(_In_opt_ HWND)
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:56
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
smooth NULL
Definition: ftsmooth.c:416
r parent
Definition: btrfs.c:2869
int ret
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI IsDialogMessageW(_In_ HWND, _In_ LPMSG)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Referenced by PROPSHEET_PropertySheet().

◆ GetTemplateSize()

static UINT GetTemplateSize ( const DLGTEMPLATE pTemplate)
static

Definition at line 1209 of file propsheet.c.

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

Referenced by PROPSHEET_CreatePage().

◆ heap_strdupAtoW()

static WCHAR* heap_strdupAtoW ( const char str)
static

Definition at line 186 of file propsheet.c.

187 {
188  WCHAR *ret;
189  INT len;
190 
191  len = MultiByteToWideChar(CP_ACP, 0, str, -1, 0, 0);
192  ret = Alloc(len * sizeof(WCHAR));
193  MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
194 
195  return ret;
196 }
#define CP_ACP
Definition: compat.h:99
int32_t INT
Definition: typedefs.h:56
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100

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

◆ heap_strdupW()

static WCHAR* heap_strdupW ( const WCHAR str)
static

Definition at line 178 of file propsheet.c.

179 {
180  int len = strlenW(str) + 1;
181  WCHAR *ret = Alloc(len * sizeof(WCHAR));
182  strcpyW(ret, str);
183  return ret;
184 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
int ret
GLenum GLsizei len
Definition: glext.h:6722
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219

Referenced by add_prop(), alloc_global_prop(), alloc_prop(), alloc_vbscode(), APPINFO_SetOption(), BPInternetProtocolSink_ReportProgress(), BPInternetProtocolSink_ReportResult(), cache_authorization(), cache_basic_authorization(), cache_containers_add(), cache_file_available(), create_channelbsc(), create_class_object(), create_req_file(), create_signature_columns_and_data(), create_table(), CreatePropertySheetPageW(), dispid_from_elem_name(), DownloadBSC_Create(), DownloadBSC_OnProgress(), fill_cdromdrive(), fill_diskdrive(), fill_diskpartition(), fill_logicaldisk(), fill_networkadapter(), fill_networkadapterconfig(), fill_operatingsystem(), fill_pnpentity(), fill_printer(), fill_process(), fill_processor(), fill_service(), fill_sid(), fill_videocontroller(), fix_url_value(), FTP_Connect(), FTP_FtpOpenFileW(), FtpCreateDirectoryW(), FtpDeleteFileW(), FtpFindFirstFileW(), FtpGetFileW(), FtpOpenFileW(), FtpPutFileW(), FtpRemoveDirectoryW(), FtpRenameFileW(), FtpSetCurrentDirectoryW(), get_accountname(), get_baseboard_manufacturer(), get_baseboard_product(), get_baseboard_serialnumber(), get_baseboard_version(), get_bios_manufacturer(), get_bios_releasedate(), get_bios_smbiosbiosversion(), get_cmdline(), get_compsysproduct_identifyingnumber(), get_compsysproduct_name(), get_compsysproduct_uuid(), get_compsysproduct_vendor(), get_compsysproduct_version(), get_defaultipgateway(), get_diskdrivetodiskpartition_pairs(), get_dnshostname(), get_dnsserversearchorder(), get_dynamic_prop(), get_filesystem(), get_host_header(), get_ipaddress(), get_ipsubnet(), get_logicaldisktopartition_pairs(), get_referenceddomainname(), get_settingid(), get_systemenclosure_manufacturer(), get_useragent(), get_volumename(), get_volumeserialnumber(), HTMLDOMAttribute_Create(), HTMLElement_clone(), HTMLStyle_put_filter(), HTTP_Connect(), HTTP_DoAuthorization(), HTTP_FixURL(), HTTP_GetResponseHeaders(), HTTP_HttpEndRequestW(), HTTP_HttpOpenRequestW(), HTTP_HttpSendRequestW(), HTTP_InsertCustomHeader(), HTTP_ProcessCookies(), HTTPREQ_SetOption(), HTTPSESSION_SetOption(), init_code(), INTERNET_LoadProxySettings(), INTERNET_SendCallback(), InternetOpenUrlW(), InternetOpenW(), InternetProtocolSink_ReportProgress(), InternetSession_RegisterMimeFilter(), InternetSetOptionW(), is_basic_auth_value(), JScript_AddNamedItem(), MetadataQueryReader_CreateInstance(), mime_available(), MonikerProp_PutProperty(), parse_event_elem(), parse_proxy_url(), PROPSHEET_CollectPageInfo(), PROPSHEET_CollectSheetInfoW(), PROPSHEET_SetHeaderSubTitleW(), PROPSHEET_SetHeaderTitleW(), ProtocolSinkHandler_ReportData(), query_global_option(), register_namespace(), retrieve_cached_authorization(), set_dochost_url(), to_array(), to_longlong(), update_travellog(), VBScript_AddNamedItem(), wbem_services_ExecNotificationQueryAsync(), wbem_services_ExecQueryAsync(), WbemQualifierSet_create(), WbemServices_create(), and WININET_SetAuthorization().

◆ load_string()

static LPWSTR load_string ( HINSTANCE  instance,
LPCWSTR  str 
)
static

Definition at line 2941 of file propsheet.c.

2942 {
2943  LPWSTR ret;
2944 
2945  if (IS_INTRESOURCE(str))
2946  {
2947  HRSRC hrsrc;
2948  HGLOBAL hmem;
2949  WCHAR *ptr;
2950  WORD i, id = LOWORD(str);
2951  UINT len;
2952 
2953  if (!(hrsrc = FindResourceW( instance, MAKEINTRESOURCEW((id >> 4) + 1), (LPWSTR)RT_STRING )))
2954  return NULL;
2955  if (!(hmem = LoadResource( instance, hrsrc ))) return NULL;
2956  if (!(ptr = LockResource( hmem ))) return NULL;
2957  for (i = id & 0x0f; i > 0; i--) ptr += *ptr + 1;
2958  len = *ptr;
2959  if (!len) return NULL;
2960  ret = Alloc( (len + 1) * sizeof(WCHAR) );
2961  if (ret)
2962  {
2963  memcpy( ret, ptr + 1, len * sizeof(WCHAR) );
2964  ret[len] = 0;
2965  }
2966  }
2967  else
2968  {
2969  int len = (strlenW(str) + 1) * sizeof(WCHAR);
2970  ret = Alloc( len );
2971  if (ret) memcpy( ret, str, len );
2972  }
2973  return ret;
2974 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
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
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
__wchar_t WCHAR
Definition: xmlstorage.h:180
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
unsigned short WORD
Definition: ntddk_ex.h:93
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define RT_STRING
Definition: pedump.c:368
static HINSTANCE instance
Definition: main.c:40
unsigned int UINT
Definition: ndis.h:50
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LOWORD(l)
Definition: pedump.c:82

Referenced by CreatePropertySheetPageA(), and CreatePropertySheetPageW().

◆ PropertySheetA()

INT_PTR WINAPI PropertySheetA ( LPCPROPSHEETHEADERA  lppsh)

Definition at line 2864 of file propsheet.c.

2865 {
2866  PropSheetInfo* psInfo = GlobalAlloc(GPTR, sizeof(PropSheetInfo));
2867  UINT i, n;
2868  const BYTE* pByte;
2869 
2870  TRACE("(%p)\n", lppsh);
2871 
2872  PROPSHEET_CollectSheetInfoA(lppsh, psInfo);
2873 
2874  psInfo->proppage = Alloc(sizeof(PropPageInfo) * lppsh->nPages);
2875  pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp;
2876 
2877  for (n = i = 0; i < lppsh->nPages; i++, n++)
2878  {
2879  if (!psInfo->usePropPage)
2880  psInfo->proppage[n].hpage = psInfo->ppshheader.u3.phpage[i];
2881  else
2882  {
2884  pByte += ((LPCPROPSHEETPAGEA)pByte)->dwSize;
2885  }
2886 
2888  psInfo, n, TRUE))
2889  {
2890  if (psInfo->usePropPage)
2892  n--;
2893  psInfo->nPages--;
2894  }
2895  }
2896 
2897  return PROPSHEET_PropertySheet(psInfo, FALSE);
2898 }
#define TRUE
Definition: types.h:120
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:290
#define GPTR
Definition: winbase.h:293
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
Definition: propsheet.c:3144
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
GLdouble n
Definition: glext.h:7729
static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, PropSheetInfo *psInfo, int index, BOOL resize)
Definition: propsheet.c:399
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 void PROPSHEET_CollectSheetInfoA(LPCPROPSHEETHEADERA lppsh, PropSheetInfo *psInfo)
Definition: propsheet.c:317
#define TRACE(s)
Definition: solgame.cpp:4
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
#define for
Definition: utility.h:88
const PROPSHEETPAGEA * LPCPROPSHEETPAGEA
Definition: prsht.h:199
unsigned char BYTE
Definition: mem.h:68
HPROPSHEETPAGE * phpage
Definition: prsht.h:291
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA lpPropSheetPage)
Definition: propsheet.c:2991
HPROPSHEETPAGE hpage
Definition: propsheet.c:99
unsigned int UINT
Definition: ndis.h:50
PropPageInfo * proppage
Definition: propsheet.c:123
static INT_PTR PROPSHEET_PropertySheet(PropSheetInfo *psInfo, BOOL unicode)
Definition: propsheet.c:2830

Referenced by init_functions(), and WINHELP_CreateIndexWindow().

◆ PropertySheetW()

INT_PTR WINAPI PropertySheetW ( LPCPROPSHEETHEADERW  lppsh)

Definition at line 2905 of file propsheet.c.

2906 {
2907  PropSheetInfo* psInfo = GlobalAlloc(GPTR, sizeof(PropSheetInfo));
2908  UINT i, n;
2909  const BYTE* pByte;
2910 
2911  TRACE("(%p)\n", lppsh);
2912 
2913  PROPSHEET_CollectSheetInfoW(lppsh, psInfo);
2914 
2915  psInfo->proppage = Alloc(sizeof(PropPageInfo) * lppsh->nPages);
2916  pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp;
2917 
2918  for (n = i = 0; i < lppsh->nPages; i++, n++)
2919  {
2920  if (!psInfo->usePropPage)
2921  psInfo->proppage[n].hpage = psInfo->ppshheader.u3.phpage[i];
2922  else
2923  {
2925  pByte += ((LPCPROPSHEETPAGEW)pByte)->dwSize;
2926  }
2927 
2929  psInfo, n, TRUE))
2930  {
2931  if (psInfo->usePropPage)
2933  n--;
2934  psInfo->nPages--;
2935  }
2936  }
2937 
2938  return PROPSHEET_PropertySheet(psInfo, TRUE);
2939 }
#define TRUE
Definition: types.h:120
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:290
#define GPTR
Definition: winbase.h:293
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
Definition: propsheet.c:3144
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
GLdouble n
Definition: glext.h:7729
static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, PropSheetInfo *psInfo, int index, BOOL resize)
Definition: propsheet.c:399
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 void PROPSHEET_CollectSheetInfoW(LPCPROPSHEETHEADERW lppsh, PropSheetInfo *psInfo)
Definition: propsheet.c:361
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3075
#define TRACE(s)
Definition: solgame.cpp:4
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
#define for
Definition: utility.h:88
unsigned char BYTE
Definition: mem.h:68
HPROPSHEETPAGE * phpage
Definition: prsht.h:291
const PROPSHEETPAGEW * LPCPROPSHEETPAGEW
Definition: prsht.h:227
HPROPSHEETPAGE hpage
Definition: propsheet.c:99
unsigned int UINT
Definition: ndis.h:50
PropPageInfo * proppage
Definition: propsheet.c:123
static INT_PTR PROPSHEET_PropertySheet(PropSheetInfo *psInfo, BOOL unicode)
Definition: propsheet.c:2830

Referenced by Applet(), CreatePropSheet(), CustomizeLocalePropertySheet(), dialog_viewproperties(), display_cpl_sheets(), EventLogProperties(), INetCfgComponent_fnRaisePropertyUi(), InitApplet(), LaunchAdvancedTcpipSettings(), OleCreatePropertyFrameIndirect(), PropSheetThread(), CZipExtract::runWizard(), SH_ShowDriveProperties(), SH_ShowPropertiesDialog(), SH_ShowRecycleBinProperties(), show_cert_dialog(), show_edit_cert_properties_dialog(), show_export_ui(), show_import_ui(), ShowFolderOptionsDialog(), ShowNetConnectionProperties(), ShowPropSheetW(), ShowStatusPropertyDialog(), SystemApplet(), and wmain().

◆ PROPSHEET_AddPage()

static BOOL PROPSHEET_AddPage ( HWND  hwndDlg,
HPROPSHEETPAGE  hpage 
)
static

Definition at line 2342 of file propsheet.c.

2343 {
2344  PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
2345  TRACE("hwndDlg %p, hpage %p\n", hwndDlg, hpage);
2346  return PROPSHEET_InsertPage(hwndDlg, UlongToPtr(psInfo->nPages), hpage);
2347 }
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:143
#define UlongToPtr(u)
Definition: config.h:106
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage)
Definition: propsheet.c:2248
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 839 of file propsheet.c.

840 {
841  HWND hwndButton = GetDlgItem(hwndParent, IDOK);
842  RECT rcSheet;
843  int x, y;
844  int num_buttons = 2;
845  int buttonWidth, buttonHeight;
847 
848  if (psInfo->hasApply)
849  num_buttons++;
850 
851  if (psInfo->hasHelp)
852  num_buttons++;
853 
854  /*
855  * Obtain the size of the buttons.
856  */
857  GetClientRect(hwndButton, &rcSheet);
858  buttonWidth = rcSheet.right;
859  buttonHeight = rcSheet.bottom;
860 
861  /*
862  * Get the size of the property sheet.
863  */
864  GetClientRect(hwndParent, &rcSheet);
865 
866  /*
867  * All buttons will be at this y coordinate.
868  */
869  y = rcSheet.bottom - (padding.y + buttonHeight);
870 
871  /*
872  * Position OK button and make it default.
873  */
874  hwndButton = GetDlgItem(hwndParent, IDOK);
875 
876  x = rcSheet.right - ((padding.x + buttonWidth) * num_buttons);
877 
878  SetWindowPos(hwndButton, 0, x, y, 0, 0,
880 
882 
883 
884  /*
885  * Position Cancel button.
886  */
887  hwndButton = GetDlgItem(hwndParent, IDCANCEL);
888 
889  x += padding.x + buttonWidth;
890 
891  SetWindowPos(hwndButton, 0, x, y, 0, 0,
893 
894  /*
895  * Position Apply button.
896  */
897  hwndButton = GetDlgItem(hwndParent, IDC_APPLY_BUTTON);
898 
899  if(psInfo->hasApply)
900  x += padding.x + buttonWidth;
901  else
902  ShowWindow(hwndButton, SW_HIDE);
903 
904  SetWindowPos(hwndButton, 0, x, y, 0, 0,
906  EnableWindow(hwndButton, FALSE);
907 
908  /*
909  * Position Help button.
910  */
911  hwndButton = GetDlgItem(hwndParent, IDHELP);
912 
913  x += padding.x + buttonWidth;
914  SetWindowPos(hwndButton, 0, x, y, 0, 0,
916 
917  if(!psInfo->hasHelp)
918  ShowWindow(hwndButton, SW_HIDE);
919 
920  return TRUE;
921 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define IDC_APPLY_BUTTON
Definition: propsheet.c:13
#define SW_HIDE
Definition: winuser.h:762
#define DM_SETDEFID
Definition: winuser.h:2081
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG right
Definition: windef.h:308
#define IDHELP
Definition: resource_2.h:8
static HWND hwndParent
Definition: cryptui.c:300
static PADDING_INFO PROPSHEET_GetPaddingInfo(HWND hwndDlg)
Definition: propsheet.c:1055
unsigned int padding
Definition: isohybrid.c:50
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SWP_NOACTIVATE
Definition: winuser.h:1227
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define SWP_NOSIZE
Definition: winuser.h:1230
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
LONG bottom
Definition: windef.h:309
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define IDCANCEL
Definition: winuser.h:825

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_AdjustButtonsWizard()

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

Definition at line 928 of file propsheet.c.

930 {
931  HWND hwndButton = GetDlgItem(hwndParent, IDCANCEL);
933  HWND hwndLineHeader = GetDlgItem(hwndParent, IDC_SUNKEN_LINEHEADER);
934  RECT rcSheet;
935  int x, y;
936  int num_buttons = 3;
937  int buttonWidth, buttonHeight, lineHeight, lineWidth;
939 
940  if (psInfo->hasHelp)
941  num_buttons++;
942  if (psInfo->hasFinish)
943  num_buttons++;
944 
945  /*
946  * Obtain the size of the buttons.
947  */
948  GetClientRect(hwndButton, &rcSheet);
949  buttonWidth = rcSheet.right;
950  buttonHeight = rcSheet.bottom;
951 
952  GetClientRect(hwndLine, &rcSheet);
953  lineHeight = rcSheet.bottom;
954 
955  /*
956  * Get the size of the property sheet.
957  */
958  GetClientRect(hwndParent, &rcSheet);
959 
960  /*
961  * All buttons will be at this y coordinate.
962  */
963  y = rcSheet.bottom - (padding.y + buttonHeight);
964 
965  /*
966  * Position the Back button.
967  */
968  hwndButton = GetDlgItem(hwndParent, IDC_BACK_BUTTON);
969 
970  x = rcSheet.right - ((padding.x + buttonWidth) * (num_buttons - 1)) - buttonWidth;
971 
972  SetWindowPos(hwndButton, 0, x, y, 0, 0,
974 
975  /*
976  * Position the Next button.
977  */
978  hwndButton = GetDlgItem(hwndParent, IDC_NEXT_BUTTON);
979 
980  x += buttonWidth;
981 
982  SetWindowPos(hwndButton, 0, x, y, 0, 0,
984 
985  /*
986  * Position the Finish button.
987  */
988  hwndButton = GetDlgItem(hwndParent, IDC_FINISH_BUTTON);
989 
990  if (psInfo->hasFinish)
991  x += padding.x + buttonWidth;
992 
993  SetWindowPos(hwndButton, 0, x, y, 0, 0,
995 
996  if (!psInfo->hasFinish)
997  ShowWindow(hwndButton, SW_HIDE);
998 
999  /*
1000  * Position the Cancel button.
1001  */
1002  hwndButton = GetDlgItem(hwndParent, IDCANCEL);
1003 
1004  x += padding.x + buttonWidth;
1005 
1006  SetWindowPos(hwndButton, 0, x, y, 0, 0,
1008 
1009  /*
1010  * Position Help button.
1011  */
1012  hwndButton = GetDlgItem(hwndParent, IDHELP);
1013 
1014  if (psInfo->hasHelp)
1015  {
1016  x += padding.x + buttonWidth;
1017 
1018  SetWindowPos(hwndButton, 0, x, y, 0, 0,
1020  }
1021  else
1022  ShowWindow(hwndButton, SW_HIDE);
1023 
1024  if (psInfo->ppshheader.dwFlags &
1025  (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE))
1026  padding.x = 0;
1027 
1028  /*
1029  * Position and resize the sunken line.
1030  */
1031  x = padding.x;
1032  y = rcSheet.bottom - ((padding.y * 2) + buttonHeight + lineHeight);
1033 
1034  lineWidth = rcSheet.right - (padding.x * 2);
1035  SetWindowPos(hwndLine, 0, x, y, lineWidth, 2,
1037 
1038  /*
1039  * Position and resize the header sunken line.
1040  */
1041 
1042  SetWindowPos(hwndLineHeader, 0, 0, 0, rcSheet.right, 2,
1044  if (!(psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)))
1045  ShowWindow(hwndLineHeader, SW_HIDE);
1046 
1047  return TRUE;
1048 }
#define TRUE
Definition: types.h:120
#define IDC_SUNKEN_LINE
Definition: comctl32.h:51
#define SW_HIDE
Definition: winuser.h:762
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
#define IDC_FINISH_BUTTON
Definition: comctl32.h:50
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG right
Definition: windef.h:308
#define IDHELP
Definition: resource_2.h:8
static HWND hwndParent
Definition: cryptui.c:300
unsigned int padding
Definition: isohybrid.c:50
#define IDC_SUNKEN_LINEHEADER
Definition: comctl32.h:52
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SWP_NOACTIVATE
Definition: winuser.h:1227
DWORD dwFlags
Definition: prsht.h:276
#define IDC_BACK_BUTTON
Definition: comctl32.h:48
#define SWP_NOSIZE
Definition: winuser.h:1230
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheetInfo *psInfo)
Definition: propsheet.c:1082
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define IDC_NEXT_BUTTON
Definition: comctl32.h:49
LONG bottom
Definition: windef.h:309
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define IDCANCEL
Definition: winuser.h:825

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_AdjustSize()

static BOOL PROPSHEET_AdjustSize ( HWND  hwndDlg,
PropSheetInfo psInfo 
)
static

Definition at line 723 of file propsheet.c.

724 {
725  HWND hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
726  HWND hwndButton = GetDlgItem(hwndDlg, IDOK);
727  RECT rc,tabRect;
728  int buttonHeight;
730  RECT units;
731  LONG style;
732 
733  /* Get the height of buttons */
734  GetClientRect(hwndButton, &rc);
735  buttonHeight = rc.bottom;
736 
737  /*
738  * Biggest page size.
739  */
740  SetRect(&rc, 0, 0, psInfo->width, psInfo->height);
741  MapDialogRect(hwndDlg, &rc);
742 
743  /* retrieve the dialog units */
744  units.left = units.right = 4;
745  units.top = units.bottom = 8;
746  MapDialogRect(hwndDlg, &units);
747 
748  /*
749  * Resize the tab control.
750  */
751  GetClientRect(hwndTabCtrl,&tabRect);
752 
753  SendMessageW(hwndTabCtrl, TCM_ADJUSTRECT, FALSE, (LPARAM)&tabRect);
754 
755  if ((rc.bottom - rc.top) < (tabRect.bottom - tabRect.top))
756  {
757  rc.bottom = rc.top + tabRect.bottom - tabRect.top;
758  psInfo->height = MulDiv((rc.bottom - rc.top),8,units.top);
759  }
760 
761  if ((rc.right - rc.left) < (tabRect.right - tabRect.left))
762  {
763  rc.right = rc.left + tabRect.right - tabRect.left;
764  psInfo->width = MulDiv((rc.right - rc.left),4,units.left);
765  }
766 
767  SendMessageW(hwndTabCtrl, TCM_ADJUSTRECT, TRUE, (LPARAM)&rc);
768 
769  rc.right -= rc.left;
770  rc.bottom -= rc.top;
771  TRACE("setting tab %p, rc (0,0)-(%d,%d)\n",
772  hwndTabCtrl, rc.right, rc.bottom);
773  SetWindowPos(hwndTabCtrl, 0, 0, 0, rc.right, rc.bottom,
775 
776  GetClientRect(hwndTabCtrl, &rc);
777 
778  TRACE("tab client rc %s\n", wine_dbgstr_rect(&rc));
779 
780  rc.right += (padding.x * 2);
781  rc.bottom += buttonHeight + (3 * padding.y);
782 
783  style = GetWindowLongW(hwndDlg, GWL_STYLE);
784  if (!(style & WS_CHILD))
786 
787  rc.right -= rc.left;
788  rc.bottom -= rc.top;
789 
790  /*
791  * Resize the property sheet.
792  */
793  TRACE("setting dialog %p, rc (0,0)-(%d,%d)\n",
794  hwndDlg, rc.right, rc.bottom);
795  SetWindowPos(hwndDlg, 0, 0, 0, rc.right, rc.bottom,
797  return TRUE;
798 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define TCM_ADJUSTRECT
Definition: commctrl.h:4081
LONG top
Definition: windef.h:307
BOOL WINAPI MapDialogRect(_In_ HWND, _Inout_ LPRECT)
#define WS_CHILD
Definition: pedump.c:617
LONG left
Definition: windef.h:306
#define SWP_NOZORDER
Definition: winuser.h:1232
LONG right
Definition: windef.h:308
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
long LONG
Definition: pedump.c:60
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
LONG_PTR LPARAM
Definition: windef.h:208
static PADDING_INFO PROPSHEET_GetPaddingInfo(HWND hwndDlg)
Definition: propsheet.c:1055
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int padding
Definition: isohybrid.c:50
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SWP_NOACTIVATE
Definition: winuser.h:1227
const char * wine_dbgstr_rect(const RECT *rect)
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define IDC_TABCONTROL
Definition: comctl32.h:46
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG bottom
Definition: windef.h:309
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
GLfloat units
Definition: glext.h:11727
Arabic default style
Definition: afstyles.h:93
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_AdjustSizeWizard()

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

Definition at line 805 of file propsheet.c.

806 {
807  HWND hwndLine = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE);
808  RECT rc, lineRect, dialogRect;
809 
810  /* Biggest page size */
811  SetRect(&rc, 0, 0, psInfo->width, psInfo->height);
812  MapDialogRect(hwndDlg, &rc);
813 
814  TRACE("Biggest page %s\n", wine_dbgstr_rect(&rc));
815 
816  /* Add space for the buttons row */
817  GetWindowRect(hwndLine, &lineRect);
818  MapWindowPoints(NULL, hwndDlg, (LPPOINT)&lineRect, 2);
819  GetClientRect(hwndDlg, &dialogRect);
820  rc.bottom += dialogRect.bottom - lineRect.top - 1;
821 
822  /* Convert the client coordinates to window coordinates */
824 
825  /* Resize the property sheet */
826  TRACE("setting dialog %p, rc (0,0)-(%d,%d)\n",
827  hwndDlg, rc.right, rc.bottom);
828  SetWindowPos(hwndDlg, 0, 0, 0, rc.right - rc.left, rc.bottom - rc.top,
830 
831  return TRUE;
832 }
#define TRUE
Definition: types.h:120
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define IDC_SUNKEN_LINE
Definition: comctl32.h:51
LONG top
Definition: windef.h:307
BOOL WINAPI MapDialogRect(_In_ HWND, _Inout_ LPRECT)
LONG left
Definition: windef.h:306
#define SWP_NOZORDER
Definition: winuser.h:1232
LONG right
Definition: windef.h:308
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SWP_NOACTIVATE
Definition: winuser.h:1227
const char * wine_dbgstr_rect(const RECT *rect)
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
LONG bottom
Definition: windef.h:309
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_Apply()

static BOOL PROPSHEET_Apply ( HWND  hwndDlg,
LPARAM  lParam 
)
static

Definition at line 1707 of file propsheet.c.

1708 {
1709  int i;
1710  HWND hwndPage;
1711  PSHNOTIFY psn;
1712  PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1713 
1714  TRACE("active_page %d\n", psInfo->active_page);
1715  if (psInfo->active_page < 0)
1716  return FALSE;
1717 
1718  psn.hdr.hwndFrom = hwndDlg;
1719  psn.hdr.idFrom = 0;
1720  psn.lParam = 0;
1721 
1722 
1723  /*
1724  * Send PSN_KILLACTIVE to the current page.
1725  */
1726  psn.hdr.code = PSN_KILLACTIVE;
1727 
1728  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1729 
1730  if (SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn) != FALSE)
1731  return FALSE;
1732 
1733  /*
1734  * Send PSN_APPLY to all pages.
1735  */
1736  psn.hdr.code = PSN_APPLY;
1737  psn.lParam = lParam;
1738 
1739  for (i = 0; i < psInfo->nPages; i++)
1740  {
1741  hwndPage = psInfo->proppage[i].hwndPage;
1742  if (hwndPage)
1743  {
1744  switch (SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn))
1745  {
1746  case PSNRET_INVALID:
1747  PROPSHEET_ShowPage(hwndDlg, i, psInfo);
1748  /* fall through */
1750  return FALSE;
1751  }
1752  }
1753  }
1754 
1755  if(lParam)
1756  {
1757  psInfo->activeValid = FALSE;
1758  }
1759  else if(psInfo->active_page >= 0)
1760  {
1761  psn.hdr.code = PSN_SETACTIVE;
1762  psn.lParam = 0;
1763  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1764  SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1765  }
1766 
1767  return TRUE;
1768 }
#define TRUE
Definition: types.h:120
#define PSN_APPLY
Definition: prsht.h:117
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:143
#define PSN_SETACTIVE
Definition: prsht.h:115
UINT code
Definition: winuser.h:3134
NMHDR hdr
Definition: prsht.h:312
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
#define PSN_KILLACTIVE
Definition: prsht.h:116
UINT_PTR idFrom
Definition: winuser.h:3133
#define PSNRET_INVALID_NOCHANGEPAGE
Definition: prsht.h:131
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
HWND hwndFrom
Definition: winuser.h:3132
#define PSNRET_INVALID
Definition: prsht.h:130
static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo *psInfo)
Definition: propsheet.c:1523
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
PropPageInfo * proppage
Definition: propsheet.c:123
LPARAM lParam
Definition: prsht.h:313
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by PROPSHEET_DialogProc(), and PROPSHEET_DoCommand().

◆ PROPSHEET_Back()

static BOOL PROPSHEET_Back ( HWND  hwndDlg)
static

Definition at line 1584 of file propsheet.c.

1585 {
1586  PSHNOTIFY psn;
1587  HWND hwndPage;
1588  PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1589  LRESULT result;
1590  int idx;
1591 
1592  TRACE("active_page %d\n", psInfo->active_page);
1593  if (psInfo->active_page < 0)
1594  return FALSE;
1595 
1596  psn.hdr.code = PSN_WIZBACK;
1597  psn.hdr.hwndFrom = hwndDlg;
1598  psn.hdr.idFrom = 0;
1599  psn.lParam = 0;
1600 
1601  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1602 
1603  result = SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1604  if (result == -1)
1605  return FALSE;
1606  else if (result == 0)
1607  idx = psInfo->active_page - 1;
1608  else
1610 
1611  if (idx >= 0 && idx < psInfo->nPages)
1612  {
1613  if (PROPSHEET_CanSetCurSel(hwndDlg))
1614  {
1615  SetFocus(GetDlgItem(hwndDlg, IDC_BACK_BUTTON));
1617  PROPSHEET_SetCurSel(hwndDlg, idx, -1, 0);
1618  }
1619  }
1620  return TRUE;
1621 }
#define TRUE
Definition: types.h:120
#define DM_SETDEFID
Definition: winuser.h:2081
HWND WINAPI SetFocus(_In_opt_ HWND)
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:143
UINT code
Definition: winuser.h:3134
NMHDR hdr
Definition: prsht.h:312
static INT PROPSHEET_FindPageByResId(const PropSheetInfo *psInfo, LRESULT resId)
Definition: propsheet.c:274
static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg)
Definition: propsheet.c:1943
UINT_PTR idFrom
Definition: winuser.h:3133
unsigned int idx
Definition: utils.c:41
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
static BOOL PROPSHEET_SetCurSel(HWND hwndDlg, int index, int skipdir, HPROPSHEETPAGE hpage)
Definition: propsheet.c:1982
#define IDC_BACK_BUTTON
Definition: comctl32.h:48
HWND hwndFrom
Definition: winuser.h:3132
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define PSN_WIZBACK
Definition: prsht.h:120
PropPageInfo * proppage
Definition: propsheet.c:123
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: prsht.h:313
GLuint64EXT * result
Definition: glext.h:11304
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by PROPSHEET_DoCommand(), and PROPSHEET_PressButton().

◆ PROPSHEET_Cancel()

static void PROPSHEET_Cancel ( HWND  hwndDlg,
LPARAM  lParam 
)
static

Definition at line 1773 of file propsheet.c.

1774 {
1775  PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1776  HWND hwndPage;
1777  PSHNOTIFY psn;
1778  int i;
1779 
1780  TRACE("active_page %d\n", psInfo->active_page);
1781  if (psInfo->active_page < 0)
1782  return;
1783 
1784  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1785  psn.hdr.code = PSN_QUERYCANCEL;
1786  psn.hdr.hwndFrom = hwndDlg;
1787  psn.hdr.idFrom = 0;
1788  psn.lParam = 0;
1789 
1790  if (SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn))
1791  return;
1792 
1793  psn.hdr.code = PSN_RESET;
1794  psn.lParam = lParam;
1795 
1796  for (i = 0; i < psInfo->nPages; i++)
1797  {
1798  hwndPage = psInfo->proppage[i].hwndPage;
1799 
1800  if (hwndPage)
1801  SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1802  }
1803 
1804  if (psInfo->isModeless)
1805  {
1806  /* makes PSM_GETCURRENTPAGEHWND return NULL */
1807  psInfo->activeValid = FALSE;
1808  }
1809  else
1810  psInfo->ended = TRUE;
1811 }
#define TRUE
Definition: types.h:120
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:143
#define PSN_QUERYCANCEL
Definition: prsht.h:123
UINT code
Definition: winuser.h:3134
NMHDR hdr
Definition: prsht.h:312
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
UINT_PTR idFrom
Definition: winuser.h:3133
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
HWND hwndFrom
Definition: winuser.h:3132
#define PSN_RESET
Definition: prsht.h:118
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
PropPageInfo * proppage
Definition: propsheet.c:123
LPARAM lParam
Definition: prsht.h:313
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by PROPSHEET_DialogProc(), and PROPSHEET_DoCommand().

◆ PROPSHEET_CanSetCurSel()

static BOOL PROPSHEET_CanSetCurSel ( HWND  hwndDlg)
static

Definition at line 1943 of file propsheet.c.

1944 {
1945  PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1946  HWND hwndPage;
1947  PSHNOTIFY psn;
1948  BOOL res = FALSE;
1949 
1950  if (!psInfo)
1951  {
1952  res = FALSE;
1953  goto end;
1954  }
1955 
1956  TRACE("active_page %d\n", psInfo->active_page);
1957  if (psInfo->active_page < 0)
1958  {
1959  res = TRUE;
1960  goto end;
1961  }
1962 
1963  /*
1964  * Notify the current page.
1965  */
1966  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1967  psn.hdr.code = PSN_KILLACTIVE;
1968  psn.hdr.hwndFrom = hwndDlg;
1969  psn.hdr.idFrom = 0;
1970  psn.lParam = 0;
1971 
1972  res = !SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1973 
1974 end:
1975  TRACE("<-- %d\n", res);
1976  return res;
1977 }
#define TRUE
Definition: types.h:120
GLuint GLuint end
Definition: gl.h:1545
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:143
UINT code
Definition: winuser.h:3134
NMHDR hdr
Definition: prsht.h:312
#define PSN_KILLACTIVE
Definition: prsht.h:116
unsigned int BOOL
Definition: ntddk_ex.h:94
UINT_PTR idFrom
Definition: winuser.h:3133
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
HWND hwndFrom
Definition: winuser.h:3132
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
GLuint res
Definition: glext.h:9613
PropPageInfo * proppage
Definition: propsheet.c:123
LPARAM lParam
Definition: prsht.h:313
#define WM_NOTIFY
Definition: richedit.h:61

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 1838 of file propsheet.c.

1839 {
1840  int i;
1841  PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1842 
1843  TRACE("\n");
1844  if (!psInfo) return;
1845  /*
1846  * Set the dirty flag of this page.
1847  */
1848  for (i = 0; i < psInfo->nPages; i++)
1849  {
1850  if (psInfo->proppage[i].hwndPage == hwndDirtyPage)
1851  psInfo->proppage[i].isDirty = TRUE;
1852  }
1853 
1854  /*
1855  * Enable the Apply button.
1856  */
1857  if (psInfo->hasApply)
1858  {
1859  HWND hwndApplyBtn = GetDlgItem(hwndDlg, IDC_APPLY_BUTTON);
1860 
1861  EnableWindow(hwndApplyBtn, TRUE);
1862  }
1863 }
#define TRUE
Definition: types.h:120
#define IDC_APPLY_BUTTON
Definition: propsheet.c:13
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:143
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
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
PropPageInfo * proppage
Definition: propsheet.c:123

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_CleanUp()

static void PROPSHEET_CleanUp ( HWND  hwndDlg)
static

Definition at line 2738 of file propsheet.c.

2739 {
2740  int i;
2741  PropSheetInfo* psInfo = RemovePropW(hwndDlg, PropSheetInfoStr);
2742 
2743  TRACE("\n");
2744  if (!psInfo) return;
2745  if (!IS_INTRESOURCE(psInfo->ppshheader.pszCaption))
2746  Free ((LPVOID)psInfo->ppshheader.pszCaption);
2747 
2748  for (i = 0; i < psInfo->nPages; i++)
2749  {
2750  PROPSHEETPAGEA* psp = (PROPSHEETPAGEA*)psInfo->proppage[i].hpage;
2751 
2752  /* Unsubclass the page dialog window */
2753  if((psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD)) &&
2754  (psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
2755  (psp->dwFlags & PSP_HIDEHEADER))
2756  {
2759  }
2760 
2761  if(psInfo->proppage[i].hwndPage)
2762  DestroyWindow(psInfo->proppage[i].hwndPage);
2763 
2764  if(psp)
2765  {
2766  if (psp->dwFlags & PSP_USETITLE)
2767  Free ((LPVOID)psInfo->proppage[i].pszText);
2768 
2770  }
2771  }
2772 
2773  DeleteObject(psInfo->hFont);
2774  DeleteObject(psInfo->hFontBold);
2775  /* If we created the bitmaps, destroy them */
2776  if ((psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
2777  (!(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK)) )
2778  DeleteObject(psInfo->ppshheader.u4.hbmWatermark);
2779  if ((psInfo->ppshheader.dwFlags & PSH_HEADER) &&
2780  (!(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER)) )
2781  DeleteObject(psInfo->ppshheader.u5.hbmHeader);
2782 
2783  Free(psInfo->proppage);
2784  Free(psInfo->strPropertiesFor);
2785  ImageList_Destroy(psInfo->hImageList);
2786 
2787  GlobalFree(psInfo);
2788 }
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
Definition: propsheet.c:3144
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:143
BOOL WINAPI DestroyWindow(_In_ HWND)
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
LPWSTR strPropertiesFor
Definition: propsheet.c:113
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
HIMAGELIST hImageList
Definition: propsheet.c:128
LPCWSTR pszCaption
Definition: prsht.h:283
LPCWSTR pszText
Definition: propsheet.c:102
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
DWORD dwFlags
Definition: prsht.h:276
DWORD dwFlags
Definition: prsht.h:178
#define PSP_USETITLE
Definition: prsht.h:26
BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
Definition: commctrl.c:1390
HPROPSHEETPAGE hpage
Definition: propsheet.c:99
PropPageInfo * proppage
Definition: propsheet.c:123
static LRESULT CALLBACK PROPSHEET_WizardSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uID, DWORD_PTR dwRef)
Definition: propsheet.c:1187

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_CollectPageInfo()

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

Definition at line 399 of file propsheet.c.

402 {
403  const DLGTEMPLATE* pTemplate;
404  const WORD* p;
405  DWORD dwFlags;
406  int width, height;
407 
408  if (!lppsp)
409  return FALSE;
410 
411  TRACE("\n");
412  psInfo->proppage[index].hpage = (HPROPSHEETPAGE)lppsp;
413  psInfo->proppage[index].hwndPage = 0;
414  psInfo->proppage[index].isDirty = FALSE;
415 
416  /*
417  * Process property page flags.
418  */
419  dwFlags = lppsp->dwFlags;
420  psInfo->proppage[index].useCallback = (dwFlags & PSP_USECALLBACK) && (lppsp->pfnCallback);
423 
424  /* as soon as we have a page with the help flag, set the sheet flag on */
425  if (psInfo->proppage[index].hasHelp)
426  psInfo->hasHelp = TRUE;
427 
428  /*
429  * Process page template.
430  */
431  if (dwFlags & PSP_DLGINDIRECT)
432  pTemplate = lppsp->u.pResource;
433  else if(dwFlags & PSP_INTERNAL_UNICODE )
434  {
435  HRSRC hResource = FindResourceW(lppsp->hInstance,
436  lppsp->u.pszTemplate,
437  (LPWSTR)RT_DIALOG);
438  HGLOBAL hTemplate = LoadResource(lppsp->hInstance,
439  hResource);
440  pTemplate = LockResource(hTemplate);
441  }
442  else
443  {
444  HRSRC hResource = FindResourceA(lppsp->hInstance,
445  (LPCSTR)lppsp->u.pszTemplate,
446  (LPSTR)RT_DIALOG);
447  HGLOBAL hTemplate = LoadResource(lppsp->hInstance,
448  hResource);
449  pTemplate = LockResource(hTemplate);
450  }
451 
452  /*
453  * Extract the size of the page and the caption.
454  */
455  if (!pTemplate)
456  return FALSE;
457 
458  p = (const WORD *)pTemplate;
459 
460  if (((const MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF)
461  {
462  /* DLGTEMPLATEEX (not defined in any std. header file) */
463 
464  p++; /* dlgVer */
465  p++; /* signature */
466  p += 2; /* help ID */
467  p += 2; /* ext style */
468  p += 2; /* style */
469  }
470  else
471  {
472  /* DLGTEMPLATE */
473 
474  p += 2; /* style */
475  p += 2; /* ext style */
476  }
477 
478  p++; /* nb items */
479  p++; /* x */
480  p++; /* y */
481  width = (WORD)*p; p++;
482  height = (WORD)*p; p++;
483 
484  if (lppsp->dwFlags & (PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE))
485  psInfo->ppshheader.dwFlags |= PSH_HEADER;
486 
487  /* Special calculation for interior wizard pages so the largest page is
488  * calculated correctly. We need to add all the padding and space occupied
489  * by the header so the width and height sums up to the whole wizard client
490  * area. */
491  if ((psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) &&
492  (psInfo->ppshheader.dwFlags & PSH_HEADER) &&
493  !(dwFlags & PSP_HIDEHEADER))
494  {
496  width += 2 * WIZARD_PADDING;
497  }
498  if (psInfo->ppshheader.dwFlags & PSH_WIZARD)
499  {
500  height += 2 * WIZARD_PADDING;
501  width += 2 * WIZARD_PADDING;
502  }
503 
504  /* remember the largest width and height */
505  if (resize)
506  {
507  if (width > psInfo->width)
508  psInfo->width = width;
509 
510  if (height > psInfo->height)
511  psInfo->height = height;
512  }
513 
514  /* menu */
515  switch ((WORD)*p)
516  {
517  case 0x0000:
518  p++;
519  break;
520  case 0xffff:
521  p += 2;
522  break;
523  default:
524  p += lstrlenW( p ) + 1;
525  break;
526  }
527 
528  /* class */
529  switch ((WORD)*p)
530  {
531  case 0x0000:
532  p++;
533  break;
534  case 0xffff:
535  p += 2;
536  break;
537  default:
538  p += lstrlenW( p ) + 1;
539  break;
540  }
541 
542  /* Extract the caption */
543  psInfo->proppage[index].pszText = p;
544  TRACE("Tab %d %s\n",index,debugstr_w( p ));
545 
546  if (dwFlags & PSP_USETITLE)
547  {
548  WCHAR szTitle[256];
549  const WCHAR *pTitle;
550  static const WCHAR pszNull[] = { '(','n','u','l','l',')',0 };
551 
552  if (IS_INTRESOURCE( lppsp->pszTitle ))
553  {
555  pTitle = szTitle;
556  else if (*p)
557  pTitle = p;
558  else
559  pTitle = pszNull;
560  }
561  else
562  pTitle = lppsp->pszTitle;
563 
564  psInfo->proppage[index].pszText = heap_strdupW( pTitle );
565  }
566 
567  /*
568  * Build the image list for icons
569  */
570  if ((dwFlags & PSP_USEHICON) || (dwFlags & PSP_USEICONID))
571  {
572  HICON hIcon;
573  int icon_cx = GetSystemMetrics(SM_CXSMICON);
574  int icon_cy = GetSystemMetrics(SM_CYSMICON);
575 
576  if (dwFlags & PSP_USEICONID)
577  hIcon = LoadImageW(lppsp->hInstance, lppsp->u2.pszIcon, IMAGE_ICON,
578  icon_cx, icon_cy, LR_DEFAULTCOLOR);
579  else
580  hIcon = lppsp->u2.hIcon;
581 
582  if ( hIcon )
583  {
584  if (psInfo->hImageList == 0 )
585  psInfo->hImageList = ImageList_Create(icon_cx, icon_cy, ILC_COLOR, 1, 1);
586 
588  }
589 
590  }
591 
592  return TRUE;
593 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define WIZARD_HEADER_HEIGHT
Definition: propsheet.c:156
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define IMAGE_ICON
Definition: winuser.h:212
LPCWSTR pszTemplate
Definition: prsht.h:209
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
LPCDLGTEMPLATE pResource
Definition: prsht.h:210
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
#define SM_CYSMICON
Definition: winuser.h:1003
#define PSP_USEICONID
Definition: prsht.h:25
#define PSP_USECALLBACK
Definition: prsht.h:30
#define PSH_WIZARD
Definition: prsht.h:45
char * LPSTR
Definition: xmlstorage.h:182
#define lstrlenW
Definition: compat.h:415
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
HIMAGELIST hImageList
Definition: propsheet.c:128
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define debugstr_w
Definition: kernel32.h:32
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define ILC_COLOR
Definition: commctrl.h:348
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
LPCWSTR pszText
Definition: propsheet.c:102
GLuint index
Definition: glext.h:6031
const char * LPCSTR
Definition: xmlstorage.h:183
LPCWSTR pszTitle
Definition: prsht.h:216
#define RT_DIALOG
Definition: pedump.c:367
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned short WORD
Definition: ntddk_ex.h:93
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
DWORD dwFlags
Definition: prsht.h:276
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define SM_CXSMICON
Definition: winuser.h:1002
#define index(s, c)
Definition: various.h:29
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HINSTANCE hInstance
Definition: prsht.h:207
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define PSP_USETITLE
Definition: prsht.h:26
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
HICON hIcon
Definition: prsht.h:213
#define WIZARD_PADDING
Definition: propsheet.c:155
HICON hIcon
Definition: msconfig.c:44
#define ARRAY_SIZE(a)
Definition: main.h:24
HPROPSHEETPAGE hpage
Definition: propsheet.c:99
#define PSP_USEHICON
Definition: prsht.h:24
#define PSP_INTERNAL_UNICODE
Definition: propsheet.c:146
PropPageInfo * proppage
Definition: propsheet.c:123
#define PSP_HASHELP
Definition: prsht.h:28
LPCWSTR pszIcon
Definition: prsht.h:214
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
DWORD dwFlags
Definition: prsht.h:206
#define PSP_DLGINDIRECT
Definition: prsht.h:23

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

◆ PROPSHEET_CollectSheetInfoA()

static void PROPSHEET_CollectSheetInfoA ( LPCPROPSHEETHEADERA  lppsh,
PropSheetInfo psInfo 
)
static

Definition at line 317 of file propsheet.c.

319 {
320  DWORD dwSize = min(lppsh->dwSize,sizeof(PROPSHEETHEADERA));
321  DWORD dwFlags = lppsh->dwFlags;
322 
323  psInfo->useCallback = (dwFlags & PSH_USECALLBACK )&& (lppsh->pfnCallback);
324 
325  memcpy(&psInfo->ppshheader,lppsh,dwSize);
326  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",
327  lppsh->dwSize, lppsh->dwFlags, lppsh->hwndParent, lppsh->hInstance,
328  debugstr_a(lppsh->pszCaption), lppsh->nPages, lppsh->pfnCallback);
329 
330  if (lppsh->dwFlags & INTRNL_ANY_WIZARD)
331  psInfo->ppshheader.pszCaption = NULL;
332  else
333  {
334  if (!IS_INTRESOURCE(lppsh->pszCaption))
335  {
336  int len = MultiByteToWideChar(CP_ACP, 0, lppsh->pszCaption, -1, NULL, 0);
337  WCHAR *caption = Alloc( len*sizeof (WCHAR) );
338 
339  MultiByteToWideChar(CP_ACP, 0, lppsh->pszCaption, -1, caption, len);
340  psInfo->ppshheader.pszCaption = caption;
341  }
342  }
343  psInfo->nPages = lppsh->nPages;
344 
346  {
347  TRACE("PSH_USEPSTARTPAGE is on\n");
348  psInfo->active_page = 0;
349  }
350  else
351  psInfo->active_page = lppsh->u2.nStartPage;
352 
354 }
#define INTRNL_ANY_WIZARD
Definition: propsheet.c:152
#define CP_ACP
Definition: compat.h:99
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
LPCSTR pszCaption
Definition: prsht.h:248
#define PSH_USECALLBACK
Definition: prsht.h:48
UINT nStartPage
Definition: prsht.h:251
LPCWSTR pszCaption
Definition: prsht.h:283
HWND hwndParent
Definition: prsht.h:242
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:258
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
DWORD dwSize
Definition: prsht.h:240
#define PSH_USEPSTARTPAGE
Definition: prsht.h:46
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwFlags
Definition: prsht.h:241
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
static void PROPSHEET_CollectSheetInfoCommon(PropSheetInfo *psInfo, DWORD dwFlags)
Definition: propsheet.c:295
#define min(a, b)
Definition: monoChain.cc:55
#define MultiByteToWideChar
Definition: compat.h:100
HINSTANCE hInstance
Definition: prsht.h:243
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by PropertySheetA().

◆ PROPSHEET_CollectSheetInfoCommon()

static void PROPSHEET_CollectSheetInfoCommon ( PropSheetInfo psInfo,
DWORD  dwFlags 
)
static

Definition at line 295 of file propsheet.c.

296 {
298 
299  psInfo->hasHelp = dwFlags & PSH_HASHELP;
300  psInfo->hasApply = !(dwFlags & PSH_NOAPPLYNOW);
302  psInfo->isModeless = dwFlags & PSH_MODELESS;
304  if (psInfo->active_page < 0 || psInfo->active_page >= psInfo->nPages)
305  psInfo->active_page = 0;
306 
307  psInfo->result = 0;
308  psInfo->hImageList = 0;
309  psInfo->activeValid = FALSE;
310 }
#define PSH_WIZARDHASFINISH
Definition: prsht.h:44
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
#define PSH_MODELESS
Definition: prsht.h:50
HIMAGELIST hImageList
Definition: propsheet.c:128
static VOID PROPSHEET_UnImplementedFlags(DWORD dwFlags)
Definition: propsheet.c:204
#define PSH_HASHELP
Definition: prsht.h:49
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43

Referenced by PROPSHEET_CollectSheetInfoA(), and PROPSHEET_CollectSheetInfoW().

◆ PROPSHEET_CollectSheetInfoW()

static void PROPSHEET_CollectSheetInfoW ( LPCPROPSHEETHEADERW  lppsh,
PropSheetInfo psInfo 
)
static

Definition at line 361 of file propsheet.c.

363 {
364  DWORD dwSize = min(lppsh->dwSize,sizeof(PROPSHEETHEADERW));
365  DWORD dwFlags = lppsh->dwFlags;
366 
367  psInfo->useCallback = (dwFlags & PSH_USECALLBACK) && (lppsh->pfnCallback);
368 
369  memcpy(&psInfo->ppshheader,lppsh,dwSize);
370  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",
371  lppsh->dwSize, lppsh->dwFlags, lppsh->hwndParent, lppsh->hInstance, debugstr_w(lppsh->pszCaption), lppsh->nPages, lppsh->pfnCallback);
372 
373  if (lppsh->dwFlags & INTRNL_ANY_WIZARD)
374  psInfo->ppshheader.pszCaption = NULL;
375  else
376  {
377  if (!IS_INTRESOURCE(lppsh->pszCaption))
378  psInfo->ppshheader.pszCaption = heap_strdupW( lppsh->pszCaption );
379  }
380  psInfo->nPages = lppsh->nPages;
381 
383  {
384  TRACE("PSH_USEPSTARTPAGE is on\n");
385  psInfo->active_page = 0;
386  }
387  else
388  psInfo->active_page = lppsh->u2.nStartPage;
389 
391 }
HWND hwndParent
Definition: prsht.h:277
#define INTRNL_ANY_WIZARD
Definition: propsheet.c:152
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
#define PSH_USECALLBACK
Definition: prsht.h:48
LPCWSTR pszCaption
Definition: prsht.h:283
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define debugstr_w
Definition: kernel32.h:32
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:293
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
HINSTANCE hInstance
Definition: prsht.h:278
#define PSH_USEPSTARTPAGE
Definition: prsht.h:46
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwSize
Definition: prsht.h:275
DWORD dwFlags
Definition: prsht.h:276
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static void PROPSHEET_CollectSheetInfoCommon(PropSheetInfo *psInfo, DWORD dwFlags)
Definition: propsheet.c:295
#define min(a, b)
Definition: monoChain.cc:55
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
UINT nStartPage
Definition: prsht.h:286

Referenced by PropertySheetW().

◆ PROPSHEET_CreateDialog()

static INT_PTR PROPSHEET_CreateDialog ( PropSheetInfo psInfo)
static

Definition at line 600 of file propsheet.c.

601 {
602  LRESULT ret;
603  LPCVOID template;
604  LPVOID temp = 0;
605  HRSRC hRes;
606  DWORD resSize;
607  WORD resID = IDD_PROPSHEET;
608 
609  TRACE("(%p)\n", psInfo);
610  if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
611  resID = IDD_WIZARD;
612 
613  if( psInfo->unicode )
614  {
615  if(!(hRes = FindResourceW(COMCTL32_hModule,
616  MAKEINTRESOURCEW(resID),
617  (LPWSTR)RT_DIALOG)))
618  return -1;
619  }
620  else
621  {
622  if(!(hRes = FindResourceA(COMCTL32_hModule,
623  MAKEINTRESOURCEA(resID),
624  (LPSTR)RT_DIALOG)))
625  return -1;
626  }
627 
628  if(!(template = LoadResource(COMCTL32_hModule, hRes)))
629  return -1;
630 
631  /*
632  * Make a copy of the dialog template.
633  */
634  resSize = SizeofResource(COMCTL32_hModule, hRes);
635 
636  temp = Alloc(2 * resSize);
637 
638  if (!temp)
639  return -1;
640 
641  memcpy(temp, template, resSize);
642 
643  if (psInfo->ppshheader.dwFlags & PSH_NOCONTEXTHELP)
644  {
645  if (((MyDLGTEMPLATEEX*)temp)->signature == 0xFFFF)
646  ((MyDLGTEMPLATEEX*)temp)->style &= ~DS_CONTEXTHELP;
647  else
649  }
650  if ((psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) &&
652  {
653  if (((MyDLGTEMPLATEEX*)temp)->signature == 0xFFFF)
654  ((MyDLGTEMPLATEEX*)temp)->style |= DS_CONTEXTHELP;
655  else
657  }
658 
659  if (psInfo->useCallback)
660  (*(psInfo->ppshheader.pfnCallback))(0, PSCB_PRECREATE, (LPARAM)temp);
661 
662  /* NOTE: MSDN states "Returns a positive value if successful, or -1
663  * otherwise for modal property sheets.", but this is wrong. The
664  * actual return value is either TRUE (success), FALSE (cancel) or
665  * -1 (error). */
666  if( psInfo->unicode )
667  {
669  temp, psInfo->ppshheader.hwndParent,
670  PROPSHEET_DialogProc, (LPARAM)psInfo);
671  if ( !ret ) ret = -1;
672  }
673  else
674  {
676  temp, psInfo->ppshheader.hwndParent,
677  PROPSHEET_DialogProc, (LPARAM)psInfo);
678  if ( !ret ) ret = -1;
679  }
680 
681  Free(temp);
682 
683  return ret;
684 }
HWND hwndParent
Definition: prsht.h:277
#define INTRNL_ANY_WIZARD
Definition: propsheet.c:152
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
static INT_PTR(WINAPI *pPropertySheetA)(const PROPSHEETHEADERA *header)
HWND WINAPI CreateDialogIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
char * LPSTR
Definition: xmlstorage.h:182
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
#define IDD_PROPSHEET
Definition: comctl32.h:43
#define PSH_WIZARDCONTEXTHELP
Definition: prsht.h:52
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:293
#define PSCB_PRECREATE
Definition: prsht.h:76
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
LONG_PTR LPARAM
Definition: windef.h:208
#define RT_DIALOG
Definition: pedump.c:367
#define TRACE(s)
Definition: solgame.cpp:4
HINSTANCE hInstance
Definition: prsht.h:278
HWND WINAPI CreateDialogIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwFlags
Definition: prsht.h:276
#define IDD_WIZARD
Definition: comctl32.h:44
int ret
#define DS_CONTEXTHELP
Definition: winuser.h:371
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HMODULE COMCTL32_hModule
Definition: commctrl.c:79
static calc_node_t temp
Definition: rpn_ieee.c:38
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
CONST void * LPCVOID
Definition: windef.h:191
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LONG_PTR LRESULT
Definition: windef.h:209
Arabic default style
Definition: afstyles.h:93
static INT_PTR CALLBACK PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.c:3493

Referenced by PROPSHEET_PropertySheet().

◆ PROPSHEET_CreatePage()

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

Definition at line 1344 of file propsheet.c.

1348 {
1349  const DLGTEMPLATE* pTemplate;
1350  HWND hwndPage;
1351  DWORD resSize;
1352  DLGTEMPLATE* pTemplateCopy = NULL;
1353 
1354  TRACE("index %d\n", index);
1355 
1356  if (ppshpage == NULL)
1357  {
1358  return FALSE;
1359  }
1360 
1361  if (ppshpage->dwFlags & PSP_DLGINDIRECT)
1362  {
1363  pTemplate = ppshpage->u.pResource;
1364  resSize = GetTemplateSize(pTemplate);
1365  }
1366  else if(ppshpage->dwFlags & PSP_INTERNAL_UNICODE)
1367  {
1368  HRSRC hResource;
1369  HANDLE hTemplate;
1370 
1371  hResource = FindResourceW(ppshpage->hInstance,
1372  ppshpage->u.pszTemplate,
1373  (LPWSTR)RT_DIALOG);
1374  if(!hResource)
1375  return FALSE;
1376 
1377  resSize = SizeofResource(ppshpage->hInstance, hResource);
1378 
1379  hTemplate = LoadResource(ppshpage->hInstance, hResource);
1380  if(!hTemplate)
1381  return FALSE;
1382 
1383  pTemplate = LockResource(hTemplate);
1384  /*
1385  * Make a copy of the dialog template to make it writable
1386  */
1387  }
1388  else
1389  {
1390  HRSRC hResource;
1391  HANDLE hTemplate;
1392 
1393  hResource = FindResourceA(ppshpage->hInstance,
1394  (LPCSTR)ppshpage->u.pszTemplate,
1395  (LPSTR)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  pTemplateCopy = Alloc(resSize);
1411  if (!pTemplateCopy)
1412  return FALSE;
1413 
1414  TRACE("copying pTemplate %p into pTemplateCopy %p (%d)\n", pTemplate, pTemplateCopy, resSize);
1415  memcpy(pTemplateCopy, pTemplate, resSize);
1416 
1417  if (((MyDLGTEMPLATEEX*)pTemplateCopy)->signature == 0xFFFF)
1418  {
1419  ((MyDLGTEMPLATEEX*)pTemplateCopy)->style |= WS_CHILD | WS_TABSTOP | DS_CONTROL;
1420  ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~DS_MODALFRAME;
1421  ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_CAPTION;
1422  ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_SYSMENU;
1423  ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_POPUP;
1424  ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_DISABLED;
1425  ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_VISIBLE;
1426  ((MyDLGTEMPLATEEX*)pTemplateCopy)->style &= ~WS_THICKFRAME;
1427 
1428  ((MyDLGTEMPLATEEX*)pTemplateCopy)->exStyle |= WS_EX_CONTROLPARENT;
1429  }
1430  else
1431  {
1432  pTemplateCopy->style |= WS_CHILD | WS_TABSTOP | DS_CONTROL;
1433  pTemplateCopy->style &= ~DS_MODALFRAME;
1434  pTemplateCopy->style &= ~WS_CAPTION;
1435  pTemplateCopy->style &= ~WS_SYSMENU;
1436  pTemplateCopy->style &= ~WS_POPUP;
1437  pTemplateCopy->style &= ~WS_DISABLED;
1438  pTemplateCopy->style &= ~WS_VISIBLE;
1439  pTemplateCopy->style &= ~WS_THICKFRAME;
1440 
1441  pTemplateCopy->dwExtendedStyle |= WS_EX_CONTROLPARENT;
1442  }
1443 
1444  if (psInfo->proppage[index].useCallback)
1445  (*(ppshpage->pfnCallback))(0, PSPCB_CREATE,
1446  (LPPROPSHEETPAGEW)ppshpage);
1447 
1448  if(ppshpage->dwFlags & PSP_INTERNAL_UNICODE)
1449  hwndPage = CreateDialogIndirectParamW(ppshpage->hInstance,
1450  pTemplateCopy,
1451  hwndParent,
1452  ppshpage->pfnDlgProc,
1453  (LPARAM)ppshpage);
1454  else
1455  hwndPage = CreateDialogIndirectParamA(ppshpage->hInstance,
1456  pTemplateCopy,
1457  hwndParent,
1458  ppshpage->pfnDlgProc,
1459  (LPARAM)ppshpage);
1460  /* Free a no more needed copy */
1461  Free(pTemplateCopy);
1462 
1463  if(!hwndPage)
1464  return FALSE;
1465 
1466  psInfo->proppage[index].hwndPage = hwndPage;
1467 
1468  /* Subclass exterior wizard pages */
1469  if((psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD)) &&
1470  (psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
1471  (ppshpage->dwFlags & PSP_HIDEHEADER))
1472  {
1473 #ifdef __REACTOS__
1474  if (psInfo->ppshheader.u4.hbmWatermark)
1475 #endif
1477  (DWORD_PTR)ppshpage);
1478  }
1479  if (!(psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD))
1481 
1482 #ifdef __REACTOS__
1483  PROPSHEET_UnChanged(hwndParent, hwndPage);
1484 #endif
1485  return TRUE;
1486 }
#define WS_DISABLED
Definition: pedump.c:621
#define WS_THICKFRAME
Definition: pedump.c:630
#define TRUE
Definition: types.h:120
#define INTRNL_ANY_WIZARD
Definition: propsheet.c:152
LPCWSTR pszTemplate
Definition: prsht.h:209
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
LPCDLGTEMPLATE pResource
Definition: prsht.h:210
HWND WINAPI CreateDialogIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
#define WS_CHILD
Definition: pedump.c:617
char * LPSTR
Definition: xmlstorage.h:182
static UINT GetTemplateSize(const DLGTEMPLATE *pTemplate)
Definition: propsheet.c:1209
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
#define DS_MODALFRAME
Definition: winuser.h:375
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
DLGPROC pfnDlgProc
Definition: prsht.h:217
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
smooth NULL
Definition: ftsmooth.c:416
struct _PROPSHEETPAGEW * LPPROPSHEETPAGEW
static HWND hwndParent
Definition: cryptui.c:300
#define ETDT_ENABLETAB
Definition: dxdiag.c:30
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
const char * LPCSTR
Definition: xmlstorage.h:183
#define RT_DIALOG
Definition: pedump.c:367
BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIDSubclass, DWORD_PTR dwRef)
Definition: commctrl.c:1261
#define WS_CAPTION
Definition: pedump.c:624
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI EnableThemeDialogTexture(_In_ HWND hwnd, _In_ DWORD dwFlags)
Definition: uxthemesupp.c:55
HWND WINAPI CreateDialogIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwFlags
Definition: prsht.h:276
#define PSPCB_CREATE
Definition: prsht.h:38
#define index(s, c)
Definition: various.h:29
HINSTANCE hInstance
Definition: prsht.h:207
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WS_TABSTOP
Definition: pedump.c:634
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define DS_CONTROL
Definition: winuser.h:372
#define WS_POPUP
Definition: pedump.c:616
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define PSP_INTERNAL_UNICODE
Definition: propsheet.c:146
PropPageInfo * proppage
Definition: propsheet.c:123
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static LRESULT CALLBACK PROPSHEET_WizardSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uID, DWORD_PTR dwRef)
Definition: propsheet.c:1187
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_SYSMENU
Definition: pedump.c:629
DWORD dwFlags
Definition: prsht.h:206
static void PROPSHEET_UnChanged(HWND hwndDlg, HWND hwndCleanPage)
Definition: propsheet.c:1868
#define PSP_DLGINDIRECT
Definition: prsht.h:23

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

◆ PROPSHEET_CreateTabControl()

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

Definition at line 1137 of file propsheet.c.

1139 {
1140  HWND hwndTabCtrl = GetDlgItem(hwndParent, IDC_TABCONTROL);
1141  TCITEMW item;
1142  int i, nTabs;
1143  int iImage = 0;
1144 
1145  TRACE("\n");
1146  item.mask = TCIF_TEXT;
1147  item.cchTextMax = MAX_TABTEXT_LENGTH;
1148 
1149  nTabs = psInfo->nPages;
1150 
1151  /*
1152  * Set the image list for icons.
1153  */
1154  if (psInfo->hImageList)
1155  {
1156  SendMessageW(hwndTabCtrl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList);
1157  }
1158 
1159  SendMessageW(hwndTabCtrl, WM_SETREDRAW, 0, 0);
1160  for (i = 0; i < nTabs; i++)
1161  {
1162  if ( psInfo->proppage[i].hasIcon )
1163  {
1164  item.mask |= TCIF_IMAGE;
1165  item.iImage = iImage++;
1166  }
1167  else
1168  {
1169  item.mask &= ~TCIF_IMAGE;
1170  }
1171 
1172  item.pszText = (LPWSTR) psInfo->proppage[i].pszText;
1173  SendMessageW(hwndTabCtrl, TCM_INSERTITEMW, i, (LPARAM)&item);
1174  }
1175  SendMessageW(hwndTabCtrl, WM_SETREDRAW, 1, 0);
1176 
1177  return TRUE;
1178 }
#define TRUE
Definition: types.h:120
#define MAX_TABTEXT_LENGTH
Definition: propsheet.c:149
#define WM_SETREDRAW
Definition: winuser.h:1598
#define TCIF_TEXT
Definition: commctrl.h:3967
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
HIMAGELIST hImageList
Definition: propsheet.c:128
#define TCM_INSERTITEMW
Definition: commctrl.h:4043
static HWND hwndParent
Definition: cryptui.c:300
LONG_PTR LPARAM
Definition: windef.h:208
LPCWSTR pszText
Definition: propsheet.c:102
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define TCM_SETIMAGELIST
Definition: commctrl.h:3961
#define TCIF_IMAGE
Definition: commctrl.h:3968
static ATOM item
Definition: dde.c:856
#define IDC_TABCONTROL
Definition: comctl32.h:46
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
PropPageInfo * proppage
Definition: propsheet.c:123
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by PROPSHEET_DialogProc().

◆ PROPSHEET_DialogProc()

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

Definition at line 3493 of file propsheet.c.

3494 {
3495  TRACE("hwnd=%p msg=0x%04x wparam=%lx lparam=%lx\n",
3496  hwnd, uMsg, wParam, lParam);
3497 
3498  switch (uMsg)
3499  {
3500  case WM_INITDIALOG:
3501  {
3502  PropSheetInfo* psInfo = (PropSheetInfo*) lParam;
3503  WCHAR* strCaption = Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR));
3504  HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL);
3505  int idx;
3506  LOGFONTW logFont;
3507 
3508  /* Using PropSheetInfoStr to store extra data doesn't match the native
3509  * common control: native uses TCM_[GS]ETITEM
3510  */
3511  SetPropW(hwnd, PropSheetInfoStr, psInfo);
3512 
3513  /*
3514  * psInfo->hwnd is not being used by WINE code - it exists
3515  * for compatibility with "real" Windoze. The same about
3516  * SetWindowLongPtr - WINE is only using the PropSheetInfoStr
3517  * property.
3518  */
3519  psInfo->hwnd = hwnd;
3521 
3522  if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
3523  {
3524  /* set up the Next and Back buttons by default */
3526  }
3527 
3528  /* Set up fonts */
3530  psInfo->hFont = CreateFontIndirectW (&logFont);
3531  logFont.lfWeight = FW_BOLD;
3532  psInfo->hFontBold = CreateFontIndirectW (&logFont);
3533 
3534  /*
3535  * Small icon in the title bar.
3536  */
3537  if ((psInfo->ppshheader.dwFlags & PSH_USEICONID) ||
3538  (psInfo->ppshheader.dwFlags & PSH_USEHICON))
3539  {
3540  HICON hIcon;
3541  int icon_cx = GetSystemMetrics(SM_CXSMICON);
3542  int icon_cy = GetSystemMetrics(SM_CYSMICON);
3543 
3544  if (psInfo->ppshheader.dwFlags & PSH_USEICONID)
3546  psInfo->ppshheader.u.pszIcon,
3547  IMAGE_ICON,
3548  icon_cx, icon_cy,
3549  LR_DEFAULTCOLOR);
3550  else
3551  hIcon = psInfo->ppshheader.u.hIcon;
3552 
3553  SendMessageW(hwnd, WM_SETICON, 0, (LPARAM)hIcon);
3554  }
3555 
3556  if (psInfo->ppshheader.dwFlags & PSH_USEHICON)
3557  SendMessageW(hwnd, WM_SETICON, 0, (LPARAM)psInfo->ppshheader.u.hIcon);
3558 
3559  psInfo->strPropertiesFor = strCaption;
3560 
3562 
3564 
3566 
3567  if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
3568  {
3569  ShowWindow(hwndTabCtrl, SW_HIDE);
3573  }
3574  else
3575  {
3576  if (PROPSHEET_SizeMismatch(hwnd, psInfo))
3577  {
3578  PROPSHEET_AdjustSize(hwnd, psInfo);
3579  PROPSHEET_AdjustButtons(hwnd, psInfo);
3580  }
3582  }
3583 
3584  if (IS_INTRESOURCE(psInfo->ppshheader.pszCaption) &&
3585  psInfo->ppshheader.hInstance)
3586  {
3587  WCHAR szText[256];
3588 
3589  if (LoadStringW(psInfo->ppshheader.hInstance,
3590  (UINT_PTR)psInfo->ppshheader.pszCaption, szText, 255))
3592  }
3593  else
3594  {
3596  psInfo->ppshheader.pszCaption);
3597  }
3598 
3599 
3600  if (psInfo->useCallback)
3601  (*(psInfo->ppshheader.pfnCallback))(hwnd, PSCB_INITIALIZED, 0);
3602 
3603  idx = psInfo->active_page;
3604  psInfo->active_page = -1;
3605 
3606  PROPSHEET_SetCurSel(hwnd, idx, 1, psInfo->proppage[idx].hpage);
3607 
3608  /* doing TCM_SETCURSEL seems to be needed even in case of PSH_WIZARD,
3609  * as some programs call TCM_GETCURSEL to get the current selection
3610  * from which to switch to the next page */
3611  SendMessageW(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
3612 
3614 
3615  /* wizards set their focus during init */
3616  if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
3617  return FALSE;
3618 
3619  return TRUE;
3620  }
3621 
3622  case WM_PRINTCLIENT:
3623  case WM_PAINT:
3625  return TRUE;
3626 
3627  case WM_DESTROY:
3629  return TRUE;
3630 
3631  case WM_CLOSE:
3632  PROPSHEET_Cancel(hwnd, 1);
3633  return FALSE; /* let DefDlgProc post us WM_COMMAND/IDCANCEL */
3634 
3635  case WM_COMMAND:
3637  {
3639 
3640  if (!psInfo)
3641  return FALSE;
3642 
3643  /* No default handler, forward notification to active page */
3644  if (psInfo->activeValid && psInfo->active_page != -1)
3645  {
3646  HWND hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
3647  SendMessageW(hwndPage, WM_COMMAND, wParam, lParam);
3648  }
3649  }
3650  return TRUE;
3651 
3652  case WM_NOTIFY:
3653  {
3654  NMHDR* pnmh = (LPNMHDR) lParam;
3655 
3656  if (pnmh->code == TCN_SELCHANGE)
3657  {
3658  int index = SendMessageW(pnmh->hwndFrom, TCM_GETCURSEL, 0, 0);
3659  PROPSHEET_SetCurSel(hwnd, index, 1, 0);
3660  }
3661 
3662  if(pnmh->code == TCN_SELCHANGING)
3663  {
3666  return TRUE;
3667  }
3668 
3669  return FALSE;
3670  }
3671 
3672  case WM_SYSCOLORCHANGE:
3674  return FALSE;
3675 
3677  {
3679  HWND hwndPage = 0;
3680 
3681  if (!psInfo)
3682  return FALSE;
3683 
3684  if (psInfo->activeValid && psInfo->active_page != -1)
3685  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
3686 
3688 
3689  return TRUE;
3690  }
3691 
3692  case PSM_CHANGED:
3694  return TRUE;
3695 
3696  case PSM_UNCHANGED:
3698  return TRUE;
3699 
3700  case PSM_GETTABCONTROL:
3701  {
3702  HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL);
3703 
3705 
3706  return TRUE;
3707  }
3708 
3709  case PSM_SETCURSEL:
3710  {
3711  BOOL msgResult;
3712 
3713  msgResult = PROPSHEET_CanSetCurSel(hwnd);
3714  if(msgResult != FALSE)
3715  {
3716  msgResult = PROPSHEET_SetCurSel(hwnd,
3717  (int)wParam,
3718  1,
3720  }
3721 
3722  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3723 
3724  return TRUE;
3725  }
3726 
3727  case PSM_CANCELTOCLOSE:
3728  {
3730  HWND hwndOK = GetDlgItem(hwnd, IDOK);
3731  HWND hwndCancel = GetDlgItem(hwnd, IDCANCEL);
3732 
3733  EnableWindow(hwndCancel, FALSE);
3735  SetWindowTextW(hwndOK, buf);
3736 
3737  return FALSE;
3738  }
3739 
3740  case PSM_RESTARTWINDOWS:
3741  {
3743 
3744  if (!psInfo)
3745  return FALSE;
3746 
3747  /* reboot system takes precedence over restart windows */
3748  if (psInfo->result != ID_PSREBOOTSYSTEM)
3749  psInfo->result = ID_PSRESTARTWINDOWS;
3750 
3751  return TRUE;
3752  }
3753 
3754  case PSM_REBOOTSYSTEM:
3755  {
3757 
3758  if (!psInfo)
3759  return FALSE;
3760 
3761  psInfo->result = ID_PSREBOOTSYSTEM;
3762 
3763  return TRUE;
3764  }
3765 
3766  case PSM_SETTITLEA:
3768  return TRUE;
3769 
3770  case PSM_SETTITLEW:
3772  return TRUE;
3773 
3774  case PSM_APPLY:
3775  {
3776  BOOL msgResult = PROPSHEET_Apply(hwnd, 0);
3777 
3778  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3779 
3780  return TRUE;
3781  }
3782 
3783  case PSM_QUERYSIBLINGS:
3784  {
3786 
3787  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3788 
3789  return TRUE;
3790  }
3791 
3792  case PSM_ADDPAGE:
3793  {
3794  /*
3795  * Note: MSVC++ 6.0 documentation says that PSM_ADDPAGE does not have
3796  * a return value. This is not true. PSM_ADDPAGE returns TRUE
3797  * on success or FALSE otherwise, as specified on MSDN Online.
3798  * Also see the MFC code for
3799  * CPropertySheet::AddPage(CPropertyPage* pPage).
3800  */
3801 
3803 
3804  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3805 
3806  return TRUE;
3807  }
3808 
3809  case PSM_REMOVEPAGE:
3811  return TRUE;
3812 
3813  case PSM_ISDIALOGMESSAGE:
3814  {
3816  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3817  return TRUE;
3818  }
3819 
3820  case PSM_PRESSBUTTON:
3822  return TRUE;
3823 
3824  case PSM_SETFINISHTEXTA:
3826  return TRUE;
3827 
3828  case PSM_SETWIZBUTTONS:
3830  return TRUE;
3831 
3832  case PSM_SETCURSELID:
3834  return TRUE;
3835 
3836  case PSM_SETFINISHTEXTW:
3838  return FALSE;
3839 
3840  case PSM_INSERTPAGE:
3841  {
3843  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3844  return TRUE;
3845  }
3846 
3847  case PSM_SETHEADERTITLEW:
3849  return TRUE;
3850 
3851  case PSM_SETHEADERTITLEA:
3853  return TRUE;
3854 
3855  case PSM_SETHEADERSUBTITLEW:
3857  return TRUE;
3858 
3859  case PSM_SETHEADERSUBTITLEA:
3861  return TRUE;
3862 
3863  case PSM_HWNDTOINDEX:
3864  {
3865  LRESULT msgResult = PROPSHEET_HwndToIndex(hwnd, (HWND)wParam);
3866  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3867  return TRUE;
3868  }
3869 
3870  case PSM_INDEXTOHWND:
3871  {
3872  LRESULT msgResult = PROPSHEET_IndexToHwnd(hwnd, (int)wParam);
3873  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3874  return TRUE;
3875  }
3876 
3877  case PSM_PAGETOINDEX:
3878  {
3880  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3881  return TRUE;
3882  }
3883 
3884  case PSM_INDEXTOPAGE:
3885  {
3886  LRESULT msgResult = PROPSHEET_IndexToPage(hwnd, (int)wParam);
3887  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3888  return TRUE;
3889  }
3890 
3891  case PSM_IDTOINDEX:
3892  {
3893  LRESULT msgResult = PROPSHEET_IdToIndex(hwnd, (int)lParam);
3894  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3895  return TRUE;
3896  }
3897 
3898  case PSM_INDEXTOID:
3899  {
3900  LRESULT msgResult = PROPSHEET_IndexToId(hwnd, (int)wParam);
3901  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3902  return TRUE;
3903  }
3904 
3905  case PSM_GETRESULT:
3906  {
3907  LRESULT msgResult = PROPSHEET_GetResult(hwnd);
3908  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3909  return TRUE;
3910  }
3911 
3912  case PSM_RECALCPAGESIZES:
3913  {
3914  LRESULT msgResult = PROPSHEET_RecalcPageSizes(hwnd);
3915  SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, msgResult);
3916  return TRUE;
3917  }
3918 
3919  default:
3920  return FALSE;
3921  }
3922 }
static LRESULT PROPSHEET_HwndToIndex(HWND hwndDlg, HWND hPageDlg)
Definition: propsheet.c:2604
static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
Definition: propsheet.c:3292
#define TCM_GETCURSEL
Definition: commctrl.h:4058
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define PSH_USEHICON
Definition: prsht.h:41
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define INTRNL_ANY_WIZARD
Definition: propsheet.c:152
#define IDOK
Definition: winuser.h:824
#define IMAGE_ICON
Definition: winuser.h:212
static void PROPSHEET_SetFinishTextA(HWND hwndDlg, LPCSTR lpszText)
Definition: propsheet.c:2169
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define PSM_GETTABCONTROL
Definition: prsht.h:80
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define ID_PSREBOOTSYSTEM
Definition: prsht.h:133
#define SW_HIDE
Definition: winuser.h:762
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
static HDC
Definition: imagelist.c:92
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSM_REMOVEPAGE
Definition: prsht.h:166
static BOOL PROPSHEET_AddPage(HWND hwndDlg, HPROPSHEETPAGE hpage)
Definition: propsheet.c:2342
#define SM_CYSMICON
Definition: winuser.h:1003
#define TCM_SETCURSEL
Definition: commctrl.h:4061
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
static BOOL PROPSHEET_RecalcPageSizes(HWND hwndDlg)
Definition: propsheet.c:2709
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:143
static void PROPSHEET_SetHeaderTitleA(HWND hwndDlg, UINT page_index, const char *title)
Definition: propsheet.c:2554
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define PSM_SETFINISHTEXTW
Definition: prsht.h:105
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
#define MAX_BUTTONTEXT_LENGTH
Definition: propsheet.c:150
#define WM_PRINTCLIENT
Definition: richedit.h:70
static BOOL PROPSHEET_IsDialogMessage(HWND hwnd, LPMSG lpMsg)
Definition: propsheet.c:3177
#define ID_PSRESTARTWINDOWS
Definition: prsht.h:132
#define PSM_ISDIALOGMESSAGE
Definition: prsht.h:96
static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent, const PropSheetInfo *psInfo)
Definition: propsheet.c:928
#define PSM_SETCURSEL
Definition: prsht.h:167
UINT code
Definition: winuser.h:3134
static void PROPSHEET_Changed(HWND hwndDlg, HWND hwndDirtyPage)
Definition: propsheet.c:1838
static void PROPSHEET_SetHeaderTitleW(HWND hwndDlg, UINT page_index, const WCHAR *title)
Definition: propsheet.c:2532
LPWSTR strPropertiesFor
Definition: propsheet.c:113
static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg)
Definition: propsheet.c:1943
#define PSH_USEICONID
Definition: prsht.h:42
static const WCHAR szText[]
Definition: dialog.c:139
LPCWSTR pszCaption
Definition: prsht.h:283
static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam)
Definition: propsheet.c:1773
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define PSM_SETWIZBUTTONS
Definition: prsht.h:157
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:293
unsigned int idx
Definition: utils.c:41
static BOOL PROPSHEET_CreateTabControl(HWND hwndParent, const PropSheetInfo *psInfo)
Definition: propsheet.c:1137
static void PROPSHEET_SetCurSelId(HWND hwndDlg, int id)
Definition: propsheet.c:2106
smooth NULL
Definition: ftsmooth.c:416
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
LONG_PTR LPARAM
Definition: windef.h:208
#define PSM_SETCURSELID
Definition: prsht.h:104
static LRESULT PROPSHEET_IdToIndex(HWND hwndDlg, int iPageId)
Definition: propsheet.c:2663
GLuint index
Definition: glext.h:6031
static BOOL PROPSHEET_SizeMismatch(HWND hwndDlg, const PropSheetInfo *psInfo)
Definition: propsheet.c:692
const char * LPCSTR
Definition: xmlstorage.h:183
#define WM_DESTROY
Definition: winuser.h:1591
#define IDS_CLOSE
Definition: comctl32.h:54
#define PSM_REBOOTSYSTEM
Definition: prsht.h:162
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define TCN_SELCHANGE
Definition: commctrl.h:4128
#define PSM_APPLY
Definition: prsht.h:158
static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
Definition: propsheet.c:2458
static void PROPSHEET_SetFinishTextW(HWND hwndDlg, LPCWSTR lpszText)
Definition: propsheet.c:2198
static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo)
Definition: propsheet.c:1493
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, const PropSheetInfo *psInfo)
Definition: propsheet.c:839
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
#define PSM_CANCELTOCLOSE
Definition: prsht.h:161
HINSTANCE hInstance
Definition: prsht.h:278
#define WM_CLOSE
Definition: winuser.h:1603
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
LPCWSTR pszIcon
Definition: prsht.h:281
int WINAPI GetSystemMetrics(_In_ int)
#define PSM_GETRESULT
Definition: window.cpp:1319
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, const PropSheetInfo *psInfo)
Definition: propsheet.c:805
#define PSM_GETCURRENTPAGEHWND
Definition: prsht.h:81
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define PSM_RESTARTWINDOWS
Definition: prsht.h:163
DWORD dwFlags
Definition: prsht.h:276
static BOOL PROPSHEET_SetCurSel(HWND hwndDlg, int index, int skipdir, HPROPSHEETPAGE hpage)
Definition: propsheet.c:1982
#define WM_PAINT
Definition: winuser.h:1602
#define SM_CXSMICON
Definition: winuser.h:1002
static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage)
Definition: propsheet.c:2248
static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
Definition: propsheet.c:2621
static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo *psInfo)
Definition: propsheet.c:723
#define DWLP_USER
Definition: winuser.h:866
#define PSM_ADDPAGE
Definition: prsht.h:165
#define PSM_UNCHANGED
Definition: prsht.h:159
#define WM_COMMAND
Definition: winuser.h:1722
HWND hwndFrom
Definition: winuser.h:3132
uint32_t DWORD_PTR
Definition: typedefs.h:63
static void PROPSHEET_SetHeaderSubTitleA(HWND hwndDlg, UINT page_index, const char *subtitle)
Definition: propsheet.c:2590
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define MAX_CAPTION_LENGTH
Definition: propsheet.c:148
#define FW_BOLD
Definition: wingdi.h:377
#define PSCB_INITIALIZED
Definition: prsht.h:75
HMODULE COMCTL32_hModule
Definition: commctrl.c:79
#define IDC_TABCONTROL
Definition: comctl32.h:46
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1408
#define PSM_SETTITLEW
Definition: prsht.h:169
static LRESULT PROPSHEET_GetResult(HWND hwndDlg)
Definition: propsheet.c:2700
HICON hIcon
Definition: msconfig.c:44
#define ARRAY_SIZE(a)
Definition: main.h:24
static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam)
Definition: propsheet.c:1707
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HPROPSHEETPAGE hpage
Definition: propsheet.c:99
static LRESULT PROPSHEET_IndexToId(HWND hwndDlg, int iPageIndex)
Definition: propsheet.c:2681
static LRESULT PROPSHEET_IndexToPage(HWND hwndDlg, int iPageIndex)
Definition: propsheet.c:2649
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define PSM_CHANGED
Definition: prsht.h:164
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1362
static void PROPSHEET_SetTitleA(HWND hwndDlg, DWORD dwStyle, LPCSTR lpszText)
Definition: propsheet.c:2122
static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
Definition: propsheet.c:2139
#define IDC_NEXT_BUTTON
Definition: comctl32.h:49
static BOOL PROPSHEET_RemovePage(HWND hwndDlg, int index, HPROPSHEETPAGE hpage)
Definition: propsheet.c:2352
#define PSM_QUERYSIBLINGS
Definition: prsht.h:160
static void PROPSHEET_CleanUp(HWND hwndDlg)
Definition: propsheet.c:2738
static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID)
Definition: propsheet.c:3230
static LRESULT PROPSHEET_QuerySiblings(HWND hwndDlg, WPARAM wParam, LPARAM lParam)
Definition: propsheet.c:2227
PropPageInfo * proppage
Definition: propsheet.c:123
static void PROPSHEET_SetHeaderSubTitleW(HWND hwndDlg, UINT page_index, const WCHAR *subtitle)
Definition: propsheet.c:2568
static void PROPSHEET_PressButton(HWND hwndDlg, int buttonID)
Definition: propsheet.c:1898
static LRESULT PROPSHEET_PageToIndex(HWND hwndDlg, HPROPSHEETPAGE hPage)
Definition: propsheet.c:2637
#define SetWindowLongPtrW
Definition: winuser.h:5321
LONG lfWeight
Definition: dimm.idl:63
#define PSM_PRESSBUTTON
Definition: prsht.h:100
#define PSM_SETFINISHTEXTA
Definition: prsht.h:106
#define IDCANCEL
Definition: winuser.h:825
LONG_PTR LRESULT
Definition: windef.h:209
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define TCN_SELCHANGING
Definition: commctrl.h:4129
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
Definition: commctrl.c:1586
#define WM_NOTIFY
Definition: richedit.h:61
#define PSM_SETTITLEA
Definition: prsht.h:168
static void PROPSHEET_UnChanged(HWND hwndDlg, HWND hwndCleanPage)
Definition: propsheet.c:1868

Referenced by PROPSHEET_CreateDialog().

◆ PROPSHEET_DoCommand()

static BOOL PROPSHEET_DoCommand ( HWND  hwnd,
WORD  wID 
)
static

Definition at line 3230 of file propsheet.c.

3231 {
3232 
3233  switch (wID) {
3234 
3235  case IDOK:
3236  case IDC_APPLY_BUTTON:
3237  {
3238  HWND hwndApplyBtn = GetDlgItem(hwnd, IDC_APPLY_BUTTON);
3239 
3240  if (PROPSHEET_Apply(hwnd, wID == IDOK ? 1: 0) == FALSE)
3241  break;
3242 
3243  if (wID == IDOK)
3244  {
3246 
3247  /* don't overwrite ID_PSRESTARTWINDOWS or ID_PSREBOOTSYSTEM */
3248  if (psInfo->result == 0)
3249  psInfo->result = IDOK;
3250 
3251  if (psInfo->isModeless)
3252  psInfo->activeValid = FALSE;
3253  else
3254  psInfo->ended = TRUE;
3255  }
3256  else
3257  EnableWindow(hwndApplyBtn, FALSE);
3258 
3259  break;
3260  }
3261 
3262  case IDC_BACK_BUTTON:
3264  break;
3265 
3266  case IDC_NEXT_BUTTON:
3268  break;
3269 
3270  case IDC_FINISH_BUTTON:
3272  break;
3273 
3274  case IDCANCEL:
3275  PROPSHEET_Cancel(hwnd, 0);
3276  break;
3277 
3278  case IDHELP:
3280  break;
3281 
3282  default:
3283  return FALSE;
3284  }
3285 
3286  return TRUE;
3287 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
static void PROPSHEET_Help(HWND hwndDlg)
Definition: propsheet.c:1816
#define IDC_APPLY_BUTTON
Definition: propsheet.c:13
#define IDC_FINISH_BUTTON
Definition: comctl32.h:50
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:143
#define IDHELP
Definition: resource_2.h:8
static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam)
Definition: propsheet.c:1773
static BOOL PROPSHEET_Next(HWND hwndDlg)
Definition: propsheet.c:1626
static BOOL PROPSHEET_Back(HWND hwndDlg)
Definition: propsheet.c:1584
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_BACK_BUTTON
Definition: comctl32.h:48
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam)
Definition: propsheet.c:1707
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define IDC_NEXT_BUTTON
Definition: comctl32.h:49
static BOOL PROPSHEET_Finish(HWND hwndDlg)
Definition: propsheet.c:1669
#define IDCANCEL
Definition: winuser.h:825

Referenced by PROPSHEET_DialogProc(), and PROPSHEET_PressButton().

◆ PROPSHEET_FindPageByResId()

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

Definition at line 274 of file propsheet.c.

275 {
276  INT i;
277 
278  for (i = 0; i < psInfo->nPages; i++)
279  {
281 
282  /* Fixme: if resource ID is a string shall we use strcmp ??? */
283  if (lppsp->u.pszTemplate == (LPVOID)resId)
284  break;
285  }
286 
287  return i;
288 }
LPCSTR pszTemplate
Definition: prsht.h:181
int32_t INT
Definition: typedefs.h:56
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
const PROPSHEETPAGEA * LPCPROPSHEETPAGEA
Definition: prsht.h:199
HPROPSHEETPAGE hpage
Definition: propsheet.c:99
PropPageInfo * proppage
Definition: propsheet.c:123

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

◆ PROPSHEET_Finish()

static BOOL PROPSHEET_Finish ( HWND  hwndDlg)
static

Definition at line 1669 of file propsheet.c.

1670 {
1671  PSHNOTIFY psn;
1672  HWND hwndPage;
1673  LRESULT msgResult = 0;
1674  PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
1675 
1676  TRACE("active_page %d\n", psInfo->active_page);
1677  if (psInfo->active_page < 0)
1678  return FALSE;
1679 
1680  psn.hdr.code = PSN_WIZFINISH;
1681  psn.hdr.hwndFrom = hwndDlg;
1682  psn.hdr.idFrom = 0;
1683  psn.lParam = 0;
1684 
1685  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
1686 
1687  msgResult = SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
1688 
1689  TRACE("msg result %ld\n", msgResult);
1690 
1691  if (msgResult != 0)
1692  return FALSE;
1693 
1694  if (psInfo->result == 0)
1695  psInfo->result = IDOK;
1696  if (psInfo->isModeless)
1697  psInfo->activeValid = FALSE;
1698  else
1699  psInfo->ended = TRUE;
1700 
1701  return TRUE;
1702 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
static const WCHAR PropSheetInfoStr[]
Definition: propsheet.c:143
UINT code
Definition: winuser.h:3134
NMHDR hdr
Definition: prsht.h:312
#define PSN_WIZFINISH
Definition: prsht.h:122
UINT_PTR idFrom
Definition: winuser.h:3133
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
HWND hwndFrom
Definition: winuser.h:3132
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
PropPageInfo * proppage
Definition: propsheet.c:123
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: prsht.h:313
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by PROPSHEET_DoCommand(), and PROPSHEET_PressButton().

◆ PROPSHEET_GetPaddingInfo()

static PADDING_INFO PROPSHEET_GetPaddingInfo ( HWND  hwndDlg)
static

Definition at line 1055 of file propsheet.c.

1056 {
1057  HWND hwndTab = GetDlgItem(hwndDlg, IDC_TABCONTROL);
1058  RECT rcTab;
1060 
1061  GetWindowRect(hwndTab, &rcTab);
1062  MapWindowPoints( 0, hwndDlg, (POINT *)&rcTab, 2 );
1063 
1064  padding.x = rcTab.left;
1065  padding.y = rcTab.top;
1066 
1067  return padding;
1068 }
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
unsigned int padding
Definition: isohybrid.c:50
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_TABCONTROL
Definition: comctl32.h:46
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by PROPSHEET_AdjustButtons(), and PROPSHEET_AdjustSize().

◆ PROPSHEET_GetPaddingInfoWizard()

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

Definition at line 1082 of file propsheet.c.

1084 {
1086  RECT rc;
1087  HWND hwndControl;
1088  INT idButton;
1089  POINT ptButton, ptLine;
1090 
1091  TRACE("\n");
1092  if (psInfo->hasHelp)
1093  {
1094  idButton = IDHELP;
1095  }
1096  else
1097  {
1098  if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
1099  {
1100  idButton = IDC_NEXT_BUTTON;
1101  }
1102  else
1103  {
1104  /* hopefully this is ok */
1105  idButton = IDCANCEL;
1106  }
1107  }
1108 
1109  hwndControl = GetDlgItem(hwndDlg, idButton);
1110  GetWindowRect(hwndControl, &rc);
1111  MapWindowPoints( 0, hwndDlg, (POINT *)&rc, 2 );
1112  ptButton.x = rc.left;
1113  ptButton.y = rc.top;
1114 
1115  /* Line */
1116  hwndControl = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE);
1117  GetWindowRect(hwndControl, &rc);
1118  MapWindowPoints( 0, hwndDlg, (POINT *)&rc, 2 );
1119  ptLine.x = rc.left;
1120  ptLine.y = rc.bottom;
1121 
1122  padding.y = ptButton.y - ptLine.y;
1123 
1124  if (padding.y < 0)
1125  ERR("padding negative ! Please report this !\n");
1126 
1127  /* this is most probably not correct, but the best we have now */
1128  padding.x = padding.y;
1129  return padding;
1130 }
#define INTRNL_ANY_WIZARD
Definition: propsheet.c:152
long y
Definition: polytest.cpp:48
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
long x
Definition: polytest.cpp:48
#define IDC_SUNKEN_LINE
Definition: comctl32.h:51
PROPSHEETHEADERW ppshheader
Definition: propsheet.c:111
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
int32_t INT
Definition: typedefs.h:56
#define IDHELP
Definition: resource_2.h:8
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int padding
Definition: isohybrid.c:50
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
DWORD dwFlags
Definition: prsht.h:276
#define ERR(fmt,...)
Definition: debug.h:109
BOOL hasHelp
Definition: