PDA

Click to See Complete Forum and Search --> : Control Panel Applets


bbosh
Nov 2nd, 2000, 07:25 PM
How do I run them? Im using

Private Sub lstWinCP_DblClick
FileMng.Run "C:\Windows\control.exe c:\windows\system\" + lstWinCP.List(lstWinCP.ListIndex) + ".cpl"
End Sub
Public Sub Run(CommandLine As String)
Dim retval As Long, L As Single
For x = 1 To Len(CommandLine)
If Mid$(CommandLine, x, 1) = "\" Then ItsDir = Left(CommandLine, x)
If Mid$(lcase$(CommandLine), x, 4) = ".exe" Then Exit For
Next x
Switchs = InStr(LCase$(CommandLine), ".exe")
If Switchs > 0 And switches + 3 > Len(CommandLine) Then
Param = Right(CommandLine, Len(CommandLine) - (Switchs + 5))
CommandLine = Left(CommandLine, Switchs - 1)
Else
Param = ""
End If
retval = ShellExecute(frmMain.hwnd, "open", CommandLine, Param, ItsDir, SW_RESTORE)
L = Timer
While L + 4 > Timer
DoEvents
Wend
frmTaskBar.Toolbar.Buttons.Clear
frmTaskBar.LoadTaskList
End Sub

But that doesn't work. I've also tried calling the cpls w/o control.exe in front, but that doesn't seem to work either.

[EDITED TO FIX TWO BUGS IN RUN PROCEDURE]

[Edited by bbosh on 11-02-2000 at 08:31 PM]

gwdash
Nov 3rd, 2000, 06:46 PM
I believe the path used to call them is

c:\windows\rundll32.exe shell32.dll,Control_RunDLL FileName,Command Line Arguments