diff --git a/HTTP_Downloader/HTTP_Downloader.rc b/HTTP_Downloader/HTTP_Downloader.rc index 2d34a3f..0d9515f 100644 --- a/HTTP_Downloader/HTTP_Downloader.rc +++ b/HTTP_Downloader/HTTP_Downloader.rc @@ -63,8 +63,8 @@ IDI_ICON_TRAY ICON "icon_tray.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,6,2 - PRODUCTVERSION 1,0,6,2 + FILEVERSION 1,0,6,3 + PRODUCTVERSION 1,0,6,3 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -81,12 +81,12 @@ BEGIN BEGIN VALUE "Comments", "HTTP Downloader is made free under the GPLv3 license." VALUE "FileDescription", "HTTP Downloader can download files through HTTP(S), FTP(S), and SFTP connections." - VALUE "FileVersion", "1, 0, 6, 2" + VALUE "FileVersion", "1, 0, 6, 3" VALUE "InternalName", "HTTP Downloader" VALUE "LegalCopyright", "Copyright © 2015-2024 Eric Kutcher" VALUE "OriginalFilename", "HTTP_Downloader.exe" VALUE "ProductName", "HTTP Downloader" - VALUE "ProductVersion", "1, 0, 6, 2" + VALUE "ProductVersion", "1, 0, 6, 3" END END BLOCK "VarFileInfo" diff --git a/HTTP_Downloader/changelog.txt b/HTTP_Downloader/changelog.txt index 73e7e57..aa3e10d 100644 --- a/HTTP_Downloader/changelog.txt +++ b/HTTP_Downloader/changelog.txt @@ -1,3 +1,11 @@ +Version: 1.0.6.3 +Released: 2024-09-03 + +Memory optimization for cached icons. +Fixed TreeListView edit box missing dark mode style. +Site Manager proxy settings are now applied to redirected URL(s). +Fixed scrolling issue when TreeListView items are removed and group host is first visible item. + Version: 1.0.6.2 Released: 2024-06-23 diff --git a/HTTP_Downloader/connection.cpp b/HTTP_Downloader/connection.cpp index 30f9420..785bffe 100644 --- a/HTTP_Downloader/connection.cpp +++ b/HTTP_Downloader/connection.cpp @@ -5061,7 +5061,7 @@ ICON_INFO *CacheIcon( DOWNLOAD_INFO *di, SHFILEINFO *sfi ) _CoUninitialize(); } - ii = ( ICON_INFO * )GlobalAlloc( GMEM_FIXED, sizeof( DOWNLOAD_INFO ) ); + ii = ( ICON_INFO * )GlobalAlloc( GMEM_FIXED, sizeof( ICON_INFO ) ); if ( ii != NULL ) { ii->file_extension = GlobalStrDupW( di->file_path + di->file_extension_offset ); @@ -6686,7 +6686,7 @@ DWORD WINAPI AddURL( void *add_info ) if ( proxy_info.type != 0 ) { - di->proxy_info = ( PROXY_INFO * )GlobalAlloc( GPTR, sizeof( PROXY_INFO ) ); + di->proxy_info = di->saved_proxy_info = ( PROXY_INFO * )GlobalAlloc( GPTR, sizeof( PROXY_INFO ) ); di->proxy_info->type = proxy_info.type; di->proxy_info->ip_address = proxy_info.ip_address; @@ -6737,7 +6737,6 @@ DWORD WINAPI AddURL( void *add_info ) if ( proxy_info.username != NULL ) { - proxy_username_length = lstrlenA( proxy_info.username ); di->proxy_info->username = ( char * )GlobalAlloc( GMEM_FIXED, sizeof( char ) * ( proxy_username_length + 1 ) ); _memcpy_s( di->proxy_info->username, proxy_username_length + 1, proxy_info.username, proxy_username_length + 1 ); } @@ -6748,7 +6747,6 @@ DWORD WINAPI AddURL( void *add_info ) if ( proxy_info.password != NULL ) { - proxy_password_length = lstrlenA( proxy_info.password ); di->proxy_info->password = ( char * )GlobalAlloc( GMEM_FIXED, sizeof( char ) * ( proxy_password_length + 1 ) ); _memcpy_s( di->proxy_info->password, proxy_password_length + 1, proxy_info.password, proxy_password_length + 1 ); } @@ -8159,17 +8157,11 @@ void CleanupConnection( SOCKET_CONTEXT *context ) GlobalFree( di->auth_info.username ); GlobalFree( di->auth_info.password ); - if ( di->proxy_info != NULL ) + if ( di->proxy_info != di->saved_proxy_info ) { - GlobalFree( di->proxy_info->hostname ); - GlobalFree( di->proxy_info->punycode_hostname ); - GlobalFree( di->proxy_info->w_username ); - GlobalFree( di->proxy_info->w_password ); - GlobalFree( di->proxy_info->username ); - GlobalFree( di->proxy_info->password ); - GlobalFree( di->proxy_info->auth_key ); - GlobalFree( di->proxy_info ); + FreeProxyInfo( &di->saved_proxy_info ); } + FreeProxyInfo( &di->proxy_info ); // Safe to free this here since the listview item will have been removed. while ( di->range_list != NULL ) @@ -8573,6 +8565,24 @@ void CleanupConnection( SOCKET_CONTEXT *context ) } } +void FreeProxyInfo( PROXY_INFO **proxy_info ) +{ + if ( *proxy_info != NULL ) + { + if ( ( *proxy_info )->hostname != NULL ) { GlobalFree( ( *proxy_info )->hostname ); } + if ( ( *proxy_info )->punycode_hostname != NULL ) { GlobalFree( ( *proxy_info )->punycode_hostname ); } + if ( ( *proxy_info )->w_username != NULL ) { GlobalFree( ( *proxy_info )->w_username ); } + if ( ( *proxy_info )->w_password != NULL ) { GlobalFree( ( *proxy_info )->w_password ); } + if ( ( *proxy_info )->username != NULL ) { GlobalFree( ( *proxy_info )->username ); } + if ( ( *proxy_info )->password != NULL ) { GlobalFree( ( *proxy_info )->password ); } + if ( ( *proxy_info )->auth_key != NULL ) { GlobalFree( ( *proxy_info )->auth_key ); } + + GlobalFree( *proxy_info ); + + *proxy_info = NULL; + } +} + void FreePOSTInfo( POST_INFO **post_info ) { if ( *post_info != NULL ) diff --git a/HTTP_Downloader/connection.h b/HTTP_Downloader/connection.h index e78b164..89ccfba 100644 --- a/HTTP_Downloader/connection.h +++ b/HTTP_Downloader/connection.h @@ -427,6 +427,7 @@ struct DOWNLOAD_INFO unsigned long long download_speed_limit; DOWNLOAD_INFO *shared_info; PROXY_INFO *proxy_info; + PROXY_INFO *saved_proxy_info; wchar_t *url; DoublyLinkedList *host_list; // Other hosts that are downloading the file. DoublyLinkedList *range_list; @@ -514,6 +515,7 @@ void RemoveCachedIcon( DOWNLOAD_INFO *di, wchar_t *file_extension = NULL ); void SetSharedInfoStatus( DOWNLOAD_INFO *shared_info ); +void FreeProxyInfo( PROXY_INFO **proxy_info ); void FreePOSTInfo( POST_INFO **post_info ); void FreeAuthInfo( AUTH_INFO **auth_info ); void FreeAddInfo( ADD_INFO **add_info ); diff --git a/HTTP_Downloader/dark_mode.cpp b/HTTP_Downloader/dark_mode.cpp index e9b8a7a..7c2de3b 100644 --- a/HTTP_Downloader/dark_mode.cpp +++ b/HTTP_Downloader/dark_mode.cpp @@ -4757,7 +4757,8 @@ BOOL CALLBACK EnumChildProc( HWND hWnd, LPARAM /*lParam*/ ) { ret = _GetClassNameW( hWnd_parent, buf, 64 ); if ( ret == 8 && _StrCmpNW( buf, L"ComboBox", 8 ) == 0 || - ret == 14 && _StrCmpNW( buf, L"SysIPAddress32", 14 ) == 0 ) + ret == 14 && _StrCmpNW( buf, L"SysIPAddress32", 14 ) == 0 || + ret == 12 && _StrCmpNW( buf, L"TreeListView", 12 ) == 0 ) { SetSubclass( hWnd, &DMChildEditSubProc, &g_sci_edit_child ); @@ -5007,7 +5008,8 @@ BOOL CALLBACK EnumTLWProc( HWND hWnd, LPARAM /*lParam*/ ) ( ret == 18 && _StrCmpNW( buf, L"class_site_manager", 18 ) == 0 ) || ( ret == 23 && _StrCmpNW( buf, L"class_check_for_updates", 23 ) == 0 ) || ( ret == 18 && _StrCmpNW( buf, L"class_site_manager", 18 ) == 0 ) || - ( ret == 24 && _StrCmpNW( buf, L"class_fingerprint_prompt", 24 ) == 0 ) ) + ( ret == 24 && _StrCmpNW( buf, L"class_fingerprint_prompt", 24 ) == 0 ) || + ( ret == 12 && _StrCmpNW( buf, L"TreeListView", 12 ) == 0 ) ) { BOOL dark = TRUE; /*WINDOWCOMPOSITIONATTRIBDATA data = { WCA_USEDARKMODECOLORS, &dark, sizeof( dark ) }; diff --git a/HTTP_Downloader/dm_version.txt b/HTTP_Downloader/dm_version.txt index 25c0f2c..0fcbb53 100644 --- a/HTTP_Downloader/dm_version.txt +++ b/HTTP_Downloader/dm_version.txt @@ -1,4 +1,4 @@ -16778754 -https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.2/HTTP_Downloader_DM_32.zip -16778754 -https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.2/HTTP_Downloader_DM_64.zip +16778755 +https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.3/HTTP_Downloader_DM_32.zip +16778755 +https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.3/HTTP_Downloader_DM_64.zip diff --git a/HTTP_Downloader/file_operations.cpp b/HTTP_Downloader/file_operations.cpp index ca8d434..0be2d0d 100644 --- a/HTTP_Downloader/file_operations.cpp +++ b/HTTP_Downloader/file_operations.cpp @@ -2398,16 +2398,6 @@ char read_download_history( wchar_t *file_path, bool scroll_to_last_item ) // - // Cache our file's icon. - ICON_INFO *ii = CacheIcon( shared_info, sfi ); - - if ( ii != NULL ) - { - shared_info->icon = &ii->icon; - } - - // - SYSTEMTIME st; FILETIME ft; ft.dwHighDateTime = shared_info->add_time.HighPart; @@ -2995,7 +2985,7 @@ char read_download_history( wchar_t *file_path, bool scroll_to_last_item ) } } - di->proxy_info = pi; + di->proxy_info = di->saved_proxy_info = pi; } // @@ -3043,6 +3033,16 @@ char read_download_history( wchar_t *file_path, bool scroll_to_last_item ) SetSharedInfoStatus( shared_info ); + // + + // Cache our file's icon. + ICON_INFO *ii = CacheIcon( shared_info, sfi ); + + if ( ii != NULL ) + { + shared_info->icon = &ii->icon; + } + continue; } @@ -3097,17 +3097,12 @@ char read_download_history( wchar_t *file_path, bool scroll_to_last_item ) GlobalFree( di->auth_info.username ); GlobalFree( di->auth_info.password ); - if ( di->proxy_info != NULL ) + // saved_proxy_info equals proxy_info here. + /*if ( di->proxy_info != di->saved_proxy_info ) { - GlobalFree( di->proxy_info->hostname ); - GlobalFree( di->proxy_info->punycode_hostname ); - GlobalFree( di->proxy_info->w_username ); - GlobalFree( di->proxy_info->w_password ); - GlobalFree( di->proxy_info->username ); - GlobalFree( di->proxy_info->password ); - GlobalFree( di->proxy_info->auth_key ); - GlobalFree( di->proxy_info ); - } + FreeProxyInfo( &di->saved_proxy_info ); + }*/ + FreeProxyInfo( &di->proxy_info ); while ( di->range_list != NULL ) { @@ -3356,7 +3351,7 @@ char save_download_history( wchar_t *file_path ) int proxy_password_length = 0; int proxy_address_length = 0; - PROXY_INFO *pi = di->proxy_info; + PROXY_INFO *pi = di->saved_proxy_info; if ( pi != NULL && pi->type != 0 ) { optional_extra_length += sizeof( unsigned char ); diff --git a/HTTP_Downloader/globals.h b/HTTP_Downloader/globals.h index a6eba46..4c0f88f 100644 --- a/HTTP_Downloader/globals.h +++ b/HTTP_Downloader/globals.h @@ -109,7 +109,7 @@ #define CURRENT_VERSION_A 1 #define CURRENT_VERSION_B 0 #define CURRENT_VERSION_C 6 -#define CURRENT_VERSION_D 2 +#define CURRENT_VERSION_D 3 #define CURRENT_VERSION ( ( CURRENT_VERSION_A << 24 ) | \ ( CURRENT_VERSION_B << 16 ) | \ diff --git a/HTTP_Downloader/http_parsing.cpp b/HTTP_Downloader/http_parsing.cpp index bb542b2..fcfe3af 100644 --- a/HTTP_Downloader/http_parsing.cpp +++ b/HTTP_Downloader/http_parsing.cpp @@ -21,6 +21,7 @@ #include "globals.h" #include "utilities.h" #include "dllrbt.h" +#include "site_manager_utilities.h" #include "lite_ole32.h" #include "lite_zlib1.h" @@ -3745,8 +3746,12 @@ char HandleRedirect( SOCKET_CONTEXT *context ) // + bool is_absolute_uri = false; + if ( context->header_info.url_location.host != NULL ) // Handle absolute URIs. { + is_absolute_uri = true; + redirect_context->request_info.host = context->header_info.url_location.host; redirect_context->request_info.port = context->header_info.url_location.port; redirect_context->request_info.resource = context->header_info.url_location.resource; @@ -3831,6 +3836,137 @@ char HandleRedirect( SOCKET_CONTEXT *context ) redirect_context->parts_node.data = redirect_context; DLL_AddNode( &redirect_context->download_info->parts_list, &redirect_context->parts_node, -1 ); + // Absolute URI redirection. See if the protocol, host, and port have changed. + if ( is_absolute_uri && + ( redirect_context->request_info.port != context->request_info.port || + redirect_context->request_info.protocol != context->request_info.protocol || + lstrcmpiA( redirect_context->request_info.host, context->request_info.host ) != 0 ) ) + { + DOWNLOAD_INFO *di = redirect_context->download_info; + + if ( di->proxy_info == di->saved_proxy_info ) + { + di->proxy_info = NULL; + } + else + { + FreeProxyInfo( &di->proxy_info ); + } + + int host_length = MultiByteToWideChar( CP_UTF8, 0, redirect_context->request_info.host, -1, NULL, 0 ); // Include the NULL terminator. + wchar_t *host = ( wchar_t * )GlobalAlloc( GMEM_FIXED, sizeof( wchar_t ) * host_length ); + MultiByteToWideChar( CP_UTF8, 0, redirect_context->request_info.host, -1, host, host_length ); + + SITE_INFO tsi; + tsi.host = host; + tsi.protocol = redirect_context->request_info.protocol; + tsi.port = redirect_context->request_info.port; + + SITE_INFO *si = ( SITE_INFO * )dllrbt_find( g_site_info, ( void * )&tsi, true ); + + GlobalFree( host ); + + if ( si != NULL && si->enable && si->proxy_info.type != 0 ) + { + int proxy_username_length; + int proxy_password_length; + + di->proxy_info = ( PROXY_INFO * )GlobalAlloc( GPTR, sizeof( PROXY_INFO ) ); + + di->proxy_info->type = si->proxy_info.type; + di->proxy_info->ip_address = si->proxy_info.ip_address; + di->proxy_info->port = si->proxy_info.port; + di->proxy_info->address_type = si->proxy_info.address_type; + di->proxy_info->use_authentication = si->proxy_info.use_authentication; + di->proxy_info->resolve_domain_names = si->proxy_info.resolve_domain_names; + + if ( si->proxy_info.hostname != NULL ) + { + int proxy_hostname_length = lstrlenW( si->proxy_info.hostname ); + di->proxy_info->hostname = ( wchar_t * )GlobalAlloc( GMEM_FIXED, sizeof( wchar_t ) * ( proxy_hostname_length + 1 ) ); + _wmemcpy_s( di->proxy_info->hostname, proxy_hostname_length + 1, si->proxy_info.hostname, proxy_hostname_length + 1 ); + } + else + { + di->proxy_info->hostname = NULL; + } + + if ( si->proxy_info.punycode_hostname != NULL ) + { + int proxy_punycode_hostname_length = lstrlenW( si->proxy_info.punycode_hostname ); + di->proxy_info->punycode_hostname = ( wchar_t * )GlobalAlloc( GMEM_FIXED, sizeof( wchar_t ) * ( proxy_punycode_hostname_length + 1 ) ); + _wmemcpy_s( di->proxy_info->punycode_hostname, proxy_punycode_hostname_length + 1, si->proxy_info.punycode_hostname, proxy_punycode_hostname_length + 1 ); + } + else + { + di->proxy_info->punycode_hostname = NULL; + } + + if ( si->proxy_info.w_username != NULL ) + { + int proxy_w_username_length = lstrlenW( si->proxy_info.w_username ); + di->proxy_info->w_username = ( wchar_t * )GlobalAlloc( GMEM_FIXED, sizeof( wchar_t ) * ( proxy_w_username_length + 1 ) ); + _wmemcpy_s( di->proxy_info->w_username, proxy_w_username_length + 1, si->proxy_info.w_username, proxy_w_username_length + 1 ); + } + else + { + di->proxy_info->w_username = NULL; + } + + if ( si->proxy_info.w_password != NULL ) + { + int proxy_w_password_length = lstrlenW( si->proxy_info.w_password ); + di->proxy_info->w_password = ( wchar_t * )GlobalAlloc( GMEM_FIXED, sizeof( wchar_t ) * ( proxy_w_password_length + 1 ) ); + _wmemcpy_s( di->proxy_info->w_password, proxy_w_password_length + 1, si->proxy_info.w_password, proxy_w_password_length + 1 ); + } + else + { + di->proxy_info->w_password = NULL; + } + + if ( si->proxy_info.username != NULL ) + { + proxy_username_length = lstrlenA( si->proxy_info.username ); + di->proxy_info->username = ( char * )GlobalAlloc( GMEM_FIXED, sizeof( char ) * ( proxy_username_length + 1 ) ); + _memcpy_s( di->proxy_info->username, proxy_username_length + 1, si->proxy_info.username, proxy_username_length + 1 ); + } + else + { + di->proxy_info->username = NULL; + proxy_username_length = 0; + } + + if ( si->proxy_info.password != NULL ) + { + proxy_password_length = lstrlenA( si->proxy_info.password ); + di->proxy_info->password = ( char * )GlobalAlloc( GMEM_FIXED, sizeof( char ) * ( proxy_password_length + 1 ) ); + _memcpy_s( di->proxy_info->password, proxy_password_length + 1, si->proxy_info.password, proxy_password_length + 1 ); + } + else + { + di->proxy_info->password = NULL; + proxy_password_length = 0; + } + + if ( ( si->proxy_info.type == 1 || si->proxy_info.type == 2 ) && ( di->proxy_info->username != NULL && di->proxy_info->password != NULL ) ) + { + CreateBasicAuthorizationKey( di->proxy_info->username, proxy_username_length, di->proxy_info->password, proxy_password_length, &di->proxy_info->auth_key, &di->proxy_info->auth_key_length ); + } + else + { + di->proxy_info->auth_key = NULL; + di->proxy_info->auth_key_length = 0; + } + + if ( cfg_update_redirected ) + { + FreeProxyInfo( &di->saved_proxy_info ); + + di->saved_proxy_info = di->proxy_info; + } + } + } + LeaveCriticalSection( &context->download_info->di_cs ); context->download_info = NULL; diff --git a/HTTP_Downloader/list_operations.cpp b/HTTP_Downloader/list_operations.cpp index ba9ff8f..cdfb898 100644 --- a/HTTP_Downloader/list_operations.cpp +++ b/HTTP_Downloader/list_operations.cpp @@ -166,6 +166,7 @@ THREAD_RETURN remove_items( void *pArguments ) int sel_count = TLV_GetSelectedCount(); int item_count = TLV_GetExpandedItemCount(); + int old_item_count = item_count; int visible_item_count = TLV_GetVisibleItemCount(); int first_visible_index = TLV_GetFirstVisibleIndex(); int old_first_visible_index = first_visible_index; @@ -321,17 +322,11 @@ THREAD_RETURN remove_items( void *pArguments ) GlobalFree( di->auth_info.username ); GlobalFree( di->auth_info.password ); - if ( di->proxy_info != NULL ) + if ( di->proxy_info != di->saved_proxy_info ) { - GlobalFree( di->proxy_info->hostname ); - GlobalFree( di->proxy_info->punycode_hostname ); - GlobalFree( di->proxy_info->w_username ); - GlobalFree( di->proxy_info->w_password ); - GlobalFree( di->proxy_info->username ); - GlobalFree( di->proxy_info->password ); - GlobalFree( di->proxy_info->auth_key ); - GlobalFree( di->proxy_info ); + FreeProxyInfo( &di->saved_proxy_info ); } + FreeProxyInfo( &di->proxy_info ); while ( di->range_list != NULL ) { @@ -499,9 +494,15 @@ THREAD_RETURN remove_items( void *pArguments ) { first_visible_index -= ( tln->child_count + 1 ); } - else + else if ( !tln->is_expanded && sel_index < old_first_visible_index ) + { + --first_visible_index; + } + else // The first visible is a child node. { first_visible_index -= ( old_first_visible_index - parent_index ); + + item_count -= ( ( tln->child_count - ( old_first_visible_index - parent_index ) ) + 1 ); } } else @@ -549,6 +550,9 @@ THREAD_RETURN remove_items( void *pArguments ) } else // We can remove the item and the list will move up. { + // Adjust this so that if the remaining items cause us to be at the end of the list, then it'll hit the if block above. + item_count -= sel_item_count; + if ( tln == first_visible_node ) { if ( first_visible_node->parent != NULL ) @@ -560,19 +564,13 @@ THREAD_RETURN remove_items( void *pArguments ) first_visible_node = first_visible_node->next; } } - else + else if ( tln == first_visible_node->parent ) // We're a child item. { - if ( first_visible_index > 0 ) - { - --first_visible_index; + int parent_index = TLV_GetParentIndex( first_visible_node, old_first_visible_index ); - if ( first_visible_node->parent == NULL ) - { - --first_visible_root_index; - } + first_visible_index -= ( ( old_first_visible_index - parent_index ) ); - first_visible_node = TLV_PrevNode( first_visible_node, false ); - } + first_visible_node = tln->next; } } } @@ -598,6 +596,10 @@ THREAD_RETURN remove_items( void *pArguments ) } // Update our internal values. + if ( expanded_item_count == old_item_count ) + { + first_visible_node = NULL; + } TLV_SetFirstVisibleRootIndex( first_visible_root_index ); TLV_SetFirstVisibleItem( first_visible_node ); TLV_SetFirstVisibleIndex( first_visible_index ); @@ -886,6 +888,7 @@ THREAD_RETURN handle_download_list( void *pArguments ) _SendMessageW( g_hWnd_tlv_files, TLVM_TOGGLE_DRAW, TRUE, NULL ); int item_count = TLV_GetExpandedItemCount(); + int old_item_count = item_count; int visible_item_count = TLV_GetVisibleItemCount(); int first_visible_index = TLV_GetFirstVisibleIndex(); int old_first_visible_index = first_visible_index; @@ -918,6 +921,7 @@ THREAD_RETURN handle_download_list( void *pArguments ) DOWNLOAD_INFO *di = ( DOWNLOAD_INFO * )tln->data; if ( di != NULL ) { + // Make sure the download is completed and subsequently cleaned up before we remove it. EnterCriticalSection( &di->di_cs ); if ( di->status == STATUS_COMPLETED ) @@ -978,17 +982,11 @@ THREAD_RETURN handle_download_list( void *pArguments ) GlobalFree( di->auth_info.username ); GlobalFree( di->auth_info.password ); - if ( di->proxy_info != NULL ) + if ( di->proxy_info != di->saved_proxy_info ) { - GlobalFree( di->proxy_info->hostname ); - GlobalFree( di->proxy_info->punycode_hostname ); - GlobalFree( di->proxy_info->w_username ); - GlobalFree( di->proxy_info->w_password ); - GlobalFree( di->proxy_info->username ); - GlobalFree( di->proxy_info->password ); - GlobalFree( di->proxy_info->auth_key ); - GlobalFree( di->proxy_info ); + FreeProxyInfo( &di->saved_proxy_info ); } + FreeProxyInfo( &di->proxy_info ); while ( di->range_list != NULL ) { @@ -1080,9 +1078,15 @@ THREAD_RETURN handle_download_list( void *pArguments ) { first_visible_index -= ( tln->child_count + 1 ); } - else + else if ( !tln->is_expanded && item_index < old_first_visible_index ) + { + --first_visible_index; + } + else // The first visible is a child node. { first_visible_index -= ( old_first_visible_index - parent_index ); + + item_count -= ( ( tln->child_count - ( old_first_visible_index - parent_index ) ) + 1 ); } } else @@ -1130,6 +1134,9 @@ THREAD_RETURN handle_download_list( void *pArguments ) } else // We can remove the item and the list will move up. { + // Adjust this so that if the remaining items cause us to be at the end of the list, then it'll hit the if block above. + item_count -= sel_item_count; + if ( tln == first_visible_node ) { if ( first_visible_node->parent != NULL ) @@ -1141,19 +1148,13 @@ THREAD_RETURN handle_download_list( void *pArguments ) first_visible_node = first_visible_node->next; } } - else + else if ( tln == first_visible_node->parent ) // We're a child item. { - if ( first_visible_index > 0 ) - { - --first_visible_index; + int parent_index = TLV_GetParentIndex( first_visible_node, old_first_visible_index ); - if ( first_visible_node->parent == NULL ) - { - --first_visible_root_index; - } + first_visible_index -= ( ( old_first_visible_index - parent_index ) ); - first_visible_node = TLV_PrevNode( first_visible_node, false ); - } + first_visible_node = tln->next; } } } @@ -1197,6 +1198,10 @@ THREAD_RETURN handle_download_list( void *pArguments ) } // Update our internal values. + if ( expanded_item_count == old_item_count ) + { + first_visible_node = NULL; + } TLV_SetFirstVisibleRootIndex( first_visible_root_index ); TLV_SetFirstVisibleItem( first_visible_node ); TLV_SetFirstVisibleIndex( first_visible_index ); @@ -2554,6 +2559,15 @@ THREAD_RETURN handle_download_update( void *pArguments ) di->ssl_version != ai->ssl_version || di->method != ai->method ) { + if ( proxy_changed ) + { + if ( di->proxy_info != di->saved_proxy_info ) + { + FreeProxyInfo( &di->saved_proxy_info ); + } + di->saved_proxy_info = di->proxy_info; + } + // Swap values and free below. char *tmp_ptr = di->headers; di->headers = ai->utf8_headers; diff --git a/HTTP_Downloader/sftp.cpp b/HTTP_Downloader/sftp.cpp index 3596c06..e17e4e4 100644 --- a/HTTP_Downloader/sftp.cpp +++ b/HTTP_Downloader/sftp.cpp @@ -2757,6 +2757,7 @@ int dllrbt_compare_sftp_keys_host_info( void *a, void *b ) return ret; } + THREAD_RETURN handle_sftp_keys_host_list( void *pArguments ) { SFTP_KEYS_HOST_UPDATE_INFO *skhui = ( SFTP_KEYS_HOST_UPDATE_INFO * )pArguments; diff --git a/HTTP_Downloader/treelistview.cpp b/HTTP_Downloader/treelistview.cpp index 3300327..77f56dd 100644 --- a/HTTP_Downloader/treelistview.cpp +++ b/HTTP_Downloader/treelistview.cpp @@ -3210,6 +3210,14 @@ void CreateEditBox( HWND hWnd ) EditBoxProc = ( WNDPROC )_GetWindowLongPtrW( g_hWnd_edit_box, GWLP_WNDPROC ); _SetWindowLongPtrW( g_hWnd_edit_box, GWLP_WNDPROC, ( LONG_PTR )EditBoxSubProc ); +#ifdef ENABLE_DARK_MODE + if ( g_use_dark_mode ) + { + EnumChildProc( g_hWnd_edit_box, NULL ); + EnumTLWProc( hWnd, NULL ); + } +#endif + if ( g_base_selected_node != NULL && g_base_selected_node->data != NULL ) { DOWNLOAD_INFO *di = ( DOWNLOAD_INFO * )g_base_selected_node->data; @@ -3289,7 +3297,7 @@ void __DrawTextW( HDC hdc, int x, int y, UINT options, const RECT *lprect, LPCWS if ( size.cx > width ) { // Measure the size of our ellipsis. - if ( _GetTextExtentExPointW( hdc, L"...", 3, width, NULL, NULL, &e_size ) == TRUE ) + if ( _GetTextExtentExPointW( hdc, ELLIPSISW, ELLIPSISW_LENGTH, width, NULL, NULL, &e_size ) == TRUE ) { if ( e_size.cx > width ) { @@ -3383,7 +3391,7 @@ void __DrawTextW( HDC hdc, int x, int y, UINT options, const RECT *lprect, LPCWS rc.left = rc.right; rc.right += e_size.cx; - _ExtTextOutW( hdc, x + hpos + adj_size.cx, y + vpos, ETO_CLIPPED, &rc, L"...", 3, NULL ); + _ExtTextOutW( hdc, x + hpos + adj_size.cx, y + vpos, ETO_CLIPPED, &rc, ELLIPSISW, ELLIPSISW_LENGTH, NULL ); } } } diff --git a/HTTP_Downloader/version.txt b/HTTP_Downloader/version.txt index 536aedd..3842b72 100644 --- a/HTTP_Downloader/version.txt +++ b/HTTP_Downloader/version.txt @@ -1,4 +1,4 @@ -16778754 -https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.2/HTTP_Downloader_32.zip -16778754 -https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.2/HTTP_Downloader_64.zip +16778755 +https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.3/HTTP_Downloader_32.zip +16778755 +https://github.com/erickutcher/httpdownloader/releases/download/v1.0.6.3/HTTP_Downloader_64.zip diff --git a/HTTP_Downloader/wnd_proc_main.cpp b/HTTP_Downloader/wnd_proc_main.cpp index 6b29bc8..e4033fe 100644 --- a/HTTP_Downloader/wnd_proc_main.cpp +++ b/HTTP_Downloader/wnd_proc_main.cpp @@ -2247,17 +2247,11 @@ LRESULT CALLBACK MainWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam GlobalFree( di->auth_info.username ); GlobalFree( di->auth_info.password ); - if ( di->proxy_info != NULL ) + if ( di->proxy_info != di->saved_proxy_info ) { - GlobalFree( di->proxy_info->hostname ); - GlobalFree( di->proxy_info->punycode_hostname ); - GlobalFree( di->proxy_info->w_username ); - GlobalFree( di->proxy_info->w_password ); - GlobalFree( di->proxy_info->username ); - GlobalFree( di->proxy_info->password ); - GlobalFree( di->proxy_info->auth_key ); - GlobalFree( di->proxy_info ); + FreeProxyInfo( &di->saved_proxy_info ); } + FreeProxyInfo( &di->proxy_info ); while ( di->range_list != NULL ) { diff --git a/HTTP_Downloader/wnd_proc_options.cpp b/HTTP_Downloader/wnd_proc_options.cpp index 6eda5d4..16e1424 100644 --- a/HTTP_Downloader/wnd_proc_options.cpp +++ b/HTTP_Downloader/wnd_proc_options.cpp @@ -641,7 +641,7 @@ LRESULT CALLBACK TreeViewSubProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa LRESULT ret = _CallWindowProcW( TreeViewProc, hWnd, msg, wParam, lParam ); // Can't do SetFocus() here otherwise it focuses on the listview in the appearance tab instead of the window itself. - _PostMessageW( *( HWND * )tvi.lParam, WM_PROPAGATE, 0, 0 ); + _PostMessageW( hWnd_next, WM_PROPAGATE, 0, 0 ); return ret; } @@ -677,22 +677,22 @@ LRESULT CALLBACK OptionsWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar tvis.hParent = TVI_ROOT; tvis.hInsertAfter = TVI_FIRST; - HTREEITEM hti = ( HTREEITEM )_SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); + _SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); tvis.item.state = TVIS_EXPANDED; tvis.item.pszText = ST_V_Appearance; tvis.item.lParam = ( LPARAM )&g_hWnd_appearance_tab; - tvis.hParent = NULL; - tvis.hInsertAfter = hti; + tvis.hParent = TVI_ROOT; + tvis.hInsertAfter = TVI_LAST; - hti = ( HTREEITEM )_SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); + _SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); tvis.item.pszText = ST_V_Connection; tvis.item.lParam = ( LPARAM )&g_hWnd_connection_tab; - tvis.hParent = NULL; - tvis.hInsertAfter = hti; + tvis.hParent = TVI_ROOT; + tvis.hInsertAfter = TVI_LAST; HTREEITEM hti_connection = ( HTREEITEM )_SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); @@ -700,15 +700,15 @@ LRESULT CALLBACK OptionsWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar tvis.item.lParam = ( LPARAM )&g_hWnd_ftp_tab; tvis.hParent = hti_connection; - tvis.hInsertAfter = hti_connection; + tvis.hInsertAfter = TVI_LAST; - hti = ( HTREEITEM )_SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); + _SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); tvis.item.pszText = ST_V_SFTP; tvis.item.lParam = ( LPARAM )&g_hWnd_sftp_tab; tvis.hParent = hti_connection; - tvis.hInsertAfter = hti; + tvis.hInsertAfter = TVI_LAST; HTREEITEM hti_sftp = ( HTREEITEM )_SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); @@ -716,39 +716,39 @@ LRESULT CALLBACK OptionsWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar tvis.item.lParam = ( LPARAM )&g_hWnd_sftp_fps_tab; tvis.hParent = hti_sftp; - tvis.hInsertAfter = hti_sftp; + tvis.hInsertAfter = TVI_LAST; - hti = ( HTREEITEM )_SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); + _SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); tvis.item.pszText = ST_V_Private_Keys; tvis.item.lParam = ( LPARAM )&g_hWnd_sftp_keys_tab; tvis.hParent = hti_sftp; - tvis.hInsertAfter = hti; + tvis.hInsertAfter = TVI_LAST; - hti = ( HTREEITEM )_SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); + _SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); tvis.item.pszText = ST_V_Proxy; tvis.item.lParam = ( LPARAM )&g_hWnd_proxy_tab; tvis.hParent = hti_connection; - tvis.hInsertAfter = hti; + tvis.hInsertAfter = TVI_LAST; - hti = ( HTREEITEM )_SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); + _SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); tvis.item.pszText = ST_V_Server; tvis.item.lParam = ( LPARAM )&g_hWnd_web_server_tab; tvis.hParent = hti_connection; - tvis.hInsertAfter = hti; + tvis.hInsertAfter = TVI_LAST; - hti = ( HTREEITEM )_SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); + _SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); tvis.item.pszText = ST_V_Advanced; tvis.item.lParam = ( LPARAM )&g_hWnd_advanced_tab; - tvis.hParent = NULL; - tvis.hInsertAfter = hti; + tvis.hParent = TVI_ROOT; + tvis.hInsertAfter = TVI_LAST; _SendMessageW( g_hWnd_options_tree, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); diff --git a/HTTP_Downloader/wnd_proc_options_sftp.cpp b/HTTP_Downloader/wnd_proc_options_sftp.cpp index fb04ba2..b323abc 100644 --- a/HTTP_Downloader/wnd_proc_options_sftp.cpp +++ b/HTTP_Downloader/wnd_proc_options_sftp.cpp @@ -190,7 +190,7 @@ LRESULT CALLBACK SFTPTabWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE; tvis.item.stateMask = TVIS_EXPANDED | TVIS_STATEIMAGEMASK; tvis.hParent = TVI_ROOT; - tvis.hInsertAfter = TVI_FIRST; + tvis.hInsertAfter = TVI_LAST; for ( char i = 0; i < KEX_ALGORITHM_COUNT; ++i ) { g_priority_kex_algorithm[ i ] = cfg_priority_kex_algorithm[ i ]; @@ -198,12 +198,11 @@ LRESULT CALLBACK SFTPTabWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar tvis.item.state = TVIS_EXPANDED | INDEXTOSTATEIMAGEMASK( ( ( cfg_priority_kex_algorithm[ i ] & 0x40 ) ? 2 : 1 ) ); tvis.item.pszText = sftp_kex_string_table[ ( cfg_priority_kex_algorithm[ i ] & 0x3F ) - 1 ].value; tvis.item.lParam = ( LPARAM )cfg_priority_kex_algorithm[ i ]; - HTREEITEM hti = ( HTREEITEM )_SendMessageW( g_hWnd_sftp_kex_algorithm, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); - tvis.hInsertAfter = hti; + _SendMessageW( g_hWnd_sftp_kex_algorithm, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); } tvis.hParent = TVI_ROOT; - tvis.hInsertAfter = TVI_FIRST; + tvis.hInsertAfter = TVI_LAST; for ( char i = 0; i < HOST_KEY_COUNT; ++i ) { g_priority_host_key[ i ] = cfg_priority_host_key[ i ]; @@ -211,12 +210,11 @@ LRESULT CALLBACK SFTPTabWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar tvis.item.state = TVIS_EXPANDED | INDEXTOSTATEIMAGEMASK( ( ( cfg_priority_host_key[ i ] & 0x40 ) ? 2 : 1 ) ); tvis.item.pszText = sftp_hk_string_table[ ( cfg_priority_host_key[ i ] & 0x3F ) - 1 ].value; tvis.item.lParam = ( LPARAM )cfg_priority_host_key[ i ]; - HTREEITEM hti = ( HTREEITEM )_SendMessageW( g_hWnd_sftp_host_key, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); - tvis.hInsertAfter = hti; + _SendMessageW( g_hWnd_sftp_host_key, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); } tvis.hParent = TVI_ROOT; - tvis.hInsertAfter = TVI_FIRST; + tvis.hInsertAfter = TVI_LAST; for ( char i = 0; i < ENCRYPTION_CIPHER_COUNT; ++i ) { g_priority_encryption_cipher[ i ] = cfg_priority_encryption_cipher[ i ]; @@ -224,8 +222,7 @@ LRESULT CALLBACK SFTPTabWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar tvis.item.state = TVIS_EXPANDED | INDEXTOSTATEIMAGEMASK( ( ( cfg_priority_encryption_cipher[ i ] & 0x40 ) ? 2 : 1 ) ); tvis.item.pszText = sftp_ec_string_table[ ( cfg_priority_encryption_cipher[ i ] & 0x3F ) - 1 ].value; tvis.item.lParam = ( LPARAM )cfg_priority_encryption_cipher[ i ]; - HTREEITEM hti = ( HTREEITEM )_SendMessageW( g_hWnd_sftp_encryption_cipher, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); - tvis.hInsertAfter = hti; + _SendMessageW( g_hWnd_sftp_encryption_cipher, TVM_INSERTITEM, 0, ( LPARAM )&tvis ); } HWND hWnd_static_drag_order = _CreateWindowW( WC_STATIC, ST_V_Drag_items_to_reorder_priority, WS_CHILD | WS_VISIBLE, 11, 179, rc.right - 22, 15, hWnd, NULL, NULL, NULL ); diff --git a/HTTP_Downloader/wnd_proc_update_download.cpp b/HTTP_Downloader/wnd_proc_update_download.cpp index cf111bb..198a74f 100644 --- a/HTTP_Downloader/wnd_proc_update_download.cpp +++ b/HTTP_Downloader/wnd_proc_update_download.cpp @@ -1538,13 +1538,13 @@ LRESULT CALLBACK UpdateDownloadWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPAR // - if ( di->proxy_info != NULL ) + if ( di->saved_proxy_info != NULL ) { - if ( di->proxy_info->type != 0 ) + if ( di->saved_proxy_info->type != 0 ) { - _SendMessageW( g_hWnd_update_proxy_type, CB_SETCURSEL, di->proxy_info->type, 0 ); + _SendMessageW( g_hWnd_update_proxy_type, CB_SETCURSEL, di->saved_proxy_info->type, 0 ); - if ( di->proxy_info->address_type == 0 ) + if ( di->saved_proxy_info->address_type == 0 ) { _SendMessageW( g_hWnd_chk_update_type_ip_address_socks, BM_SETCHECK, BST_UNCHECKED, 0 ); _SendMessageW( g_hWnd_chk_update_type_hostname_socks, BM_SETCHECK, BST_CHECKED, 0 ); @@ -1555,39 +1555,39 @@ LRESULT CALLBACK UpdateDownloadWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPAR _SendMessageW( g_hWnd_chk_update_type_ip_address_socks, BM_SETCHECK, BST_CHECKED, 0 ); } - if ( di->proxy_info->address_type == 0 ) + if ( di->saved_proxy_info->address_type == 0 ) { - _SendMessageW( g_hWnd_update_hostname_socks, WM_SETTEXT, 0, ( LPARAM )di->proxy_info->hostname ); + _SendMessageW( g_hWnd_update_hostname_socks, WM_SETTEXT, 0, ( LPARAM )di->saved_proxy_info->hostname ); _SendMessageW( g_hWnd_update_ip_address_socks, IPM_SETADDRESS, 0, 2130706433 ); // 127.0.0.1 } else { _SendMessageW( g_hWnd_update_hostname_socks, WM_SETTEXT, 0, ( LPARAM )L"localhost" ); - _SendMessageW( g_hWnd_update_ip_address_socks, IPM_SETADDRESS, 0, ( LPARAM )di->proxy_info->ip_address ); + _SendMessageW( g_hWnd_update_ip_address_socks, IPM_SETADDRESS, 0, ( LPARAM )di->saved_proxy_info->ip_address ); } - __snprintf( value, 6, "%hu", di->proxy_info->port ); + __snprintf( value, 6, "%hu", di->saved_proxy_info->port ); _SendMessageA( g_hWnd_update_port_socks, WM_SETTEXT, 0, ( LPARAM )value ); - if ( di->proxy_info->type == 1 || di->proxy_info->type == 2 ) // HTTP and HTTPS + if ( di->saved_proxy_info->type == 1 || di->saved_proxy_info->type == 2 ) // HTTP and HTTPS { - _SendMessageW( g_hWnd_edit_update_proxy_auth_username, WM_SETTEXT, 0, ( LPARAM )di->proxy_info->w_username ); - _SendMessageW( g_hWnd_edit_update_proxy_auth_password, WM_SETTEXT, 0, ( LPARAM )di->proxy_info->w_password ); + _SendMessageW( g_hWnd_edit_update_proxy_auth_username, WM_SETTEXT, 0, ( LPARAM )di->saved_proxy_info->w_username ); + _SendMessageW( g_hWnd_edit_update_proxy_auth_password, WM_SETTEXT, 0, ( LPARAM )di->saved_proxy_info->w_password ); } - else if ( di->proxy_info->type == 3 ) // SOCKS v4 + else if ( di->saved_proxy_info->type == 3 ) // SOCKS v4 { - _SendMessageW( g_hWnd_update_auth_ident_username_socks, WM_SETTEXT, 0, ( LPARAM )di->proxy_info->w_username ); + _SendMessageW( g_hWnd_update_auth_ident_username_socks, WM_SETTEXT, 0, ( LPARAM )di->saved_proxy_info->w_username ); - _SendMessageW( g_hWnd_chk_update_resolve_domain_names_v4a, BM_SETCHECK, ( di->proxy_info->resolve_domain_names ? BST_CHECKED : BST_UNCHECKED ), 0 ); + _SendMessageW( g_hWnd_chk_update_resolve_domain_names_v4a, BM_SETCHECK, ( di->saved_proxy_info->resolve_domain_names ? BST_CHECKED : BST_UNCHECKED ), 0 ); } - else if ( di->proxy_info->type == 4 ) // SOCKS v5 + else if ( di->saved_proxy_info->type == 4 ) // SOCKS v5 { - _SendMessageW( g_hWnd_chk_update_use_authentication_socks, BM_SETCHECK, ( di->proxy_info->use_authentication ? BST_CHECKED : BST_UNCHECKED ), 0 ); + _SendMessageW( g_hWnd_chk_update_use_authentication_socks, BM_SETCHECK, ( di->saved_proxy_info->use_authentication ? BST_CHECKED : BST_UNCHECKED ), 0 ); - if ( di->proxy_info->use_authentication ) + if ( di->saved_proxy_info->use_authentication ) { - _SendMessageW( g_hWnd_update_auth_username_socks, WM_SETTEXT, 0, ( LPARAM )di->proxy_info->w_username ); - _SendMessageW( g_hWnd_update_auth_password_socks, WM_SETTEXT, 0, ( LPARAM )di->proxy_info->w_password ); + _SendMessageW( g_hWnd_update_auth_username_socks, WM_SETTEXT, 0, ( LPARAM )di->saved_proxy_info->w_username ); + _SendMessageW( g_hWnd_update_auth_password_socks, WM_SETTEXT, 0, ( LPARAM )di->saved_proxy_info->w_password ); enable = ( is_group ? FALSE : TRUE ); } @@ -1601,13 +1601,13 @@ LRESULT CALLBACK UpdateDownloadWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPAR _EnableWindow( g_hWnd_static_update_auth_password_socks, enable ); _EnableWindow( g_hWnd_update_auth_password_socks, enable ); - _SendMessageW( g_hWnd_chk_update_resolve_domain_names, BM_SETCHECK, ( di->proxy_info->resolve_domain_names ? BST_CHECKED : BST_UNCHECKED ), 0 ); + _SendMessageW( g_hWnd_chk_update_resolve_domain_names, BM_SETCHECK, ( di->saved_proxy_info->resolve_domain_names ? BST_CHECKED : BST_UNCHECKED ), 0 ); } } if ( _SendMessageW( g_hWnd_update_tab, TCM_GETCURSEL, 0, 0 ) == 4 ) { - ShowHideUpdateProxyWindows( di->proxy_info->type ); + ShowHideUpdateProxyWindows( di->saved_proxy_info->type ); } } else