GUI/컨트롤
-
GUI 제어 2 - WindowsGUI/컨트롤 2009. 5. 19. 18:54
메뉴 WM_COMMAND에서 validation을 한다. 액셀러레이터 툴바 6개의 표준 컨트롤 95이후에 추가된 공통 컨트롤 ActiveX 컨트롤 스타일 메시지 통지 메시지 서브클래싱 차일드 컨트롤 ID 추가 리소스 뷰 dialog > 오른 클릭 > Resource Symbols > New... CreateWindow() DestroyWindow() GetDlgCtrlID() hMenu GetWindowLong()/SetWindowLong() GWL_ID GetWindowText() WM_GETTEXT SetWindowText() WM_SETTEXT GetDlgItem() GetDlgItemText() SetDlgItemText() 정수인 경우 GetDlgItemInt() SetDlgItemInt() W..
-
슬라이더(트랙바) 컨트롤 - Win32GUI/컨트롤 2009. 5. 18. 17:38
TBM_SETRANGE TBM_SETPOS TBM_GETPOS WM_HSCROLL TB_THUMBTRACK TB_ENDTRACK void InitSlider(HWND hwnd) { // Initialize the trackbar range, but disable the // control until the user opens a file. hScroll = GetDlgItem(hwnd, IDC_SLIDER1); SendMessage(hScroll, TBM_SETRANGE, TRUE, MAKELONG(0, 100)); } SendMessage( hScroll, TBM_SETPOS, TRUE, sliderTick ); static BOOL bStartOfScroll = TRUE; case WM_HSCROLL..
-
버튼 컨트롤 - Win32GUI/컨트롤 2009. 5. 16. 16:25
BN_CLICKED 푸시 버튼 BS_PUSHBUTTON BS_FLAT 체크 박스 라디오 버튼 CheckRadioButton() IsDlgButtonChecked() 그룹 박스 WM_CTLCOLORBTN 푸시 버튼은 오너 드로우 버튼으로 LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { ... switch (message) { // { case WM_CREATE: CreateWindow("button", "...", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 10, 50, 100, 25, hWnd, (HMENU)ID_BTN_COPY, g_hInst, NULL); break; // } case..
-
쉘 파일 Drag & Drop - Win32GUI/컨트롤 2009. 5. 13. 21:24
DragAcceptFiles() DragQueryFile() DragFinish() WM_DROPFILES class CTry01Dlg : public CDialog { ... // Generated message map functions //{{AFX_MSG(CTry01Dlg) ... afx_msg void OnDropFiles(HDROP hDropInfo); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; BEGIN_MESSAGE_MAP(CTry01Dlg, CDialog) //{{AFX_MSG_MAP(CTry01Dlg) ... ON_WM_DROPFILES() //}}AFX_MSG_MAP END_MESSAGE_MAP() ... BOOL CTry01Dlg::OnInitDialog() {..
-
날짜/시간 선택(date and time picker; DTP) 컨트롤 - MFCGUI/컨트롤 2009. 4. 6. 17:06
CDateTimeCtrl on DTN_DATETIMECHANGE .GetTime() .SetTime() class CDateTimeDlg : public CDialog { // Construction public: CDateTimeDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CDateTimeDlg) enum { IDD = IDD_DATETIME_DIALOG }; COleDateTime m_Date1; .. //}}AFX_DATA .. // Generated message map functions //{{AFX_MSG(CDateTimeDlg) virtual BOOL OnInitDialog(); afx_msg v..
-
IP 주소 컨트롤 - MFCGUI/컨트롤 2009. 4. 6. 17:00
CIPAddressCtrl .GetAddress() class CIPAddressDlg : public CDialog { // Construction public: CIPAddressDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CIPAddressDlg) enum { IDD = IDD_IPADDRESS_DIALOG }; CIPAddressCtrl m_ctrlIPAddress; //}}AFX_DATA .. }; void CIPAddressDlg::OnConnect() { BYTE nField0, nFiled1, nField2, nField3; m_ctrlIPAddress.GetAddress(nField0, nFi..
-
스핀 컨트롤 - MFCGUI/컨트롤 2009. 4. 6. 16:53
Edit 컨트롤 Spin 컨트롤 .[Auto Buddy] .[Set Buddy Integer] CSpinButtonCtrl on UDN_DELTAPOS .SetRange() class CPractice9_2Dlg : public CDialog { ... // Dialog Data //{{AFX_DATA(CPractice9_2Dlg) ... int m_nData; //}}AFX_DATA ... // Generated message map functions //{{AFX_MSG(CPractice9_2Dlg) ... afx_msg void OnDeltaposSpinData(NMHDR* pNMHDR, LRESULT* pResult); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; CPract..
-
슬라이더(트랙바) 컨트롤 - MFCGUI/컨트롤 2009. 4. 5. 00:04
CSliderCtrl ON_WM_HSCROLL TB_THUMBTRACK TB_ENDTRACK on NM_RELEASEDCAPTURE .SetRange() .SetPos() .GetPos() class CPractice9_1Dlg : public CDialog { // { void HandleSeekbar(UINT nSBCode); ... // } // Construction public: CAudioboxDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CPractice9_1Dlg) enum { IDD = IDD_PRACTICE9_1_DIALOG }; CSliderCtrl m_sliderBlue; ... //}}A..