@@ -44,6 +44,7 @@ static DWORD MainThread;
4444
4545static void RestoreKey (WORD keyCode )
4646{
47+ AAS_MSG ("RestoreKey" );
4748 {
4849 INPUT input = { };
4950 input .type = INPUT_KEYBOARD ;
@@ -216,11 +217,13 @@ static void ClearInitMsgs()
216217
217218int StartAltAppSwitcher (HINSTANCE instance )
218219{
220+ AAS_MSG ("Starting AAS instance %u" , instance );
219221 SetLastError (0 );
220222 AssertSingleInstance ();
221223 ASSERT (SetPriorityClass (GetCurrentProcess (), REALTIME_PRIORITY_CLASS ));
222224 SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL );
223225
226+ AAS_MSG ("CoInitialize()" );
224227 CoInitialize (NULL );
225228
226229 static struct AppData appData = { };
@@ -230,6 +233,7 @@ int StartAltAppSwitcher(HINSTANCE instance)
230233 MainThread = GetCurrentThreadId ();
231234 // Init. and loads config
232235 LoadConfig (& appData .Config );
236+ AAS_MSG ("LoadConfig()" );
233237 Cfg = & appData .Config ;
234238
235239 appData .Elevated = false;
@@ -242,6 +246,7 @@ int StartAltAppSwitcher(HINSTANCE instance)
242246 appData .Elevated = elTok .TokenIsElevated ;
243247 CloseHandle (tok );
244248 }
249+ AAS_MSG ("Get elevation()" );
245250
246251 char updater [MAX_PATH ] = { };
247252 UpdaterPath (updater );
@@ -251,19 +256,24 @@ int StartAltAppSwitcher(HINSTANCE instance)
251256 CreateProcess (NULL , updater , 0 , 0 , false, CREATE_NEW_PROCESS_GROUP , 0 , 0 ,
252257 & si , & pi );
253258 }
259+ AAS_MSG ("Check for update" );
254260
255261 CoCreateInstance (& CLSID_VirtualDesktopManager , NULL , CLSCTX_ALL , & IID_IVirtualDesktopManager , (void * * )& appData .VDM );
256262 }
257263
258264 CommonInit (instance );
265+ AAS_MSG ("CommonInit" );
259266 AppModeInit (instance , & appData .Config , appData .VDM );
267+ AAS_MSG ("AppModeInit" );
260268 WinModeInit (instance , & appData .Config , appData .VDM );
269+ AAS_MSG ("WinModeInit" );
261270
262271 HANDLE threadKbHook = CreateThread (NULL , 0 , KbHookCb , (void * )& appData , CREATE_SUSPENDED , NULL );
263272 (void )threadKbHook ;
264273 SetThreadPriority (threadKbHook , THREAD_PRIORITY_TIME_CRITICAL );
265274 ResumeThread (threadKbHook );
266275 AllowSetForegroundWindow (GetCurrentProcessId ());
276+ AAS_MSG ("AllowSetForegroundWindow GetCurrentProcessId" );
267277
268278 HANDLE token ;
269279 OpenProcessToken (
@@ -287,6 +297,7 @@ int StartAltAppSwitcher(HINSTANCE instance)
287297 while (GetMessage (& msg , NULL , 0 , 0 ) > 0 ) {
288298 switch (msg .message ) {
289299 case MSG_INIT_APP : {
300+ AAS_MSG ("MSG_INIT_APP" );
290301 ClearInitMsgs ();
291302 RestoreKey (appData .Config .Key .WinHold );
292303 if (IsWindow (appData .win_mode_window )) {
@@ -301,6 +312,7 @@ int StartAltAppSwitcher(HINSTANCE instance)
301312 break ;
302313 }
303314 case MSG_INIT_WIN : {
315+ AAS_MSG ("MSG_INIT_WIN" );
304316 ClearInitMsgs ();
305317 RestoreKey (appData .Config .Key .AppHold );
306318 if (IsWindow (appData .win_mode_window )) {
0 commit comments