MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColor)
LRESULT OnCtlColor(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandle);
LRESULT OnClickForgetPwd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
.cpp文件中:
{
HDC hDC = (HDC)wParam;
HWND hWnd = (HWND)lParam;
if(hDC != NULL && hWnd != NULL && ::GetDlgCtrlID(hWnd) == IDC_STATIC_FORGETPWD)
{
::SetBkMode(hDC, TRANSPARENT);
::CreatePen(PS_SOLID, 1, ::SetTextColor(hDC, RGB(0, 0, 255))); //设置文本颜色为蓝色
return (LRESULT)(::GetStockObject(HOLLOW_BRUSH));
}
return 0;
}
LRESULT CLoginPDDlg::OnClickForgetPwd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
CAuthStringDlg oAuthStringDlg;
return oAuthStringDlg.DoModal();
}