mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
Removed get_res_string_wchar and used the get_resource_string() function instead which returns a wstring typecast into wchar*
This commit is contained in:
@@ -197,8 +197,8 @@ DWORD WINAPI CPowerRenameMenu::s_PowerRenameUIThreadProc(_In_ void* pData)
|
||||
|
||||
HRESULT __stdcall CPowerRenameMenu::GetTitle(IShellItemArray* /*psiItemArray*/, LPWSTR* ppszName)
|
||||
{
|
||||
app_name = GET_RES_STRING_WCHAR(IDS_POWERRENAME);
|
||||
return SHStrDup(app_name, ppszName);
|
||||
app_name = GET_RESOURCE_STRING(IDS_POWERRENAME);
|
||||
return SHStrDup(app_name.c_str(), ppszName);
|
||||
}
|
||||
|
||||
HRESULT __stdcall CPowerRenameMenu::GetIcon(IShellItemArray* /*psiItemArray*/, LPWSTR* ppszIcon)
|
||||
|
||||
@@ -71,5 +71,5 @@ private:
|
||||
std::atomic<long> m_refCount = 1;
|
||||
HBITMAP m_hbmpIcon = nullptr;
|
||||
CComPtr<IDataObject> m_spdo;
|
||||
wchar_t* app_name;
|
||||
std::wstring app_name;
|
||||
};
|
||||
|
||||
@@ -161,14 +161,14 @@ class PowerRenameModule : public PowertoyModuleIface
|
||||
private:
|
||||
// Enabled by default
|
||||
bool m_enabled = true;
|
||||
wchar_t* app_name;
|
||||
std::wstring app_name;
|
||||
|
||||
public:
|
||||
// Return the display name of the powertoy, this will be cached
|
||||
virtual PCWSTR get_name() override
|
||||
{
|
||||
app_name = GET_RES_STRING_WCHAR(IDS_POWERRENAME);
|
||||
return app_name;
|
||||
app_name = GET_RESOURCE_STRING(IDS_POWERRENAME);
|
||||
return app_name.c_str();
|
||||
}
|
||||
|
||||
// Enable the powertoy
|
||||
@@ -303,10 +303,7 @@ public:
|
||||
init_settings();
|
||||
}
|
||||
|
||||
~PowerRenameModule()
|
||||
{
|
||||
delete app_name;
|
||||
}
|
||||
~PowerRenameModule(){};
|
||||
};
|
||||
|
||||
extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create()
|
||||
|
||||
Reference in New Issue
Block a user