|
-
Apr 15th, 2001, 10:17 AM
#1
Thread Starter
Junior Member
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?
-
Apr 15th, 2001, 10:35 AM
#2
It opens a file with its default app.
-
Apr 15th, 2001, 10:40 AM
#3
Thread Starter
Junior Member
How about these?
there's a way to open the find file dialog, any folder, a vb program
anything else along those lines?
-
Apr 15th, 2001, 10:49 AM
#4
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.
-
Apr 15th, 2001, 11:16 AM
#5
Thread Starter
Junior Member
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?
-
Apr 15th, 2001, 11:28 AM
#6
Code:
ShellExecute hwnd, "open", "C:\Myfile.txt", "", "", 1
-
Apr 15th, 2001, 05:29 PM
#7
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
-
Apr 15th, 2001, 09:28 PM
#8
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")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|