Moving form without titlebar

Started by Marc van Cauwenberghe, December 07, 2013, 08:11:44 AM

Previous topic - Next topic

Marc van Cauwenberghe

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

David Kenny

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

Rudolf Furstauer

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

Marc van Cauwenberghe

Sorry for the late reply. Thank you for your possible solutions.

Marc