I created a new desktop for some user-registration program which requires user text info input via edit box.
The problem is:
Microsoft IME works well in the default desktop ( Named as DeskA).
But in the new created desktop (Named as DeskN), microsoft IME CAN NOT be activated in any edit control, even in notepad program.
The desktop creation code is as following:
HDESK hCurrentDesk = GetThreadDesktop(GetCurrentThreadId());
HDESK hVirtualOutSourceDesk = CreateDesktop(
szSecDesktopName.c_str(),
NULL,
NULL,
DF_ALLOWOTHERACCOUNTHOOK,
GENERIC_ALL,
NULL);
TCHAR explorer_path[MAX_PATH];
STARTUPINFO startup_info = { 0 };
ExpandEnvironmentStrings(L"%windir%\\explorer.exe", explorer_path, MAX_PATH - 1);
startup_info.cb = sizeof(startup_info);
startup_info.lpDesktop = const_cast<TCHAR*>(szSecDesktopName.c_str());
PROCESS_INFORMATION process_info = { 0 };
//We need to create an explorer.exe in the context of the new desktop for start menu, etc
SetThreadDesktop(hVirtualOutSourceDesk);
CreateProcess(explorer_path, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &startup_info, &process_info);
CreateMyUserRegisterProgram();
SetThreadDesktop(hCurrentDesk);
SwitchDesktop(hVirtualOutSourceDesk);
I guess there may be some permission issue but not clear about this.
Any suggestions?
Thanks!!!