设置桌面图标坐标

 
void SetIconPosition(int x,int y,int num)
{
HWND hwndParent=::FindWindow(_T("Progman"),NULL);
HWND hwndSHELLDLL_DefView=::FindWindowEx(hwndParent,NULL,_T("SHELLDLL_DefView"),NULL);
HWND hwndSysListView32=::FindWindowEx(hwndSHELLDLL_DefView,NULL,_T("SysListView32"),_T("FolderView"));

::SendMessage(hwndSysListView32,LVM_SETITEMPOSITION,num,MAKELPARAM(x,y));
ListView_RedrawItems(hwndSysListView32, 0, ListView_GetItemCount(hwndSysListView32)-1);
::UpdateWindow(hwndSysListView32);
}
http://blog.sina.com.cn/s/blog_464689a10100hnps.html

你可能感兴趣的:(VC/MFC)