This code show how to made a MDI Form Borderless.
Tested on Visual Basic 6 under Windows XP SP3 platform.
'This is the API declaration; I suggest to put it in a module, OR change private to public Private Declare Function GetWindowLong Lib "USER32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "USER32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long 'Constants to make code more readable Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_CAPTION = &HC00000 'A generic function to make a form borderless Public Sub RetiraBorda(ByRef nFormHWND As Long) Dim nEstilo As Long On Error GoTo errRetiraBorda nEstilo = GetWindowLong(nFormHWND, GWL_STYLE) nEstilo = nEstilo And Not WS_CAPTION SetWindowLong nFormHWND, GWL_STYLE, nEstilo Exit Sub errRetiraBorda: MsgBox "Erro na execuÃ§Ã£o da rotina:" & vbNewLine & vbNewLine & Err.Number & " - " & Err.Description, vbExclamation, "RetiraBorda" End Sub 'The function can be called this way, in the form for example Private Sub MDIForm_Activate() Dim rTela As tCoord RetiraBorda Me.hwnd rTela = AreaTrabalho 'Some other code to initialize application '(...) End Sub
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.