mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2024-11-24 11:25:30 +00:00
Create documents_dir.c
This commit is contained in:
parent
fa3b88797f
commit
74778c8a35
20
system/documents_dir.c
Normal file
20
system/documents_dir.c
Normal file
@ -0,0 +1,20 @@
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user