Skip to content

Commit 293ad87

Browse files
committed
Just use macro
1 parent 6bd5950 commit 293ad87

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/winextras.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ void WinExtras::removeFileAssociationFromRegistry()
330330
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
331331
}
332332

333+
// This functions works only with QT6 and newer C++
333334
const wchar_t *convertCharArrayToLPCWSTR(const char *charArray)
334335
{
335336
wchar_t *wString = new wchar_t[1024];
@@ -351,8 +352,13 @@ bool WinExtras::elevateAntiMicro()
351352
char *tempfile = ba.data();
352353
tempverb[5] = '\0';
353354
tempfile[antiProgramLocation.length()] = '\0';
355+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
354356
sei.lpVerb = convertCharArrayToLPCWSTR(tempverb);
355357
sei.lpFile = convertCharArrayToLPCWSTR(tempfile);
358+
#else
359+
sei.lpVerb = tempverb;
360+
sei.lpFile = tempfile;
361+
#endif
356362
sei.hwnd = NULL;
357363
sei.nShow = SW_NORMAL;
358364
BOOL result = ShellExecuteEx(&sei);

0 commit comments

Comments
 (0)