home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,637 of 10,840   
   Murray to Schmendrick   
   Re: shelling a link   
   02 Aug 05 04:13:55   
   
   From: www@home.com   
      
   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"  wrote in message   
   news:vdjGe.42178$zY4.28738@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!   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca