SHARE
TWEET

Untitled

a guest Aug 20th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. HWND hwndList1 = CreateWindow(WC_LISTVIEW , L"" ,  WS_VISIBLE | WS_CHILD | LVS_REPORT | WS_BORDER  |  WS_VSCROLL | LVS_OWNERDRAWFIXED , 10 , 10 , width , height, hwnd, NULL, GetModuleHandle(NULL), 0);
  2.  CreateItem(hwndList1 , "My item");
  3.      
  4. int CreateItem(HWND hwndList, char*  Text)
  5. {
  6.   LVITEM lvi = {0};
  7.  
  8.   lvi.mask = LVIF_TEXT | LVCF_FMT | LVCFMT_LEFT;
  9.   lvi.pszText = (LPWSTR)Text;
  10.  
  11. return ListView_InsertItem(hwndList, &lvi);
  12. }
  13.  
  14.  
  15. LRESULT CALLBACK WndProc( HWND hwnd , UINT msg , WPARAM wParam , LPARAM lParam)
  16. {
  17. switch(msg){
  18.  
  19.  
  20.   case WM_DRAWITEM:{ //I dont know what to do
  21.      }
  22.      break;
  23.  
  24.   case WM_MEASUREITEM:{
  25.             MEASUREITEMSTRUCT* m= (MEASUREITEMSTRUCT*) lParam;
  26.             m->itemHeight=25;
  27.             }
  28.             break;
  29.  
  30.   case WM_CLOSE:
  31.     DestroyWindow( hwnd );
  32.     break;
  33.  
  34.   case WM_DESTROY:
  35.     PostQuitMessage(0);
  36.     break;
  37.  
  38.   default:
  39.     return DefWindowProc( hwnd , msg , wParam , lParam );
  40.  }
  41. return 0;
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top