How to hide Desktop icons with Windows API in C++?

前端 未结 3 1442
走了就别回头了
走了就别回头了 2020-12-22 10:29

The answers I\'ve found link to fHideIcon, but I get a 404 error on Microsoft\'s page for those links.

I\'ve also tried:

SHELLSTATE ss;         


        
3条回答
  •  猫巷女王i
    2020-12-22 11:09

    The following seems to work (adapted from https://stackoverflow.com/a/6403014/5743288):

    #include 
    
    int main ()
    {
        HWND hProgman = FindWindowW (L"Progman", L"Program Manager");
        HWND hChild = GetWindow (hProgman, GW_CHILD);
        ShowWindow (hChild, SW_HIDE);
        Sleep (2000);
        ShowWindow (hChild, SW_SHOW);
    }
    

    Please note: this approach is not supported by Microsoft and disables right-clicking on ths desktop.

提交回复
热议问题