mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2024-11-14 07:45:31 +00:00
21 lines
340 B
C
21 lines
340 B
C
#include <windows.h>
|
|
#include <initguid.h>
|
|
#include <KnownFolders.h>
|
|
#include <ShlObj.h>
|
|
#include <wchar.h>
|
|
|
|
int wmain(void) {
|
|
|
|
PWSTR path = NULL;
|
|
|
|
HRESULT hr = SHGetKnownFolderPath(&FOLDERID_Documents, 0, NULL, &path);
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
wprintf(L"%ls\n", path);
|
|
}
|
|
|
|
CoTaskMemFree(path);
|
|
|
|
return 0;
|
|
}
|