大约有 30,000 项符合查询结果(耗时:0.0187秒) [XML]
CDC:DrawText 多行显示文本(文本自动换行) - C/C++ - 清泛网 - 专注C/C++及内核技术
... // text length
LPRECT lpRect, // formatting dimensions
UINT uFormat // text-drawing options
);
参数:
hdc:设备环境句柄。
lpString:指向将被写入的字符串的指针,如果参数nCount是C1,则字符串必须是以\0结束的。
...
ON_COMMAND_EX、ON_COMMAND区别 - C/C++ - 清泛网 - 专注C/C++及内核技术
...应的普通映射宏相比,有两个不同之处:
一是多了一个UINT类型的参数,另外就是有返回值(返回BOOL类型)。
回顾4.4.2章节,范围映射宏ON_COMMAND_RANGE的消息处理函数也有一个这样的参数,该参数在两处的含义是一样的,
即:
...
MFC 菜单背景色设置(菜单重绘) - C/C++ - 清泛网 - 专注C/C++及内核技术
...E_MAP()
...
int CMainFrm::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
UINT style=0;
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
mMenu.AttatchMenu(LoadMenu(NULL,MAKEINTRESOURCE(IDR_MAINFRAME)));
mMenu.ChangeMenuItem(&mMenu,TRUE);
SetMenu(&mMenu);
...
}
void C...
AfxIsValidAddress 测试内存地址 - C/C++ - 清泛网 - 专注C/C++及内核技术
...序的内存空间。
BOOL AfxIsValidAddress(
const void* lp,
UINT nBytes,
BOOL bReadWrite = TRUE
);
Parameters
lp
Points to the memory address to be tested.
指向被测试内存。
nBytes
Contains the number of bytes of memory to ...
MFC 获取并移动其他应用程序窗口的方法 - C/C++ - 清泛网 - 专注C/C++及内核技术
...句柄,这种方法不依赖窗口信息。
void CDlgSpy::OnMouseMove(UINT nFlags, CPoint point)
{
POINT pnt;
::GetCursorPos(&pnt);
HWND hwndCur = ::WindowFromPoint(pnt);
//...
}
其次,得到窗口句柄后移动窗口的方法:
//等待启动完毕
HWND hMain = NUL...
VC 对话框背景色覆盖CEdit背景色的解决方法 - C/C++ - 清泛网 - 专注C/C++及内核技术
...
//页面背景色
HBRUSH CDemoView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: 在此更改 DC 的任何特性
//不变色
if (nCtlColor == CTLCOLOR_EDIT)
return hbr;
// TODO: 如果默认的不是...
解决rc中无法设置CComboBox下拉列表框高度的问题 - C/C++ - 清泛网 - 专注C...
...box is to be set.
int CComboBox::SetItemHeight(
int nIndex,
UINT cyItemHeight
);
nIndex
Specifies whether the height of list items or the height of the edit-control (or static-text) portion of the combo box is set.
If the combo box has the CBS_OWNERDRAWVARIABLE style, nIn...
VC CTreeCtrl复选框checkbox的使用方法 - C/C++ - 清泛网 - 专注C/C++及内核技术
... TODO: Add your control notification handler code here
CPoint point;
UINT uFlag; //接收有关点击测试的信息的整数
HTREEITEM hTree;
BOOL bCheck;
GetCursorPos(&point); //获取屏幕鼠标坐标
m_TreeCtrl.ScreenToClient(&point); //转化...
mfc 如何隐藏滚动条 - C++ UI - 清泛IT社区,为创新赋能!
void Cxxx::OnSize(UINT nType, int cx, int cy)
{
...
ShowScrollBar(SB_BOTH, FALSE);
...
}
简单粗暴,最实用,亲测有效。
如何获取控件的值? - C++ UI - 清泛IT社区,为创新赋能!
...DC, int& value );
void AFXAPI DDX_Text( CDataExchange* pDX, int nIDC, UINT& value );
void AFXAPI DDX_Text( CDataExchange* pDX, int nIDC, long& value );
void AFXAPI DDX_Text( CDataExchange* pDX, int nIDC, DWORD& value );
void AFXAPI DDX_Text( CDataExchange* pDX, int nIDC, CString&...