:: How to launch the Control Panel Extensions |
Author |
Michael Rieder |
Language |
VB5, VB6 |
Operating
Systems |
Windows 95, 98 and NT |
API
Declarations |
Option Explicit
'API calls
Public Declare Function GetDesktopWindow Lib "user32.dll" () As Long
Public 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
'API constants
Public Const SW_SHOWNORMAL = 1 |
Module |
Public Function StartCPLApp(AppName As String) As Long
' AppName
with ending
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
StartCPLApp = ShellExecute(Scr_hDC, "Open",
"Control", AppName, "C:\", SW_SHOWNORMAL)
End Function |
Usage |
Private Sub Command1_Click()
StartCPLApp "DESK.CPL"
End Sub |
|
|
|
|