Is there a code that delete all the users cookies in one time
(like the reecycle bin : SHEmptyRecycleBin(NULL, "", 0))
because the path is different on every windows
thnx in advance (i searched already in wininet.h , but dindt found something)
Printable View
Is there a code that delete all the users cookies in one time
(like the reecycle bin : SHEmptyRecycleBin(NULL, "", 0))
because the path is different on every windows
thnx in advance (i searched already in wininet.h , but dindt found something)
There's probably some registry key which will tell you where the current users' cookies are stored.
gives error while application runsCode:LPTSTR strCookiesPath;
// get the coockies folder
strCookiesPath = SHGetFolderPath(NULL, CSIDL_COOKIES,
NULL, SHGFP_TYPE_CURRENT, MAX_PATH);
MessageBox(NULL, strCookiesPath , "Path", MB_OK );
i get this warnings
Code:warning C4047: 'function' : 'LPSTR' differs in levels of indirection from 'int'
warning C4024: 'SHGetFolderPathA' : different types for formal and actual parameter 5
warning C4047: '=' : 'LPTSTR' differs in levels of indirection from 'HRESULT'
Code:LPTSTR strCookiesPath;
// get the coockies folder
strCookiesPath = (LPTSTR)SHGetFolderPath(NULL, CSIDL_COOKIES,
NULL, SHGFP_TYPE_CURRENT, MAX_PATH);
MessageBox(NULL, strCookiesPath , "Path", MB_OK );
doesnt make any different , same warnings , still crashing at that point
SHGetFolderPath is deprecated, but this works using LCC. For whatever reason the header shlobj.h for MinGW that I have doesn't have SHGFP_TYPE_CURRENT defined, so that's kind of interesting.
Code:#include <windows.h>
#include <shlobj.h>
int main(void)
{
char strCookiesPath[MAX_PATH];
SHGetFolderPath(NULL, CSIDL_COOKIES, NULL, SHGFP_TYPE_CURRENT,strCookiesPath);
MessageBox(NULL, strCookiesPath, "Path", MB_OK );
return 0;
}
For portability on Win9x, I use this on my apps:
Code:int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
LPITEMIDLIST lpidl;
char pszPath[MAX_PATH];
if (SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_COOKIES, &lpidl))) {
SHGetPathFromIDList(lpidl, pszPath);
MessageBox(NULL, pszPath, "My Cookie jar", MB_OK);
CoTaskMemFree(lpidl);
}
return 0;
}
thnx:)