-
Notifications
You must be signed in to change notification settings - Fork 29
/
ComboBox_Ex.cpp
57 lines (42 loc) · 1.11 KB
/
ComboBox_Ex.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
Free Download Manager Copyright (c) 2003-2016 FreeDownloadManager.ORG
*/
#include "stdafx.h"
#include "FdmApp.h"
#include "ComboBox_Ex.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CComboBox_Ex::CComboBox_Ex()
{
}
CComboBox_Ex::~CComboBox_Ex()
{
}
BEGIN_MESSAGE_MAP(CComboBox_Ex, CComboBox)
//{{AFX_MSG_MAP(CComboBox_Ex)
ON_MESSAGE (CB_GETDROPPEDSTATE, OnGetDroppedState)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CComboBox_Ex::Create(CWnd *pParent)
{
CRect rc (0, 0, 100, 100);
CComboBox::Create (WS_CHILD|WS_VISIBLE|CBS_AUTOHSCROLL|CBS_DROPDOWN|WS_VSCROLL,
rc, pParent, 0x67909);
m_font.CreateFont (15, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, _T("MS Sans Serif"));
SetFont (&m_font);
return TRUE;
}
void CComboBox_Ex::SetReturnID(UINT nID)
{
m_uReturnID = nID;
}
LRESULT CComboBox_Ex::OnGetDroppedState(WPARAM, LPARAM)
{
LRESULT lRes = DefWindowProc (CB_GETDROPPEDSTATE, 0, 0);
if (lRes == FALSE)
GetParent ()->PostMessage (WM_COMMAND, m_uReturnID, 0);
return lRes;
}