@@ -373,7 +373,6 @@ class PyManagerOperationInProgress
373
373
class DECLSPEC_UUID (CLSID_IDLE_COMMAND) IdleCommand
374
374
: public RuntimeClass<RuntimeClassFlags<ClassicCom>, IExplorerCommand, IObjectWithSite>
375
375
{
376
- PyManagerOperationInProgress busy;
377
376
std::vector<IdleData> idles;
378
377
std::wstring iconPath;
379
378
std::wstring title;
@@ -392,21 +391,19 @@ class DECLSPEC_UUID(CLSID_IDLE_COMMAND) IdleCommand
392
391
iconPath += L" ,-4" ;
393
392
}
394
393
395
- if (!busy) {
396
- hr = ReadAllIdleInstalls (idles, HKEY_LOCAL_MACHINE, L" Software\\ Python" , KEY_WOW64_32KEY);
397
- if (SUCCEEDED (hr)) {
398
- hr = ReadAllIdleInstalls (idles, HKEY_LOCAL_MACHINE, L" Software\\ Python" , KEY_WOW64_64KEY);
399
- }
400
- if (SUCCEEDED (hr)) {
401
- hr = ReadAllIdleInstalls (idles, HKEY_CURRENT_USER, L" Software\\ Python" , 0 );
402
- }
394
+ hr = ReadAllIdleInstalls (idles, HKEY_LOCAL_MACHINE, L" Software\\ Python" , KEY_WOW64_32KEY);
395
+ if (SUCCEEDED (hr)) {
396
+ hr = ReadAllIdleInstalls (idles, HKEY_LOCAL_MACHINE, L" Software\\ Python" , KEY_WOW64_64KEY);
397
+ }
398
+ if (SUCCEEDED (hr)) {
399
+ hr = ReadAllIdleInstalls (idles, HKEY_CURRENT_USER, L" Software\\ Python" , 0 );
400
+ }
403
401
404
- if (FAILED (hr)) {
405
- wchar_t buffer[512 ];
406
- swprintf_s (buffer, L" IdleCommand error 0x%08X" , (DWORD)hr);
407
- OutputDebugStringW (buffer);
408
- idles.clear ();
409
- }
402
+ if (FAILED (hr)) {
403
+ wchar_t buffer[512 ];
404
+ swprintf_s (buffer, L" IdleCommand error 0x%08X" , (DWORD)hr);
405
+ OutputDebugStringW (buffer);
406
+ idles.clear ();
410
407
}
411
408
}
412
409
@@ -425,12 +422,10 @@ class DECLSPEC_UUID(CLSID_IDLE_COMMAND) IdleCommand
425
422
iconPath += L" ,-4" ;
426
423
}
427
424
428
- if (!busy) {
429
- hr = ReadAllIdleInstalls (idles, hive, root, 0 );
425
+ hr = ReadAllIdleInstalls (idles, hive, root, 0 );
430
426
431
- if (FAILED (hr)) {
432
- idles.clear ();
433
- }
427
+ if (FAILED (hr)) {
428
+ idles.clear ();
434
429
}
435
430
}
436
431
#endif
@@ -469,6 +464,10 @@ class DECLSPEC_UUID(CLSID_IDLE_COMMAND) IdleCommand
469
464
470
465
IFACEMETHODIMP GetState (IShellItemArray *psiItemArray, BOOL fOkToBeSlow , EXPCMDSTATE *pCmdState)
471
466
{
467
+ if (title.empty ()) {
468
+ *pCmdState = ECS_HIDDEN;
469
+ return S_OK;
470
+ }
472
471
*pCmdState = idles.size () ? ECS_ENABLED : ECS_DISABLED;
473
472
return S_OK;
474
473
}
0 commit comments