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!