473,396 Members | 1,892 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,396 software developers and data experts.

shelling a link

I have a menu program that starts other programs...

Shell ProgramPath, vbNormalFocus

No problem... BUT, what if I want to open a link on the desktop?
I need to be able to open the Regional and Language Options from the
control panel.
I tried creating a shortcut to the desktop and making ProgramPath the
path to that shortcut, but get a runtime error.

any suggestions?

Thanks!
Jul 29 '05 #1
2 4178

The Regional and Languages control panel item is intl.cpl, located in the
Windows system32 subfolder.
To open it from visual basic, you'll need to use the ShellExecute routine.
The example below assumes that Windows is installed in the C:\Windows
folder.

Private Declare Function ShellExecute Lib "Shell32.dll" Alias
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal
lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String,
ByVal nshowcmd As Long) As Long
Private Const SWShowNormal = 1
Private Sub Command1_Click()
X = ShellExecute(Me.hwnd, vbNullString, "C:\Windows\system32\intl.cpl",
vbNullString, "C:\Windows\System32", SWShowNormal)
End Sub

If Windows might be installed in a folder other than C:\Windows, use the
following function to identify the Windows installation folder, and use
WinDir$ in place of "C:\Windows" in the example above.

Private Declare Function GetWindowsDirectory Lib "kernel32" Alias
"GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
Long
Function WinDir$()
WinPath$ = String(145, Chr(0))
Posn% = GetWindowsDirectory(WinPath$, Len(WinPath$))
WinDir$ = Left(WinPath$, Posn%)
End Function

Hope this works for you
"Schmendrick" <no@thankyou.com> wrote in message
news:vd*******************@tornado.ohiordc.rr.com. ..
I have a menu program that starts other programs...

Shell ProgramPath, vbNormalFocus

No problem... BUT, what if I want to open a link on the desktop?
I need to be able to open the Regional and Language Options from the
control panel.
I tried creating a shortcut to the desktop and making ProgramPath the
path to that shortcut, but get a runtime error.

any suggestions?

Thanks!

Aug 2 '05 #2
Yep! That worked. Thanks!

Murray wrote:
The Regional and Languages control panel item is intl.cpl, located in the
Windows system32 subfolder.
To open it from visual basic, you'll need to use the ShellExecute routine.
The example below assumes that Windows is installed in the C:\Windows
folder.

Private Declare Function ShellExecute Lib "Shell32.dll" Alias
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal
lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String,
ByVal nshowcmd As Long) As Long
Private Const SWShowNormal = 1
Private Sub Command1_Click()
X = ShellExecute(Me.hwnd, vbNullString, "C:\Windows\system32\intl.cpl",
vbNullString, "C:\Windows\System32", SWShowNormal)
End Sub

If Windows might be installed in a folder other than C:\Windows, use the
following function to identify the Windows installation folder, and use
WinDir$ in place of "C:\Windows" in the example above.

Private Declare Function GetWindowsDirectory Lib "kernel32" Alias
"GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
Long
Function WinDir$()
WinPath$ = String(145, Chr(0))
Posn% = GetWindowsDirectory(WinPath$, Len(WinPath$))
WinDir$ = Left(WinPath$, Posn%)
End Function

Hope this works for you
"Schmendrick" <no@thankyou.com> wrote in message
news:vd*******************@tornado.ohiordc.rr.com. ..
I have a menu program that starts other programs...

Shell ProgramPath, vbNormalFocus

No problem... BUT, what if I want to open a link on the desktop?
I need to be able to open the Regional and Language Options from the
control panel.
I tried creating a shortcut to the desktop and making ProgramPath the
path to that shortcut, but get a runtime error.

any suggestions?

Thanks!

Aug 3 '05 #3

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

Similar topics

26
by: Harrie | last post by:
Hi, After Brian mentioned the use for <link rel=..> for navigational purposes in another thread, I've been looking into it and found that HTML 3.2 has two other recognized link types than HTML...
3
by: Hank Reed | last post by:
I have been using the ShellExecute command for about a year to print out a list of PDF files. It's a great capability. Of course, the documents are actually printed by the Adobe application. We...
8
by: sudhirlko2001 | last post by:
How to swap two nodes of doubly Linklist
1
by: A | last post by:
Does anyone have any code for shelling out a command to start up an executable with command line arguments? I am simply trying to start a MSDE install by calling its Setup.exe. Thanks
1
by: Stephen Miller | last post by:
On my development machine (where the group 'Everyone' has full access to every directory), the following code successfully shells to a console application: Dim objShell As...
3
by: _IS_ - | last post by:
I have the problem that shelling in vb.net is not working for me at this point. I am trying to make a graphical application to netsend (multiple) PCs on the network(notwork) and to ping to check...
6
by: djc | last post by:
I'm wondering what options are available, if any, for being able to run 'any command line command' from a .net compiled program. I would want the output that would normally go to the command line...
0
by: MirkoGeest | last post by:
(Webmaster: sorry, I posted this first at the General Software Engineering category, but I think this goes here) I'm using Visual Basic with Web Forms on .NET 2003 and I'm experiencing a very...
7
by: Kurda Yon | last post by:
Hi everybody, I cannot understand the following thinks. The last line of the fillowing code produces a message about mistake (not a valid MySQL- Link resource): $link = mysql_connect(...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.