From 54087a045e58085b9cb4ceb322a19de90b0bb4ba Mon Sep 17 00:00:00 2001 From: kichik Date: Mon, 8 Dec 2003 22:30:27 +0000 Subject: [PATCH] Around 20 bytes down git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3263 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index e625c197..70a86db4 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -1466,13 +1466,17 @@ static DWORD WINAPI install_thread(LPVOID p) } #ifdef NSIS_CONFIG_VISIBLE_SUPPORT + +// listview unfolds partly hidden labels if it does not have infotip text +#define LVS_EX_LABELTIP 0x00004000 + static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { HWND linsthwnd=insthwnd; if (uMsg == WM_INITDIALOG) { RECT r; - LVCOLUMN lvc = {0, 0, -1, 0, 0, -1}; + LVCOLUMN lvc = {LVCF_WIDTH, 0, -1, 0, 0, -1}; int lb_bg=g_header->lb_bg,lb_fg=g_header->lb_fg; int x=num_sections; @@ -1490,10 +1494,10 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa progress_bar_len+=g_sections[x].code_size; } + GetClientRect(linsthwnd, &r); + lvc.cx = r.right - GetSystemMetrics(SM_CXHSCROLL); ListView_InsertColumn(linsthwnd, 0, &lvc); - GetClientRect(linsthwnd,&r); - ListView_SetColumnWidth(linsthwnd, 0, r.right-r.left-GetSystemMetrics(SM_CXHSCROLL)); -#define LVS_EX_LABELTIP 0x00004000 // listview unfolds partly hidden labels if it does not have infotip text + ListView_SetExtendedListViewStyleEx(linsthwnd, LVS_EX_LABELTIP, LVS_EX_LABELTIP); if (lb_bg >= 0) { ListView_SetBkColor(linsthwnd, lb_bg); @@ -1588,8 +1592,11 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa //endPtr = ptr+total-2; // -2 to allow for CR/LF i = 0; do { - ListView_GetItemText(linsthwnd,i,0,ptr,total); - while (*ptr) ptr++; + item.pszText = ptr; + item.cchTextMax = total; + SendMessage(linsthwnd,LVM_GETITEMTEXT,i,(LPARAM)&item); + //while (*ptr) ptr++; + ptr += mystrlen(ptr); *(WORD*)ptr = CHAR2_TO_WORD('\r','\n'); ptr+=2; } while (++i < count);