Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.76 KB | None | 0 0
  1. #include "Memory Scanner.h"
  2.  
  3. void CreateListViewColumns( HWND hwndDlg, int nIDDlgItem, TCHAR* arrNames[], int arrColLens[], int nNumCols ) {
  4.   LVCOLUMN lvc          = {0};
  5.   HWND     hwndListView = GetDlgItem( hwndDlg, nIDDlgItem );
  6.   DWORD    dwStyle      = SendMessage( hwndListView, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0 );
  7.   SendMessage( hwndListView, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle | LVS_EX_FULLROWSELECT );
  8.  
  9.   lvc.fmt  = LVCFMT_LEFT;
  10.   lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
  11.  
  12.   for( int i = 0; i < nNumCols; i++ ) {
  13.     lvc.pszText = arrNames[i];
  14.     lvc.cx      = arrColLens[i];
  15.     ListView_InsertColumn( hwndListView, i, &lvc );
  16.   }
  17.  
  18.   ListView_SetColumnWidth( hwndListView, nNumCols - 1, LVSCW_AUTOSIZE_USEHEADER );
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement