Results 1 to 2 of 2

Thread: changing border style

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    25
    I`m trying to make a fullscreen form with no caption ,border etc ... everythings fine until I try to get rid of the border which originally is borderstyle=2(resizable)


    I`m using ws_thickframe but it kills the resizing but keeps the border .... how do I get rid of that border ??

    Private Sub max_MouseUp(Button As Integer, Shift As Integer, x As Single, _
    Y As Single)
    max.Picture = LoadPicture(PicDir & "max1.bmp")
    'maxed = True
    cx = GetSystemMetrics(SM_CXSCREEN)
    cy = GetSystemMetrics(SM_CYSCREEN)

    ' Call API to set new size of window.
    'retval = SetWindowPos(Me.hwnd, HWND_TOP, 0, 0, cx, cy, SWP_SHOWWINDOW)

    WSstyle = GetWindowLong(Me.hwnd, GWL_STYLE)
    styleOld = WSstyle
    WSstyle = WSstyle Xor WS_THICKFRAME
    WSstyle = WSstyle Xor WS_BORDER
    SetWindowLong Me.hwnd, GWL_STYLE, WSstyle
    End Sub

    what am I doing wrong?

    give me the handle and I`ll give you the world
    Adam
    junior programmer

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    Try:
    Code:
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    
    Private Const GWL_STYLE = (-16)
    
    Private Const WS_BORDER = &H800000
    Private Const WS_DLGFRAME = &H400000
    Private Const WS_THICKFRAME = &H40000
    
    Private Sub Command1_Click()
        Call SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) Xor WS_THICKFRAME Xor WS_DLGFRAME Xor WS_BORDER)
        Move 0, 0, Screen.Width, Screen.Height
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width