Egon Kocjan
2008-12-06 14:41:04 UTC
Hello,
I am using this code to ask the user for the web proxy password (error 407):
bool get_password(HWND wnd, HINTERNET handle)
{
DWORD ret = InternetErrorDlg(
wnd ? wnd : GetDesktopWindow(),
handle,
ERROR_INTERNET_INCORRECT_PASSWORD,
FLAGS_ERROR_UI_FILTER_FOR_ERRORS |
FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS |
FLAGS_ERROR_UI_FLAGS_GENERATE_DATA,
NULL);
return ret == ERROR_INTERNET_FORCE_RETRY;
}
It works ok, the next time I request to download something, WinInet
authenticates automatically, I don't get 407 at all anymore.
The problem is, even if I check the "Save password", the password is not
really saved. So, when I close and open my program again, the error
dialog will be empty and I have to enter the password again!
What bothers me even more: Internet Explorer (version 7 on Vista)
displays the same dialog and the password is saved*.
What do I have to do to have passwords saved like Internet Explorer?
* I've also checked with CredEnumerateW - it shows as
target=Microsoft_WinInet_PROXY/REALM
Thanks,
Egon
I am using this code to ask the user for the web proxy password (error 407):
bool get_password(HWND wnd, HINTERNET handle)
{
DWORD ret = InternetErrorDlg(
wnd ? wnd : GetDesktopWindow(),
handle,
ERROR_INTERNET_INCORRECT_PASSWORD,
FLAGS_ERROR_UI_FILTER_FOR_ERRORS |
FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS |
FLAGS_ERROR_UI_FLAGS_GENERATE_DATA,
NULL);
return ret == ERROR_INTERNET_FORCE_RETRY;
}
It works ok, the next time I request to download something, WinInet
authenticates automatically, I don't get 407 at all anymore.
The problem is, even if I check the "Save password", the password is not
really saved. So, when I close and open my program again, the error
dialog will be empty and I have to enter the password again!
What bothers me even more: Internet Explorer (version 7 on Vista)
displays the same dialog and the password is saved*.
What do I have to do to have passwords saved like Internet Explorer?
* I've also checked with CredEnumerateW - it shows as
target=Microsoft_WinInet_PROXY/REALM
Thanks,
Egon