-
-
API: List view 设置图片列表[求助]
-
发表于:
2006-3-18 16:35
6506
-
API: List view 设置图片列表[求助]
下面是API写的代码, 可是出现代号为6的错误, 查询为句柄无效。哪个地方写错了?各位大侠帮忙.
创建图片列表, 并添加三个图标, 然后设置List view 的图片列表.
HIMAGELIST himagelist;
himagelist=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON) ,ILC_MASK,0,3);
if(himagelist==NULL)
{
wsprintf(sz,TEXT("创建imagelist失败,错误号: %d "),GetLastError());
MessageBox(hwnd,sz,TEXT("Error"),MB_OK);
}
ImageList_AddIcon(himagelist,LoadIcon(hinstance,MAKEINTRESOURCE(IDI_MAIL)));
ImageList_AddIcon(himagelist,LoadIcon(hinstance,MAKEINTRESOURCE(IDI_FOLDER)));
ImageList_AddIcon(himagelist,LoadIcon(hinstance,MAKEINTRESOURCE(IDI_USER)));
if(ListView_SetImageList(hwnduser, himagelist, LVSIL_SMALL)==NULL)
{
char sz[100];
wsprintf(sz,"error %d",GetLastError());
MessageBox(hwnd,sz,"test",0);
}
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课