リストビュー用の関数

  項目の数



commctrl.h をインクルードする必要があります

  
int ListView_GetColumnCount( HWND hWnd )
{
	int i;
	LV_COLUMN test;

	ZeroMemory( &test, sizeof( LV_COLUMN ) );
	test.mask = LVCF_FMT;

	i = 0;
	while( 1 ) {
		if ( !ListView_GetColumn( hWnd, i, &test ) ) {
			break;
		}
		i++;
		if ( i > 100 ) {
			break;
		}
	}
	return i;
}
  



  タイトルの追加



  
void ListView_AddTitle( HWND hWnd, int Fmt, int Width, LPSTR Title )
{
	int Cols;
	LV_COLUMN title;

	Cols = ListView_GetColumnCount( hWnd );
	ZeroMemory( &title, sizeof( LV_COLUMN ) );
	title.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;

	title.fmt = Fmt;
	title.cx = Width;
	title.pszText = Title;
	ListView_InsertColumn(hWnd, Cols, &title);

}
  



  行追加

  
int ListView_AddRow( HWND hWnd )
{
	int nRows;
	LV_ITEM row;

	nRows = ListView_GetItemCount( hWnd );

	ZeroMemory( &row, sizeof( LV_ITEM ) );
	row.mask		= LVIF_TEXT;
	row.pszText		= "";
	row.iItem		= nRows;
	ListView_InsertItem( hWnd, &row );
	return nRows;

}
  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ