-
I've noticed that many of the more powerful API calls involve either ShellExecuteA,
ShellExecuteB, or something along those lines. What exactly can be done with that API?
And while I'm at it, does anyone know how to make the control-panel pop up?
I've tried it in a windows NT4 environment, but it didn't work. Why?
-
It opens a file with its default app.
-
How about these?
there's a way to open the find file dialog, any folder, a vb program
anything else along those lines?
-
To open a folder, you don't even need to use ShellExecute. Use VB's Shell method instead.
Code:
Shell "explorer C:\MyFolder", 1
This example shells "Explorer" (Windows explorer) and passes the folder name as the command line argument. In most programs, whatever is passed in the command line argument is what file should be opened.
-
Anything else?
Okay, that's useful, but with this api, you can open the folder up as if you clicked on it.
Does anyone know a website, or could they list any other calls here?
What I'm asking is: What goes here:?
---------------
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 SW_SHOWNORMAL = 1
ShellExecute 0,{HERE},{MAYBE HERE}, vbNullString, vbNullString, 1
---------------
Or anywhere else in that last line?
-
Code:
ShellExecute hwnd, "open", "C:\Myfile.txt", "", "", 1
-
To open the Find Files Dialog, use this:
Code:
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 Sub Command1_Click()
Dim strPathToSearch As String
strPathToSearch = "C:\"
ShellExecute Me.hwnd, "find", strPathToSearch, _
vbNullString, vbNullString, 1
End Sub
For more on the ShellExecute API function, take a look at this link.
http://www.vbapi.com/ref/s/shellexecute.html
-
I know this works with the shell function but I'm not sure about the API calls. Maybe this might help you figure it out. When you do can you post it?
'Control Panel itself:
X = Shell("rundll32.exe shell32.dll,Control_RunDLL")
'Display:
X = Shell("rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3")
'Background:
X = Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0")
'Apperance:
X = Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2")
'Screen Saver:
X = Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1")
'Settings:
X = Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3")
'Date/Time:
X = Shell("rundll32.exe shell32.dll,Control_RunDLL timedate.cpl")