I guess this is the right code to achieve the goal:
Now, I'd like to avoid the window from resizing less the x300, y250 like it has some min width and minheight values....do you think that is possible?Code:int dlgw = 0; int dlgh = 0; TCHAR szWidth[5] = {0}; TCHAR szHeight[5] = {0}; TCHAR marameo[256] = {0}; HWND hListView = GetDlgItem(hDlg, IDC_LIST1); case WM_SIZE: // // WM_SIZE Notification // http://msdn.microsoft.com/en-us/library/ms632646%28VS.85%29.aspx // // Resize List view inside window // dlgw = (int)LOWORD(lParam); dlgh = (int)HIWORD(lParam); _itot_s(dlgw,szWidth,5,10); _itot_s(dlgh,szHeight,5,10); _tcsncat_s(marameo, _T("Width: "),10); _tcsncat_s(marameo, szWidth,5); _tcsncat_s(marameo, _T(" Height: "),10); _tcsncat_s(marameo, szHeight,5); SetWindowText(hDlg, (LPTSTR)marameo); MoveWindow(hListView, -1, -1, (dlgw + 2), (dlgh -25) , true); ShowWindow(hListView, SW_SHOW); ///////////////////////////////////////////////////////////////////// break;
thanks




Reply With Quote