📄 ztooltipctrl.cpp
字号:
/************************************
REVISION LOG ENTRY
Revision By: Zhang, Zhefu
Contact: codetiger@hotmail.com
Revised on 12/7/2002 10:44:33 AM
Comment: Following Source is Written To Contribute to WWW.CodeGuru.Com
Also check http://codeguru.earthweb.com/ieprogram/SPwdSpy.html
for latest patch
************************************/
/////////////////////////////////////////////////////////////////////////
// CMyToolTipCtrl member functions
#include <afxwin.h>
#include <afxcmn.h>
#include "stdafx.h"
#include "zToolTipCtrl.h"
BOOL CZToolTipCtrl::AddWindowTool (CWnd* pWnd, LPCTSTR pszText)
{
TOOLINFO ti;
ti.cbSize = sizeof (TOOLINFO);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
ti.hwnd = pWnd->GetParent ()->GetSafeHwnd ();
ti.uId = (UINT) pWnd->GetSafeHwnd ();
ti.hinst = AfxGetInstanceHandle ();
ti.lpszText = (LPTSTR) pszText;
return (BOOL) SendMessage (TTM_ADDTOOL, 0, (LPARAM) &ti);
}
BOOL CZToolTipCtrl::DelWindowTool (CWnd* pWnd)
{
TOOLINFO ti;
ti.cbSize = sizeof (TOOLINFO);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
ti.hwnd = pWnd->GetParent ()->GetSafeHwnd ();
ti.uId = (UINT) pWnd->GetSafeHwnd ();
ti.hinst = AfxGetInstanceHandle ();
//ti.lpszText = (LPTSTR) pszText;
return (BOOL) SendMessage (TTM_DELTOOL, 0, (LPARAM) &ti);
}
BOOL CZToolTipCtrl::AddRectTool (CWnd* pWnd, LPCTSTR pszText,
LPCRECT lpRect, UINT nIDTool)
{
TOOLINFO ti;
ti.cbSize = sizeof (TOOLINFO);
ti.uFlags = TTF_SUBCLASS;
ti.hwnd = pWnd->GetSafeHwnd ();
ti.uId = nIDTool;
ti.hinst = AfxGetInstanceHandle ();
ti.lpszText = (LPTSTR) pszText;
::CopyRect (&ti.rect, lpRect);
return (BOOL) SendMessage (TTM_ADDTOOL, 0, (LPARAM) &ti);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -