i have a few contols(edit, listbox, 2buttons, and a few statics for output) that i create at runtime and size myself.
when you resize the window it just doesnt look right.
anyone have any good tips/tricks for doing this?
here is some code;
Code:case WM_SIZE: { HWND hEdit = GetDlgItem(hWnd, IDC_MAIN_OUTPUT); HWND hList = GetDlgItem(hWnd, IDC_MAIN_LIST); HWND hStatic = GetDlgItem(hWnd, IDC_STATIC); HWND hS_FILENAME = GetDlgItem(hWnd, IDC_MAIN_S_FILENAME); HWND hS_FILELEN = GetDlgItem(hWnd, IDC_MAIN_S_FILELEN); RECT rcClient; GetClientRect(hWnd, &rcClient); //main edit SetWindowPos(hEdit, NULL, 0, 0, rcClient.right, rcClient.bottom/4, SWP_NOZORDER); //main listbox ... acts like its stuck when its being resized. SetWindowPos(hList, NULL, rcClient.right - (rcClient.right/3), // x rcClient.bottom/4, // y rcClient.right/3, //length rcClient.bottom - (rcClient.bottom/4),//height SWP_NOZORDER); //main static .. can't even get it to move where i want it SetWindowPos(hStatic, NULL, 0, // x rcClient.bottom/4, // y 2*(rcClient.right/3),//length rcClient.bottom - (rcClient.bottom/4),//height SWP_NOZORDER); //file name ... works fine SetWindowPos(hS_FILENAME, NULL, 5, // x rcClient.bottom/4 + 5, // y 300, //length 20, //height SWP_NOZORDER); //file length ... works fine SetWindowPos(hS_FILELEN, NULL, 5, rcClient.bottom/4 + 30, 300, 20, SWP_NOZORDER); } /* TODO add buttons */ break;



LinkBack URL
About LinkBacks


