From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I enable tooltips for cvi-buttons in vc++6?

bool CButtonSetup::ToolFkt(UINT id, NMHDR *pTTTStruct, LRESULT *pResult)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pTTTStruct;
UINT nID =pTTTStruct->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
...
nID allways returns zero on CVI-Buttons. Standart Buttons working...
0 Kudos
Message 1 of 2
(2,720 Views)
This is happening because CVI controls that are on CVI panels do not have HWNDs associated with them. You can verify this with SPY++ - there's an HWND for the top-level panel window but the rest of the child windows are drawn within the panel's window rather than a window of their own.

CVI does have a function for adding tooltips to CVI controls in the CVI programmer's toolbox. This can be found in your CVI installation directory under toolslib\toolbox\toolbox.fp. One of the functions under User Interface Utilities is SetCtrlToolTipAttribute, which I think will do what you're looking for.

- Elton
Message 2 of 2
(2,720 Views)