Created
January 1, 2016 23:44
-
-
Save kumatti1/98016fc99d86b2a4c6bb to your computer and use it in GitHub Desktop.
リンク出来た(`・ω・´)ゞ
This file contains 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> | |
#pragma comment(lib,"ole32.lib") | |
#pragma comment(lib,"user32.lib") | |
#pragma comment(lib,"shell32.lib") | |
#pragma comment(lib,"shdocvw.Lib") | |
extern "C" HRESULT __stdcall SHGetIDispatchForFolder( | |
ITEMIDLIST *pidl, | |
void** ppv | |
); | |
void Main() | |
{ | |
ITEMIDLIST *pidl; | |
HRESULT hr = SHGetSpecialFolderLocation(0, CSIDL_PERSONAL, &pidl); | |
IDispatch *pDisp; | |
hr = SHGetIDispatchForFolder(pidl, (void**) &pDisp); | |
if (pDisp){ | |
pDisp->Release(); | |
} | |
ILFree(pidl); | |
} | |
int CALLBACK WinMain( | |
_In_ HINSTANCE hInstance, | |
_In_ HINSTANCE hPrevInstance, | |
_In_ LPSTR lpCmdLine, | |
_In_ int nCmdShow | |
) | |
{ | |
CoInitialize(nullptr); | |
Main(); | |
CoUninitialize(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment