473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Why the code do not work?

yxq
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!


Nov 20 '05 #1
0 824

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
22
by: Liang Chen | last post by:
Is the file "bcopy.c" in the "libitery" directory the implement of the GNU C library function "bcopy"? If so, how can it run so fast?(copy-by-byte rather than copy-by-word) When I copy the code of...
192
by: Vortex Soft | last post by:
http://www.junglecreatures.com/ Try it and tell me what's happenning in the Microsoft Corporation. Notes: VB, C# are CLS compliant
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
66
by: Jon Skeet [C# MVP] | last post by:
I'm sure the net will be buzzing with this news fairly soon, but just in case anyone hasn't seen it yet: Microsoft are going to make the source code for the .NET framework (parts of it,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.