PDA

Click to See Complete Forum and Search --> : changing border style


skullb
Sep 11th, 2000, 05:16 PM
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?

Aaron Young
Sep 11th, 2000, 09:35 PM
Try: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