Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Oct 29, 2018
1 parent 9e40a60 commit 7b3189c
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 132 deletions.
4 changes: 2 additions & 2 deletions metapath/src/Helpers.c
Expand Up @@ -1509,7 +1509,7 @@ static inline BYTE *DialogTemplate_GetFontSizeField(const DLGTEMPLATE *pTemplate
return (BYTE *)pw;
}

DLGTEMPLATE *LoadThemedDialogTemplate(LPCTSTR lpDialogTemplateID, HINSTANCE hInstance) {
DLGTEMPLATE *LoadThemedDialogTemplate(LPCWSTR lpDialogTemplateID, HINSTANCE hInstance) {
HRSRC hRsrc = FindResource(hInstance, lpDialogTemplateID, RT_DIALOG);
if (hRsrc == NULL) {
return NULL;
Expand Down Expand Up @@ -1567,7 +1567,7 @@ DLGTEMPLATE *LoadThemedDialogTemplate(LPCTSTR lpDialogTemplateID, HINSTANCE hIns
return pTemplate;
}

INT_PTR ThemedDialogBoxParam(HINSTANCE hInstance, LPCTSTR lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) {
INT_PTR ThemedDialogBoxParam(HINSTANCE hInstance, LPCWSTR lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) {
DLGTEMPLATE *pDlgTemplate = LoadThemedDialogTemplate(lpTemplate, hInstance);
const INT_PTR ret = DialogBoxIndirectParam(hInstance, pDlgTemplate, hWndParent, lpDialogFunc, dwInitParam);
if (pDlgTemplate) {
Expand Down
8 changes: 2 additions & 6 deletions metapath/src/Helpers.h
Expand Up @@ -401,14 +401,10 @@ typedef struct {
#endif

BOOL GetThemedDialogFont(LPWSTR lpFaceName, WORD *wSize);
DLGTEMPLATE *LoadThemedDialogTemplate(LPCTSTR lpDialogTemplateID, HINSTANCE hInstance);
DLGTEMPLATE *LoadThemedDialogTemplate(LPCWSTR lpDialogTemplateID, HINSTANCE hInstance);
#define ThemedDialogBox(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
ThemedDialogBoxParam(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0)
INT_PTR ThemedDialogBoxParam(HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM dwInitParam);
INT_PTR ThemedDialogBoxParam(HINSTANCE hInstance, LPCWSTR lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);

//==== MinimizeToTray Functions - see comments in Helpers.c ===================
BOOL GetDoAnimateMinimize(VOID);
Expand Down
12 changes: 4 additions & 8 deletions metapath/src/metapath.c
Expand Up @@ -1743,8 +1743,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) {
break;

case IDM_VIEW_FINDTARGET:
ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_FINDTARGET),
hwnd, FindTargetDlgProc, 0);
ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_FINDTARGET), hwnd, FindTargetDlgProc, 0);
break;

case IDM_VIEW_OPTIONS: {
Expand Down Expand Up @@ -1877,8 +1876,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) {
break;

case ACC_SELECTTARGET:
ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_FINDTARGET),
hwnd, FindTargetDlgProc, 0);
ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_FINDTARGET), hwnd, FindTargetDlgProc, 0);
break;

case ACC_FIRETARGET:
Expand Down Expand Up @@ -3415,10 +3413,8 @@ void LaunchTarget(LPCWSTR lpFileName, BOOL bOpenNew) {
if (!bLoadLaunchSetingsLoaded) {
LoadLaunchSetings();
}
if (iUseTargetApplication == 4 ||
(iUseTargetApplication && StrIsEmpty(szTargetApplication))) {
ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_FINDTARGET),
hwndMain, FindTargetDlgProc, 0);
if (iUseTargetApplication == 4 || (iUseTargetApplication && StrIsEmpty(szTargetApplication))) {
ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_FINDTARGET), hwndMain, FindTargetDlgProc, 0);
return;
}

Expand Down
73 changes: 22 additions & 51 deletions src/Dialogs.c
Expand Up @@ -69,7 +69,7 @@ int MsgBox(int iType, UINT uIdMsg, ...) {
NULL,
dwLastIOError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&lpMsgBuf,
(LPWSTR)&lpMsgBuf,
0,
NULL);
StrTrim(lpMsgBuf, L" \a\b\f\n\r\t\v");
Expand Down Expand Up @@ -470,8 +470,7 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM l
// RunDlg()
//
void RunDlg(HWND hwnd, LPCWSTR lpstrDefault) {
ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_RUN),
hwnd, RunDlgProc, (LPARAM)lpstrDefault);
ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_RUN), hwnd, RunDlgProc, (LPARAM)lpstrDefault);
}

//=============================================================================
Expand Down Expand Up @@ -614,8 +613,7 @@ BOOL OpenWithDlg(HWND hwnd, LPCWSTR lpstrFile) {
DLITEM dliOpenWith;
dliOpenWith.mask = DLI_FILENAME;

if (IDOK == ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_OPENWITH),
hwnd, OpenWithDlgProc, (LPARAM)&dliOpenWith)) {
if (IDOK == ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_OPENWITH), hwnd, OpenWithDlgProc, (LPARAM)&dliOpenWith)) {
WCHAR szParam[MAX_PATH];
WCHAR wchDirectory[MAX_PATH] = L"";

Expand Down Expand Up @@ -789,8 +787,7 @@ BOOL FavoritesDlg(HWND hwnd, LPWSTR lpstrFile) {
DLITEM dliFavorite;
dliFavorite.mask = DLI_FILENAME;

if (IDOK == ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_FAVORITES),
hwnd, FavoritesDlgProc, (LPARAM)&dliFavorite)) {
if (IDOK == ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_FAVORITES), hwnd, FavoritesDlgProc, (LPARAM)&dliFavorite)) {
lstrcpyn(lpstrFile, dliFavorite.szFileName, MAX_PATH);
return TRUE;
}
Expand Down Expand Up @@ -849,8 +846,7 @@ BOOL AddToFavDlg(HWND hwnd, LPCWSTR lpszName, LPCWSTR lpszTarget) {
WCHAR pszName[MAX_PATH];
lstrcpy(pszName, lpszName);

const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_ADDTOFAV),
hwnd, AddToFavDlgProc, (LPARAM)pszName);
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_ADDTOFAV), hwnd, AddToFavDlgProc, (LPARAM)pszName);

if (iResult == IDOK) {
if (PathCreateFavLnk(pszName, lpszTarget, tchFavoritesDir)) {
Expand Down Expand Up @@ -1237,12 +1233,8 @@ static INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPAR
//
//
BOOL FileMRUDlg(HWND hwnd, LPWSTR lpstrFile) {
if (IDOK == ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_FILEMRU),
hwnd, FileMRUDlgProc, (LPARAM)lpstrFile)) {
return TRUE;
}

return FALSE;
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_FILEMRU), hwnd, FileMRUDlgProc, (LPARAM)lpstrFile);
return iResult == IDOK;
}

//=============================================================================
Expand Down Expand Up @@ -1297,9 +1289,7 @@ static INT_PTR CALLBACK ChangeNotifyDlgProc(HWND hwnd, UINT umsg, WPARAM wParam,
// ChangeNotifyDlg()
//
BOOL ChangeNotifyDlg(HWND hwnd) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CHANGENOTIFY),
hwnd, ChangeNotifyDlgProc, 0);

const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CHANGENOTIFY), hwnd, ChangeNotifyDlgProc, 0);
return iResult == IDOK;
}

Expand Down Expand Up @@ -1354,10 +1344,8 @@ static INT_PTR CALLBACK ColumnWrapDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, L
//
// ColumnWrapDlg()
//
BOOL ColumnWrapDlg(HWND hwnd, UINT uidDlg, int *iNumber) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(uidDlg),
hwnd, ColumnWrapDlgProc, (LPARAM)iNumber);

BOOL ColumnWrapDlg(HWND hwnd, int *iNumber) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_COLUMNWRAP), hwnd, ColumnWrapDlgProc, (LPARAM)iNumber);
return iResult == IDOK;
}

Expand Down Expand Up @@ -1449,10 +1437,8 @@ static INT_PTR CALLBACK WordWrapSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wPa
//
// WordWrapSettingsDlg()
//
BOOL WordWrapSettingsDlg(HWND hwnd, UINT uidDlg, int *iNumber) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(uidDlg),
hwnd, WordWrapSettingsDlgProc, (LPARAM)iNumber);

BOOL WordWrapSettingsDlg(HWND hwnd, int *iNumber) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_WORDWRAP), hwnd, WordWrapSettingsDlgProc, (LPARAM)iNumber);
return iResult == IDOK;
}

Expand Down Expand Up @@ -1518,10 +1504,8 @@ static INT_PTR CALLBACK LongLineSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wPa
//
// LongLineSettingsDlg()
//
BOOL LongLineSettingsDlg(HWND hwnd, UINT uidDlg, int *iNumber) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(uidDlg),
hwnd, LongLineSettingsDlgProc, (LPARAM)iNumber);

BOOL LongLineSettingsDlg(HWND hwnd, int *iNumber) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_LONGLINES), hwnd, LongLineSettingsDlgProc, (LPARAM)iNumber);
return iResult == IDOK;
}

Expand Down Expand Up @@ -1606,10 +1590,8 @@ static INT_PTR CALLBACK TabSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wParam,
//
// TabSettingsDlg()
//
BOOL TabSettingsDlg(HWND hwnd, UINT uidDlg, int *iNumber) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(uidDlg),
hwnd, TabSettingsDlgProc, (LPARAM)iNumber);

BOOL TabSettingsDlg(HWND hwnd) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_TABSETTINGS), hwnd, TabSettingsDlgProc, 0);
return iResult == IDOK;
}

Expand Down Expand Up @@ -1696,8 +1678,7 @@ BOOL SelectDefEncodingDlg(HWND hwnd, int *pidREncoding) {
dd.bRecodeOnly = FALSE;
dd.idEncoding = *pidREncoding;

const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_DEFENCODING),
hwnd, SelectDefEncodingDlgProc, (LPARAM)&dd);
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_DEFENCODING), hwnd, SelectDefEncodingDlgProc, (LPARAM)&dd);

if (iResult == IDOK) {
*pidREncoding = dd.idEncoding;
Expand Down Expand Up @@ -1821,8 +1802,7 @@ BOOL SelectEncodingDlg(HWND hwnd, int *pidREncoding) {
dd.cxDlg = cxEncodingDlg;
dd.cyDlg = cyEncodingDlg;

const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_ENCODING),
hwnd, SelectEncodingDlgProc, (LPARAM)&dd);
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_ENCODING), hwnd, SelectEncodingDlgProc, (LPARAM)&dd);

cxEncodingDlg = dd.cxDlg;
cyEncodingDlg = dd.cyDlg;
Expand All @@ -1849,8 +1829,7 @@ BOOL RecodeDlg(HWND hwnd, int *pidREncoding) {
dd.cxDlg = cxRecodeDlg;
dd.cyDlg = cyRecodeDlg;

const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_RECODE),
hwnd, SelectEncodingDlgProc, (LPARAM)&dd);
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_RECODE), hwnd, SelectEncodingDlgProc, (LPARAM)&dd);

cxRecodeDlg = dd.cxDlg;
cyRecodeDlg = dd.cyDlg;
Expand Down Expand Up @@ -1924,9 +1903,7 @@ static INT_PTR CALLBACK SelectDefLineEndingDlgProc(HWND hwnd, UINT umsg, WPARAM
// SelectDefLineEndingDlg()
//
BOOL SelectDefLineEndingDlg(HWND hwnd, int *iOption) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_DEFEOLMODE),
hwnd, SelectDefLineEndingDlgProc, (LPARAM)iOption);

const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_DEFEOLMODE), hwnd, SelectDefLineEndingDlgProc, (LPARAM)iOption);
return iResult == IDOK;
}

Expand Down Expand Up @@ -2001,12 +1978,7 @@ INT_PTR InfoBox(int iType, LPCWSTR lpstrSetting, int uidMessage, ...) {
ib.lpstrSetting = (LPWSTR)lpstrSetting;
ib.bDisableCheckBox = StrIsEmpty(szIniFile) || StrIsEmpty(lpstrSetting) || iMode == 2;

int idDlg = IDD_INFOBOX;
if (iType == MBYESNO) {
idDlg = IDD_INFOBOX2;
} else if (iType == MBOKCANCEL) {
idDlg = IDD_INFOBOX3;
}
const int idDlg = (iType == MBYESNO) ? IDD_INFOBOX2 : ((iType == MBOKCANCEL) ? IDD_INFOBOX3 : IDD_INFOBOX);

HWND hwnd;
if ((hwnd = GetActiveWindow()) == NULL) {
Expand All @@ -2015,8 +1987,7 @@ INT_PTR InfoBox(int iType, LPCWSTR lpstrSetting, int uidMessage, ...) {

MessageBeep(MB_ICONEXCLAMATION);

return ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(idDlg),
hwnd, InfoBoxDlgProc, (LPARAM)&ib);
return ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(idDlg), hwnd, InfoBoxDlgProc, (LPARAM)&ib);
}

// End of Dialogs.c
8 changes: 4 additions & 4 deletions src/Dialogs.h
Expand Up @@ -52,10 +52,10 @@ BOOL FavoritesDlg(HWND hwnd, LPWSTR lpstrFile);
BOOL AddToFavDlg(HWND hwnd, LPCWSTR lpszName, LPCWSTR lpszTarget);
BOOL FileMRUDlg(HWND hwnd, LPWSTR lpstrFile);
BOOL ChangeNotifyDlg(HWND hwnd);
BOOL ColumnWrapDlg(HWND hwnd, UINT uidDlg, int *iNumber);
BOOL WordWrapSettingsDlg(HWND hwnd, UINT uidDlg, int *iNumber);
BOOL LongLineSettingsDlg(HWND hwnd, UINT uidDlg, int *iNumber);
BOOL TabSettingsDlg(HWND hwnd, UINT uidDlg, int *iNumber);
BOOL ColumnWrapDlg(HWND hwnd, int *iNumber);
BOOL WordWrapSettingsDlg(HWND hwnd, int *iNumber);
BOOL LongLineSettingsDlg(HWND hwnd, int *iNumber);
BOOL TabSettingsDlg(HWND hwnd);
BOOL SelectDefEncodingDlg(HWND hwnd, int *pidREncoding);
BOOL SelectEncodingDlg(HWND hwnd, int *pidREncoding);
BOOL RecodeDlg(HWND hwnd, int *pidREncoding);
Expand Down
45 changes: 7 additions & 38 deletions src/Edit.c
Expand Up @@ -5293,15 +5293,8 @@ static INT_PTR CALLBACK EditLineNumDlgProc(HWND hwnd, UINT umsg, WPARAM wParam,
// EditLinenumDlg()
//
BOOL EditLineNumDlg(HWND hwnd) {
if (IDOK == ThemedDialogBoxParam(g_hInstance,
MAKEINTRESOURCE(IDD_LINENUM),
GetParent(hwnd),
EditLineNumDlgProc,
(LPARAM)hwnd)) {
return TRUE;
}

return FALSE;
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_LINENUM), GetParent(hwnd), EditLineNumDlgProc, (LPARAM)hwnd);
return iResult == IDOK;
}

//=============================================================================
Expand Down Expand Up @@ -5491,11 +5484,7 @@ static INT_PTR CALLBACK EditModifyLinesDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
//
BOOL EditModifyLinesDlg(HWND hwnd, LPWSTR pwsz1, LPWSTR pwsz2) {
MODLINESDATA data = { pwsz1, pwsz2 };
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance,
MAKEINTRESOURCE(IDD_MODIFYLINES),
hwnd,
EditModifyLinesDlgProc,
(LPARAM)&data);
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_MODIFYLINES), hwnd, EditModifyLinesDlgProc, (LPARAM)&data);
return iResult == IDOK;
}

Expand Down Expand Up @@ -5555,12 +5544,7 @@ static INT_PTR CALLBACK EditAlignDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LP
// EditAlignDlg()
//
BOOL EditAlignDlg(HWND hwnd, int *piAlignMode) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance,
MAKEINTRESOURCE(IDD_ALIGN),
hwnd,
EditAlignDlgProc,
(LPARAM)piAlignMode);

const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_ALIGN), hwnd, EditAlignDlgProc, (LPARAM)piAlignMode);
return iResult == IDOK;
}

Expand Down Expand Up @@ -5619,12 +5603,7 @@ static INT_PTR CALLBACK EditEncloseSelectionDlgProc(HWND hwnd, UINT umsg, WPARAM
//
BOOL EditEncloseSelectionDlg(HWND hwnd, LPWSTR pwszOpen, LPWSTR pwszClose) {
ENCLOSESELDATA data = { pwszOpen, pwszClose };
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance,
MAKEINTRESOURCE(IDD_ENCLOSESELECTION),
hwnd,
EditEncloseSelectionDlgProc,
(LPARAM)&data);

const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_ENCLOSESELECTION), hwnd, EditEncloseSelectionDlgProc, (LPARAM)&data);
return iResult == IDOK;
}

Expand Down Expand Up @@ -5740,12 +5719,7 @@ static INT_PTR CALLBACK EditInsertTagDlgProc(HWND hwnd, UINT umsg, WPARAM wParam
//
BOOL EditInsertTagDlg(HWND hwnd, LPWSTR pwszOpen, LPWSTR pwszClose) {
TAGSDATA data = { pwszOpen, pwszClose };
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance,
MAKEINTRESOURCE(IDD_INSERTTAG),
hwnd,
EditInsertTagDlgProc,
(LPARAM)&data);

const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_INSERTTAG), hwnd, EditInsertTagDlgProc, (LPARAM)&data);
return iResult == IDOK;
}

Expand Down Expand Up @@ -5936,12 +5910,7 @@ static INT_PTR CALLBACK EditSortDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPA
// EditSortDlg()
//
BOOL EditSortDlg(HWND hwnd, int *piSortFlags) {
const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance,
MAKEINTRESOURCE(IDD_SORT),
hwnd,
EditSortDlgProc,
(LPARAM)piSortFlags);

const INT_PTR iResult = ThemedDialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_SORT), hwnd, EditSortDlgProc, (LPARAM)piSortFlags);
return iResult == IDOK;
}

Expand Down
8 changes: 3 additions & 5 deletions src/Helpers.c
Expand Up @@ -1858,7 +1858,7 @@ static inline BYTE *DialogTemplate_GetFontSizeField(const DLGTEMPLATE *pTemplate
return (BYTE *)pw;
}

DLGTEMPLATE *LoadThemedDialogTemplate(LPCTSTR lpDialogTemplateID, HINSTANCE hInstance) {
DLGTEMPLATE *LoadThemedDialogTemplate(LPCWSTR lpDialogTemplateID, HINSTANCE hInstance) {
HRSRC hRsrc = FindResource(hInstance, lpDialogTemplateID, RT_DIALOG);
if (hRsrc == NULL) {
return NULL;
Expand Down Expand Up @@ -1915,8 +1915,7 @@ DLGTEMPLATE *LoadThemedDialogTemplate(LPCTSTR lpDialogTemplateID, HINSTANCE hIns
return pTemplate;
}

INT_PTR ThemedDialogBoxParam(HINSTANCE hInstance, LPCTSTR lpTemplate,
HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) {
INT_PTR ThemedDialogBoxParam(HINSTANCE hInstance, LPCWSTR lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) {
DLGTEMPLATE *pDlgTemplate = LoadThemedDialogTemplate(lpTemplate, hInstance);
const INT_PTR ret = DialogBoxIndirectParam(hInstance, pDlgTemplate, hWndParent, lpDialogFunc, dwInitParam);
if (pDlgTemplate) {
Expand All @@ -1926,8 +1925,7 @@ INT_PTR ThemedDialogBoxParam(HINSTANCE hInstance, LPCTSTR lpTemplate,
return ret;
}

HWND CreateThemedDialogParam(HINSTANCE hInstance, LPCTSTR lpTemplate,
HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) {
HWND CreateThemedDialogParam(HINSTANCE hInstance, LPCWSTR lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) {
DLGTEMPLATE *pDlgTemplate = LoadThemedDialogTemplate(lpTemplate, hInstance);
HWND hwnd = CreateDialogIndirectParam(hInstance, pDlgTemplate, hWndParent, lpDialogFunc, dwInitParam);
if (pDlgTemplate) {
Expand Down

0 comments on commit 7b3189c

Please sign in to comment.