Do you already have a xharbour wrapper for this dll function ?
Sorry, I don't have.
Definitely Guru's here in this wonderful forum will be able to help you out.
Here's a VB.NET Code
Header: Declared in Winuser.h; include Windows.h.
'API declarations
Public Const HCF_HIGHCONTRASTON As Integer = 1
Public Const SPI_SETHIGHCONTRAST As Integer = 67
Public Const SPIF_SENDWININICHANGE As Integer = 2
<System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)> _
Public Structure HIGHCONTRAST
Public cbSize As UInteger
Public dwFlags As UInteger
<System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)> _
Public lpszDefaultScheme As String
End Structure
<System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint:="SystemParametersInfoW")> _
Public Shared Function SystemParametersInfoW(ByVal uiAction As UInteger, ByVal uiParam As UInteger, ByVal pvParam As System.IntPtr, ByVal fWinIni As UInteger) As <System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)> Boolean
End Function
'End of API declarations
'Some button click event
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim highcontraststruct As New HIGHCONTRAST
highcontraststruct.dwFlags = HCF_HIGHCONTRASTON
highcontraststruct.cbSize = CUInt(Marshal.SizeOf(highcontraststruct))
Dim highcontrastptr As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(highcontraststruct))
Runtime.InteropServices.Marshal.StructureToPtr(highcontraststruct, highcontrastptr, False)
SystemParametersInfoW(SPI_SETHIGHCONTRAST, CUInt(Marshal.SizeOf(highcontraststruct)), highcontrastptr, SPIF_SENDWININICHANGE)
End Sub
Instead of
SystemParametersInfoW(SPI_SETHIGHCONTRAST, CUInt(Marshal.SizeOf(highcontraststruct)), highcontrastptr, SPIF_SENDWININICHANGE)
You may have to use SPI_GETHIGHCONTRAST
Regards
Anser