Windows 10 CreateProcessAsUser launches notepad.exe with different window theme

A

AshwiniVPatil

Thread starter #1
Hi Team,


When LogonUser handle (administrator) is passed to the process , the application notepad.exe theme changes to classic theme. Please let me know how to retain the theme.Please find the images attached below.


//My code snippet//

--------------------------------------------------------------------------------

HANDLE accountHndl;

STARTUPINFO si1;

PROCESS_INFORMATION pi1;

LPTSTR szCmdline = _tcsdup(TEXT("C:\\Windows\\Notepad.exe"));



ZeroMemory(&si1, sizeof(si1));

si1.cb = sizeof(si1);

ZeroMemory(&pi1, sizeof(pi1));


if (!LogonUser(L"Administrator", L".", L"PASSWORD1234", LOGON32_LOGON_INTERACTIVE,

LOGON32_PROVIDER_DEFAULT, &accountHndl)){

}



if (CreateProcessAsUser(accountHndl**** &pi1)){

}

I do not want the application theme to change as below.Please check the buttons "close,minimize" it has changed to classic theme. Expected is as shown in 2nd image with red cross button.




Continue reading...
 
Top Bottom