PlanetSquires Forums

Support Forums => General Board => Topic started by: Marc van Cauwenberghe on December 07, 2013, 08:11:44 AM

Title: Moving form without titlebar
Post by: Marc van Cauwenberghe on December 07, 2013, 08:11:44 AM
Hi,

Can anyone point me to some tips, preferably examples of moving a dialog when I disable titlebar.
Benn looking here and at pb with different keywords but not found anything.

Thanks,
Marc
Title: Re: Moving form without titlebar
Post by: David Kenny on December 07, 2013, 09:48:04 PM
Marc,

Look at the WM_MOUSEMOVE event.  You will have a start condition (Left mouse button down on a control or such). You will move the window corresponding to the mouse movement.  And stop moving it with your stop condition (Left mouse button up on the control).

David
Title: Re: Moving form without titlebar
Post by: Rudolf Furstauer on December 08, 2013, 07:29:48 AM
You could use this:

'------------------------------------------------------------------------------------------------------------------------
'
'--------------------------------------------------------------------------------
Function FRMLOGIN_CUSTOM ( _
                         hWndForm      As Dword, _  ' handle of Form
                         wMsg          As Long,  _  ' type of message
                         wParam        As Dword, _  ' first message parameter
                         lParam        As Long   _  ' second message parameter
                         ) As Long

'--------------------------------------

    'what message?
    '--------------------------------------------
    Select Case wMsg

        Case %WM_CLOSE
            FF_CloseForm (hWndForm, 1)


         'left mouse button to move the window
         '--------------------------------------------
        Case %WM_LBUTTONDOWN
            SendMessage hWndForm, %WM_NCLBUTTONDOWN, %HTCAPTION, ByVal %Null

    End Select

End Function


If you want move a window with a control:
'--------------------------------------------------------------------------------
' move window with control
'--------------------------------------------------------------------------------
Function FRMLOGIN_LBLLOGIN_WM_LBUTTONDOWN ( _
                                          ControlIndex  As Long,  _  ' index in Control Array
                                          hWndForm      As Dword, _  ' handle of Form
                                          hWndControl   As Dword, _  ' handle of Control
                                          MouseFlags    As Long,  _  ' virtual keys that are pressed
                                          xPos          As Long,  _  ' x-coordinate of cursor
                                          yPos          As Long   _  ' y-coordinate of cursor
                                          ) As Long

    SendMessage hWndForm, %WM_NCLBUTTONDOWN, %HTCAPTION, ByVal %Null
End Function

Maybe helpful for you.

Rudolf Fürstauer
Title: Re: Moving form without titlebar
Post by: Marc van Cauwenberghe on December 20, 2013, 12:11:17 PM
Sorry for the late reply. Thank you for your possible solutions.

Marc