Article ID: 185637
Article Last Modified on 7/13/2004
Option Explicit
Private Declare Function SystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, ByRef lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Private Const SPI_GETDRAGFULLWINDOWS = 38
Private Const SPI_SETDRAGFULLWINDOWS = 37
Private Const SPIF_SENDWININICHANGE = 2
Private Function IsFullWindowDragOn() As Boolean
Dim result As Long
'Call API and check for successful call.
If SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0&, result, 0&) _
<> 0 Then
'Feature supported now check value of result.
If result = 0 Then
IsFullWindowDragOn = False
Else
IsFullWindowDragOn = True
End If
'Call failed, feature not supported.
Else
IsFullWindowDragOn = False
End If
End Function
Private Sub Form_Click()
Dim result As Long
'Toggle the setting.
If IsFullWindowDragOn Then
'Turn full window drag off.
result = SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 0&, _
ByVal vbNullString, SPIF_SENDWININICHANGE)
Else
'Turn full window drag on.
result = SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 1&, _
ByVal vbNullString, SPIF_SENDWININICHANGE)
End If
End Sub
Option Explicit
Private Declare Function SystemParametersInfo Lib "user" ( _
ByVal uAction As Integer, ByVal uParam As Integer, _
ByRef lpvParam As Any, ByVal fuWinIni As Integer) As Integer
Private Const SPI_GETDRAGFULLWINDOWS = 38
Private Const SPI_SETDRAGFULLWINDOWS = 37
Private Const SPIF_SENDWININICHANGE = 2
Private Function IsFullWindowDragOn() As Boolean
Dim result As Integer
'Call API and check for successful call.
If SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, result, 0) _
<> 0 Then
'Feature supported now check value of result.
If result = 0 Then
IsFullWindowDragOn = False
Else
IsFullWindowDragOn = True
End If
'Call failed, feature not supported.
Else
IsFullWindowDragOn = False
End If
End Function
Private Sub Form_Click()
Dim result As Integer
'Toggle the setting.
If IsFullWindowDragOn Then
'Turn full window drag off.
result = SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 0, _
ByVal vbNullString, SPIF_SENDWININICHANGE)
Else
'Turn full window drag on.
result = SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 1, _
ByVal vbNullString, SPIF_SENDWININICHANGE)
End If
End Sub
Keywords: kbhowto kbapi KB185637