Callback functions

Started by Petrus Vorster, September 22, 2015, 04:46:16 PM

Previous topic - Next topic

Petrus Vorster

I have a little piece of code that runs perfectly in the Powerbasic compiler.
(I will later see if this will work in freebasic too)
A key line is in the callback function of a Label control.

   Select Case Cb.Msg
      Case %WM_ContextMenu : Dialog End hDlg
      Case %WM_Command
         Select Case Cb.Ctl
            Case %IDC_Label : SendMessage hDlg, %WM_NCLButtonDown, %HTCaption, ByVal %Null  ' force drag
         End Select


Where do i go with this in Firefly? It simply drags the form by a label on it.
-Regards
Peter

Paul Squires


'--------------------------------------------------------------------------------
Function FORM1_LABEL1_STN_CLICKED ( _
                                  ControlIndex     As Long,  _  ' index in Control Array
                                  hWndForm         As Dword, _  ' handle of Form
                                  hWndControl      As Dword, _  ' handle of Control
                                  idStaticControl  As Long   _  ' identifier of static control
                                  ) As Long

   SendMessage hWndForm, %WM_NCLBUTTONDOWN, %HTCaption, ByVal %Null  ' force drag

   Function = 0   ' change according to your needs
End Function


:) :)
Paul Squires
PlanetSquires Software

Petrus Vorster

Thanks, sometimes i just dont get the picture where to go with the code that runs in the compiler and where to put that in FF.

Thanks a million
-Regards
Peter