blob: 8c8da669d05ccee0513ebc4f9fb6db632a338af0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include "main.h"
#include "Defaults.h"
#include <shlobj.h>
wchar_t defaultDownloadPath[MAX_PATH] = {0},
serviceUrl[1024] = {0};
__time64_t updateTime = 60 /* 1 minute */ * 60 /* 1 hour */ * 24 /* 1 day */;
int autoDownloadEpisodes = 1;
bool autoUpdate = true;
bool autoDownload = true;
bool updateOnLaunch = false;
bool needToMakePodcastsView=true;
static BOOL UtilGetSpecialFolderPath( HWND hwnd, wchar_t *path, int folder )
{
ITEMIDLIST *pidl; // Shell Item ID List ptr
IMalloc *imalloc; // Shell IMalloc interface ptr
BOOL result; // Return value
if ( SHGetSpecialFolderLocation( hwnd, folder, &pidl ) != NOERROR )
return FALSE;
result = SHGetPathFromIDList( pidl, path );
if ( SHGetMalloc( &imalloc ) == NOERROR )
{
imalloc->Free( pidl );
imalloc->Release();
}
return result;
}
void BuildDefaultDownloadPath( HWND hwnd )
{
wchar_t defaultPath[ MAX_PATH ] = L"";
if ( !UtilGetSpecialFolderPath( hwnd, defaultPath, CSIDL_MYMUSIC ) )
UtilGetSpecialFolderPath( hwnd, defaultPath, CSIDL_PERSONAL );
lstrcpyn( defaultDownloadPath, defaultPath, MAX_PATH );
}
|