none
C\C++设置桌面属性 RRS feed

答案

  • HWND hWnd = ::FindWindow(_T("Progman"), NULL);
    	if(NULL == hWnd)
    	{
    		return ;
    	}
    	hWnd = ::FindWindowEx(hWnd, NULL, _T("SHELLDLL_DefView"), NULL);
    	if(NULL == hWnd)
    	{
    		return ;
    	}
    	hWnd = ::FindWindowEx(hWnd, NULL, _T("SysListView32"), NULL);
    	if(NULL != hWnd)
    	{
    		::SetWindowLong(hWnd, GWL_STYLE, ::GetWindowLong(hWnd, GWL_STYLE) | LVS_AUTOARRANGE);
    	}

    或者使用ListView_SetItemPosition() 设置到指定的位置。

    Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.

    2012年11月6日 9:47
    版主