Created
April 10, 2019 07:55
-
-
Save yanwei07/68e12dac9bf14264ef8f42a8e40a49c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <shlobj.h> | |
#include <exdisp.h> | |
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pCmdLine, int iCmdShow) | |
{ | |
// Initialize the use of COM objects... | |
CoInitialize(NULL); | |
// Create a Shell object pointer... | |
IShellDispatch* pShell = NULL; | |
HRESULT hr = CoCreateInstance(CLSID_Shell, NULL, CLSCTX_SERVER, IID_IDispatch, (void**)&pShell); | |
if (SUCCEEDED(hr)) | |
{ | |
// Call the MinimizeAll() shell function... | |
pShell->MinimizeAll(); | |
// Release the COM object when we're finished... | |
pShell->Release(); | |
} | |
CoUninitialize(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment