반응형

Windows Message – Control 제어

[ Edit ]

글자수 제한하기

SendMessage( hWnd, EM_SETLIMITTEXT, iLimit, 0 );

 

[ Button ]

이미지 입히기

SendMessage( hWnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap);

 

[ CheckBox ]

체크/언체크

SendMessage( hWnd, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0 );

상태얻기

if ( SendMessage(hWnd, BM_GETCHECK,0,0) == BST_CHECKED )

 

[ Radio ]

체크/언체크

BOOL CheckRadioButton( HWND hDlg, int nIDFirstButton, int nIDLastButton,

int nIDCheckButton);

상태얻기

if ( SendMessage(hWnd, BM_GETCHECK,0,0) == BST_CHECKED )

 

[ ComboBox ]

스트링추가

SendMessage(hCombo, CB_ADDSTRING, 0, [String]);

Get Current idx

int iComboIdx = SendMessage( hCombo, CB_GETCURSEL, 0, 0);

Set Select idx

SendMessage( hCombo, CB_SETCURSEL, [Index], 0);

 

[ ListView ]

특정 raw로 자동스크롤

ListView_EnsureVisible( hList, idx, FALSE);

 

[ TreeView ]

Get Root Item

HTREEITEM TreeView_GetRoot( HWND );

Get Nex Item

TreeView_GetNextItem( HWND, HTREEITEM, TVGN_NEXT );

Set Check

TreeView_SetCheckState( HWND , HTREEITEM, BOOL);

 

[ Spin Control ]

Range 설정

SendMessage( hWnd, UDM_SETRANGE, [Min], [Max] );

Buddy 설정

SendMessage( hWnd, UDM_SETBUDDY, [Buddy Edit Hwnd], 0 );

 

[ Tab Control ]

Tab 추가

TCITEM tie;
tie.mask =
TCIF_TEXT | TCIF_IMAGE
;
tie.iImage = -1;
tie.pszText =
“String Ex”
;
TabCtrl_InsertItem( hWnd, 0, &tie );

 

반응형

+ Recent posts