views:

80

answers:

2

There's a certain control which I don't have the source to (Steema TTree) it doesn't send a help message when help is requested through the form. (clicking the ? near the X on the dialog, then clicking the TTree)

I can just call help directly on the form and pass in my own helpmessage, but I don't know whether the form is in help mode.

The form's cursor is acutally 0 even when it has a ? next to it... That I find odd.

Anyway, I know I'm hacking my way through this, but I don't care. All I want to know is if there is a way to tell whether the user is requesting help and currently has a ? next to their cursor

+1  A: 

The form's cursor is acutally 0 even when it has a ? next to it... That I find odd.

That's because that is your forms cursor

Try Screen.Cursor that should be the active one.

Despatcher
procedure TForm.tmr1Timer(Sender: TObject);begin OutputDebugString(PAnsiChar(format('%d',[ord(Cursor)]))); OutputDebugString(PAnsiChar(format('%d',[ord(Screen.Cursor)])));end;Output is 0 for both. Also, the ? disappears when I drag it off the dialog. Though you're probably right, something's cursor is set to ?
Peter Turner
A: 

Torry helped

 procedure wmNCLButtonDown(var Msg: TWMNCLButtonDown); message WM_NCLBUTTONDOWN;
 procedure wmNCLButtonUp(var Msg: TWMNCLButtonUp); message WM_NCLBUTTONUP;

I over rode those functions to set a global variable

 fHelpMode : Boolean

to true when

 if Msg.HitTest = HTHELP then
      fHelpMode := true;

That allowed me to know when if the user was requesting help and I could over ride a mouse event on the TTree to do my help pop-up.

Peter Turner