Move icon_enum_callback to separate function
This commit is contained in:
parent
194ba95633
commit
d5b07aa347
16
extern/pfd-fixed/portable-file-dialogs.h
vendored
16
extern/pfd-fixed/portable-file-dialogs.h
vendored
|
@ -1331,6 +1331,14 @@ inline std::string internal::file_dialog::select_folder_vista(IFileDialog *ifd,
|
||||||
|
|
||||||
// notify implementation
|
// notify implementation
|
||||||
|
|
||||||
|
#if _WIN32
|
||||||
|
inline BOOL WINAPI icon_enum_callback(HMODULE hModule, LPCTSTR lpType, LPTSTR lpName, LONG_PTR lParam)
|
||||||
|
{
|
||||||
|
((NOTIFYICONDATAW *)lParam)->hIcon = ::LoadIcon(GetModuleHandle(nullptr), lpName);
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
inline notify::notify(std::string const &title,
|
inline notify::notify(std::string const &title,
|
||||||
std::string const &message,
|
std::string const &message,
|
||||||
icon _icon /* = icon::info */)
|
icon _icon /* = icon::info */)
|
||||||
|
@ -1383,14 +1391,8 @@ inline notify::notify(std::string const &title,
|
||||||
/* case icon::info: */ default: nid->dwInfoFlags = NIIF_INFO; break;
|
/* case icon::info: */ default: nid->dwInfoFlags = NIIF_INFO; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ENUMRESNAMEPROC icon_enum_callback = [](HMODULE, LPCTSTR, LPTSTR lpName, LONG_PTR lParam) WINAPI -> BOOL
|
|
||||||
{
|
|
||||||
((NOTIFYICONDATAW *)lParam)->hIcon = ::LoadIcon(GetModuleHandle(nullptr), lpName);
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
nid->hIcon = ::LoadIcon(nullptr, IDI_APPLICATION);
|
nid->hIcon = ::LoadIcon(nullptr, IDI_APPLICATION);
|
||||||
::EnumResourceNames(nullptr, RT_GROUP_ICON, icon_enum_callback, (LONG_PTR)nid.get());
|
::EnumResourceNames(nullptr, RT_GROUP_ICON, (ENUMRESNAMEPROC)icon_enum_callback, (LONG_PTR)nid.get());
|
||||||
|
|
||||||
nid->uTimeout = 5000;
|
nid->uTimeout = 5000;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue