smartphone List View 使用日志(转载)
来源:互联网 发布:nginx 全局 header 编辑:程序博客网 时间:2024/05/20 23:30
建立一个 List View 控件
// Create ListView
hwndRet = CreateWindow (WC_LISTVIEW, NULL,
WS_CHILD |
WS_VISIBLE |
LVS_REPORT |
/*LVS_OWNERDATA | */ // 说明 1
LVS_NOCOLUMNHEADER,
0,
0,
mainRect.right - mainRect.left,
mainRect.bottom - mainRect.top,
hwndPrnt,
(HMENU)ID_LISTVIEW, // 控件 ID
g_hInst, 0);
说明1: 如果建立 ListView 时加上LVS_OWNERDATA 标致, 系统就不会画出由 ListView_InsertItem 插入的内容, 程序员要自己在 WM_NOTIFY 处处理. 以下是例子:
case WM_NOTIFY:
if (ID_LISTVIEW == wParam)
return OnListViewNotify(hWnd, lParam);
break;
LRESULT OnListViewNotify(HWND hwnd, LPARAM lParam)
{
NMHDR* pnmh = (NMHDR*) lParam;
LRESULT lResult = 0;
switch(pnmh->code)
{
case LVN_GETDISPINFO:
{
LV_DISPINFO* pdi = (LV_DISPINFO*)lParam;
if(0 == pdi->item.iSubItem)
{
if(pdi->item.mask & LVIF_TEXT)
{
wcscpy(pdi->item.pszText, L"1213213421");
pdi->item.cchTextMax = wcslen(pdi->item.pszText);
pdi->item.iItem;
}
if(pdi->item.mask & LVIF_IMAGE)
{
pdi->item.iImage = 0;
}
}
else
{
if(pdi->item.mask & LVIF_TEXT)
{
pdi->item.pszText;
pdi->item.cchTextMax;
pdi->item.iItem;
pdi->item.iSubItem;
}
}
}
break;
case LVN_ITEMACTIVATE:
break;
// Handle this notify if you want to use the number keys to select
// items in the view (like how the desktop file explorer lets you
// select files by typing the first few characters of the file name.)
// This notify is also used then the control is sent an LVM_FINDITEM
case LVN_ODFINDITEM:
{
NMLVFINDITEM* pFindItem = (NMLVFINDITEM*)lParam;
// Used if you are trying to find an item in the list view
}
break;
}
return(lResult);
}
否则相反系统不会发送 WM_NOTIFY 事件. 并会自动画出由 ListView_InsertItem 添加的内容.
- smartphone List View 使用日志(转载)
- smartphone list样式菜单
- 驱动程序中使用event view记录日志
- Win32ASM使用List-View控件的问题
- 使用Log4j记录系统日志(转载)
- 转载:使用Windows Live Writer发布日志
- 转载:使用Windows Live Writer发布日志
- 使用Windows Live Writer发布日志(转载)
- 转载:使用Windows Live Writer发布日志
- 转载:使用Windows Live Writer发布日志
- C# 使用TraceSource记录程序日志(转载)
- list view
- List View
- List View
- 使用.NET CF开发Smartphone应用程序 FAQ
- 使用C#开发SmartPhone程序入门
- 使用C#开发SmartPhone程序入门1
- 使用smartphone模拟器测试短信应用程序
- FormIE.cs
- BI入门经典
- Linux下如何查看系统启动时间和运行时间
- Zen Cart后台订单中显示产品图片
- CodeBlock編译boost thread程序
- smartphone List View 使用日志(转载)
- 制作绿色MyEclipseO(∩_∩)O~
- MYSQL语句
- 隐藏和显示按钮控件。
- fedora12 GUI root 登陆方法
- 关于快速提高网站排名的26步
- [Note]Spring MVC、hibernate validator和i18n(一)
- 饮水思源
- 无线路由器接入局域网的三种方式