這樣寫CreateWindowEx為什麼會錯...都顯示不出來 |
缺席
|
forverlove5202
一般會員 ![]() ![]() 發表:5 回覆:10 積分:3 註冊:2008-03-04 發送簡訊給我 |
case WM_COMMAND:
switch (LOWORD(wParam)) { case IDM_Demo: hList = CreateWindowEx(WS_EX_CLIENTEDGE,WC_LISTVIEW,"", WS_CHILD | LVS_REPORT | WS_VISIBLE, 0,0,0,0,hWnd,(HMENU)101,hInst,NULL); if (hList) { LV_COLUMN col; col.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 160; col.pszText = "檔案名稱"; col.iSubItem = 0; ListView_InsertColumn(hList,0,&col); col.cx = 160; col.pszText = "檔案日期"; col.iSubItem = 1; ListView_InsertColumn(hList,1,&col); col.cx = 160; col.pszText = "檔案大小"; col.iSubItem = 2; ListView_InsertColumn(hList,2,&col); } return(0); } break; |
forverlove5202
一般會員 ![]() ![]() 發表:5 回覆:10 積分:3 註冊:2008-03-04 發送簡訊給我 |
case WM_SIZE:
if (wParam != SIZE_MINIMIZED) MoveWindow(hList,0,0,LOWORD(lParam),HIWORD(lParam),TRUE); return(0); case WM_PAINT: hDC = BeginPaint(hWnd,&ps); EndPaint(hWnd,&ps); return(0); case WM_COMMAND: switch (LOWORD(wParam)) { case IDM_Demo: hList = CreateWindowEx(WS_EX_CLIENTEDGE,WC_LISTVIEW,"", WS_CHILD | LVS_REPORT | WS_VISIBLE, 0,0,0,0,hWnd,(HMENU)101,hInst,NULL); if (hList) { LV_COLUMN col; col.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 160; col.pszText = "檔案名稱"; col.iSubItem = 0; ListView_InsertColumn(hList,0,&col); col.cx = 160; col.pszText = "檔案日期"; col.iSubItem = 1; ListView_InsertColumn(hList,1,&col); col.cx = 160; col.pszText = "檔案大小"; col.iSubItem = 2; ListView_InsertColumn(hList,2,&col); } return(0); } break; 為什麼會被擋掉?其實是有顯示的只是好像被重繪了.....所以畫面還是空白 不知有什麼方法可以解決~ |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |