Skip to content

Commit

Permalink
Up to 1.0.2
Browse files Browse the repository at this point in the history
* Fix filters bug
* Detect string in ini
  • Loading branch information
little-brother committed Nov 28, 2022
1 parent 1575c5d commit 3764607
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#define MAX_LENGTH 4096
#define MAX_COLUMN_LENGTH 2000
#define APP_NAME TEXT("xmltab")
#define APP_VERSION TEXT("1.0.1")
#define APP_VERSION TEXT("1.0.2")
#define LOADING TEXT("Loading...")
#define WHITESPACE " \t\r\n"

Expand Down Expand Up @@ -141,7 +141,11 @@ BOOL APIENTRY DllMain (HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
}

void __stdcall ListGetDetectString(char* DetectString, int maxlen) {
snprintf(DetectString, maxlen, "MULTIMEDIA & ext=\"XML\"");
TCHAR* detectString16 = getStoredString(TEXT("detect-string"), TEXT("MULTIMEDIA & ext=\"XML\""));
char* detectString8 = utf16to8(detectString16);
snprintf(DetectString, maxlen, detectString8);
free(detectString16);
free(detectString8);
}

void __stdcall ListSetDefaultParams(ListDefaultParamStruct* dps) {
Expand Down Expand Up @@ -1733,15 +1737,13 @@ LRESULT CALLBACK cbNewMain(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
for (int colNo = 0; colNo < colCount; colNo++)
ShowWindow(GetDlgItem(hHeader, IDC_HEADER_EDIT + colNo), isFilterRow ? SW_SHOW : SW_HIDE);

// Bug fix: force Windows to redraw header
int w = ListView_GetColumnWidth(hGridWnd, 0);
ListView_SetColumnWidth(hGridWnd, 0, w + 1);
ListView_SetColumnWidth(hGridWnd, 0, w);

if (isFilterRow)
SendMessage(hWnd, WMU_UPDATE_FILTER_SIZE, 0, 0);

// Bug fix: force Windows to redraw header
if (IsWindowVisible(hGridWnd)) { // Win10x64, TCx32
int w = ListView_GetColumnWidth(hGridWnd, 0);
ListView_SetColumnWidth(hGridWnd, 0, w + 1);
ListView_SetColumnWidth(hGridWnd, 0, w);
}

SendMessage(hWnd, WM_SETREDRAW, TRUE, 0);
InvalidateRect(hWnd, NULL, TRUE);
Expand Down

0 comments on commit 3764607

Please sign in to comment.