リストボックスのプロパティで文字列アリにチェックする( LBS_HASSTRINGSを)
オーナードローを可変にする。
このままではリストにモジが表示されないので、
コード:
Type DRAWITEMSTRUCT
CtlType As DWord
CtlID As DWord
itemID As DWord
itemAction As DWord
itemState As DWord
hwndItem As HWND
hDC As HDC
rcItem As RECT
itemData As DWord
End Type
構造体を定義しておきWM_DRAWITEMメッセージを処理する
コード:
Function MainWndProc(hWnd As HWND, dwMsg As DWord, wParam As WPARAM, lParam As LPARAM) As DWord
' TODO: この位置にウィンドウメッセージを処理するためのコードを記述します。
Dim dis As *DRAWITEMSTRUCT
Dim sItem[100] As Byte
If dwMsg = WM_DRAWITEM Then
dis = lParam
SendMessage(dis->hwndItem, LB_GETTEXT, dis->itemID, sItem)
DrawText(dis->hDC, sItem, -1, dis->rcItem, DT_LEFT)
End If
' イベントプロシージャの呼び出しを行います。
MainWndProc=EventCall_MainWnd(hWnd,dwMsg,wParam,lParam)
End Function