Hello
The vb6 code work well(change the icon Horizontal Spacing), the registry
key value("IconSpacing") can be changed in "HKEY_CURRENT_USER\Control
Panel\Desktop\WindowMetrics".
But i convert the code into VB.Net, it will not work
The VB6 Code
************************************************** ************
'(Moudle)
Option Explicit
Public Const SPI_ICONHORIZONTALSPACING = 13
Public Const SPIF_UPDATEINIFILE = &H1
Public Const SPIF_SENDWININICHANGE = &H2
Public Const SPIF_SENDCHANGE = SPIF_SENDWININICHANGE
Declare Function SystemParametersInfo Lib "user32.dll" Alias
"SystemParametersInfoA" (ByVal uiAction As Long, ByVal uiParam As Long,
pvParam As Any, ByVal fWinIni As Long) As Long
'Form
Private Sub Command1_Click()
Dim lngWin32apiResultCode As Long
lngWin32apiResultCode = SystemParametersInfo(SPI_ICONHORIZONTALSPACING,
Text1.Text, ByVal CLng(0), SPIF_UPDATEINIFILE Or SPIF_SENDCHANGE)
End Sub
************************************************** *************
The VB.NET Code
************************************************** **************
Public Const SPI_ICONHORIZONTALSPACING As Short = 13
Public Const SPIF_UPDATEINIFILE As Short = &H1s
Public Const SPIF_SENDWININICHANGE As Short = &H2s
Public Const SPIF_SENDCHANGE As Short = SPIF_SENDWININICHANGE
Declare Function SystemParametersInfo Lib "user32.dll" Alias
"SystemParametersInfoA" (ByVal uiAction As Integer, ByVal uiParam As
Integer, ByRef pvParam As Integer, ByVal fWinIni As Integer) As Integer
Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles Command1.Click
Dim lngWin32apiResultCode As Integer
lngWin32apiResultCode = SystemParametersInfo(SPI_ICONHORIZONTALSPACING,
CInt(t.Text), CInt(0), SPIF_UPDATEINIFILE Or SPIF_SENDCHANGE)
End Sub
************************************************** ***************
Could anyone please help me?
Thank you very much!