SpBrowser->QueryActiveShellView( &spView ), "Failed to get IShellBrowser for desktop" ) SpProv->QueryService( SID_STopLevelBrowser, IID_PPV_ARGS( &spBrowser ) ), ThrowIfFailed( E_NOINTERFACE, "Failed to get IServiceProvider interface for desktop" ) &vtLoc, &vtEmpty, SWC_DESKTOP, &lhwnd, SWFO_NEEDDISPATCH, &spdisp ), "Failed to create IShellWindows instance" ) SpShellWindows.CoCreateInstance( CLSID_ShellWindows ), Void FindDesktopFolderView( REFIID riid, void **ppv, std::string const& interfaceName ) Query an interface from the desktop shell view. Throw std::system_errorĬComInit& operator=( CComInit const& ) = delete Throw a std::system_error if the HRESULT indicates failure. The code has been tested under Windows 10 Version 1803. The program toggles the visibility of the desktop icons each time it is run. Here is a full example in form of a console application. Raymond Chen shows C++ code for that in his article "Manipulating the positions of desktop icons", specifically in his FindDesktopFolderView() function. The flag also persists after logoff or reboot. There is no need to restart the computer nor "explorer.exe". The effect of the flag is visible immediately.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |