刚才没说清楚,再问一次
我用下面的代码好像不行
long styleValue = GetWindowLong(hList, GWL_STYLE);
styleValue &= (~LBS_SORT);
SetWindowLong(hList, GWL_STYLE, styleValue);
RECT rc;
GetClientRect(hList, &rc);
// make set take effect
SetWindowPos(hList, HWND_TOP, rc.left, rc.top, rc.right, rc.bottom, SWP_FRAMECHANGED); // disable controls
EnableWindow(hList, FALSE);不使用CListBox
做过的人请举手,谢谢
我用下面的代码好像不行
long styleValue = GetWindowLong(hList, GWL_STYLE);
styleValue &= (~LBS_SORT);
SetWindowLong(hList, GWL_STYLE, styleValue);
RECT rc;
GetClientRect(hList, &rc);
// make set take effect
SetWindowPos(hList, HWND_TOP, rc.left, rc.top, rc.right, rc.bottom, SWP_FRAMECHANGED); // disable controls
EnableWindow(hList, FALSE);不使用CListBox
做过的人请举手,谢谢
LRESULT APIENTRY EditBoxProc(
HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
HWND hwndEdit;
switch(uMsg)
{
case WM_INITDIALOG:
// Retrieve the handle to the edit control.
hwndEdit = GetDlgItem(hwndDlg, ID_EDIT);
// Subclass the edit control.
wpOrigEditProc = (WNDPROC) SetWindowLong(hwndEdit,
GWL_WNDPROC, (LONG) EditSubclassProc);
//
// Continue the initialization procedure.
//
return TRUE;
case WM_DESTROY:
// Remove the subclass from the edit control.
SetWindowLong(hwndEdit, GWL_WNDPROC,
(LONG) wpOrigEditProc);
//
// Continue the cleanup procedure.
//
break;
}
return FALSE;
UNREFERENCED_PARAMETER(lParam);
}
// Subclass procedure
LRESULT APIENTRY EditSubclassProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
if (uMsg == WM_GETDLGCODE)
return DLGC_WANTALLKEYS;
return CallWindowProc(wpOrigEditProc, hwnd, uMsg,
wParam, lParam);
}
祝楼主成功
^_^
看来暂时只有recreate了,要是有什么好办法都贴出来啊。