LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a question mark to the title bar?

In the CVI .uir editor there is often a '?' icon in the title bar which you can use to mouseover a field to display some help text. 

How do I implement something like this in my CVI program? 

Thanks!

 

Angie

0 Kudos
Message 1 of 12
(4,340 Views)

One possible alternative in a CVIprogram is to use tooltips: see SetCtrlTooltipAttribute function help for an explanation on how they work.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 12
(4,337 Views)

If not a CVI solution, then is there a way to do this with a Win SDK function?  

I'm just looking for a clue to point me in the right direction. 

Thanks!

 

Angie

0 Kudos
Message 3 of 12
(4,329 Views)

Angie,
As Roberto suggested, you can use tooltips to display helpful information to the user when they hover over a control.

 

The following article has more information: KnowledgeBase: Can I Create Tool Tips in LabWindows/CVI?

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 12
(4,321 Views)

Thanks for the info. 

I may end up using tooltips, but what I really wanted was the '?' icon on the toolbar.  I did actually figure that part out (it puts the '?' icon up and changes the cursor when clicked on), now I'm just trying to try to figure out how to detect it when the operator clicks the '?' cursor over a control.  

 

Angie

0 Kudos
Message 5 of 12
(4,316 Views)

Hi Angie

 

Sorry to drag this up after more than 7 years but I am looking to do similar to what you describe.

 

However I have not been able to work out how to put the ? icon on the title bar.

 

Please could you let me know how you did it? I have been searching for quite a while and cannot seem to hit on any kind of solution, example or guide. I am probably not using the right keywords.

 

Did you manage to get it to work in the end?

 

Thanks in advance

 

Anand

0 Kudos
Message 6 of 12
(2,634 Views)

Hi Anand,

Has it been 7 years?  Yes I did finally get it to work, but I currently do not have access to the machine I developed the code on.  I may be able to access it next week, and if so I will reply again to this topic.  I wish I could remember what I did, but it's been so long.  I think I had to use the Windows SDK and change the title bar settings from there.  If I remember right, you can get the actual windows handle from a LabWindows function and use it to access the underlying SDK calls.  

Hope that helps and hopefully I'll get back to you soon.

Angie

0 Kudos
Message 7 of 12
(2,614 Views)

Hi Angie

 

Thank you for your quick reply - after so long I thought it really was a long shot. Your reply is much appreciated. 

 

Apologies for v.quick re-reply - I just happened to be in front of my computer when your reply came in. 

 

I appreciate it has been a long time and anything you can do to help, if and when you are able to access the machine in question, would be most welcome. 

 

Pointing me to the use of the Windows SDK is a good starting point. I have dabbled in getting the underlying window handle in the same project as I am trying to apply the question mark for things like access to message boxes - so doing so doesn't frighten me. 

 

Again, thank you for your quick reply - I will let you know how I get on. 

 

Thanks

 

Anand

0 Kudos
Message 8 of 12
(2,610 Views)

As per getting the associated window handle GetCVIWindowHandle is the function to use.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 9 of 12
(2,590 Views)

Hi Anand,

I found my code...here's the lines that put the question mark up.

 

____________________________________

int winHandle=0;

int postingHandle;

 

GetPanelAttribute (panel, ATTR_SYSTEM_WINDOW_HANDLE, &winHandle);

SetWindowLongPtr ((HWND)winHandle, GWL_EXSTYLE, WS_EX_CONTEXTHELP);

 

//Catch the windows message WM_NCLBUTTONDOWN for this panel (which means a non-client area of the

//window was clicked.  The callback function will verify that it's the '?' icon.

 

InstallWinMsgCallback (panel, WM_NCLBUTTONDOWN, UTIL_HelpCallback, VAL_MODE_IN_QUEUE, NULL, &postingHandle);

 

____________________________________

 

The callback looks like this...

_____________________________________

int CVICALLBACK UTIL_HelpCallback (int panelHandle, int message, unsigned int* wParam, unsigned int* lParam, void* callbackData)

 

if (*wParam == HTHELP)

  {

  <code>

  }

return 1;

_____________________________________

I have a note that you can't use the '?' if the 'min' or 'max' buttons are used.

 

Sorry if there are typo's etc...I couldn't cut/paste - had to retype.

Hope this helps!

Angie

0 Kudos
Message 10 of 12
(2,550 Views)