|
-
Nov 18th, 2000, 10:06 AM
#1
Thread Starter
Hyperactive Member
Does anyone know how to open a program like notepad or anything else without the OLE control(I want to be able to click on a command button to open the program) ??
I'm guessing it's the "OpenFile" API call...
Public Declare Function OpenFile Lib "kernel32"_
Alias "OpenFile" (ByVal lpFileName As String, lpReOpenBuff_ As OFSTRUCT, ByVal wStyle As Long) As Long
if it is, then what do i use for lpReOpenBuff ??
thnx!!
-
Nov 18th, 2000, 10:14 AM
#2
Hyperactive Member
I'm thinking you actually want
Code:
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
td.
"One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig
[email protected]
"but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.
-
Nov 18th, 2000, 10:15 AM
#3
Hyperactive Member
oh, and
Code:
Public Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long
will give you the exe associated with a given file.
td.
"One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig
[email protected]
"but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.
-
Nov 18th, 2000, 10:23 AM
#4
Thread Starter
Hyperactive Member
-
Nov 18th, 2000, 10:25 AM
#5
Hyperactive Member
OFSTRUCT
if you need it...
Code:
Public Type OFSTRUCT
cBytes As Byte
fFixedDisk As Byte
nErrCode As Integer
Reserved1 As Integer
Reserved2 As Integer
szPathName as String * 28
'/szPathName(OFS_MAXPATHNAME) As Byte
End Type
ignore Reserved1 and 2
cBytes is the length of the struct
fFixedDisk is not zero if your reading of a disk
nErrCode is a error identifier (there's a big list of 'em)
szPathName is the full path name to the file (using the OEM char set)
wStyle is a flag setting for the open operation (OF_CREATE, OF_READ, OF_DENY_READ etc)
td.
"One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig
[email protected]
"but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.
-
Nov 18th, 2000, 10:31 AM
#6
Thread Starter
Hyperactive Member
thnx again.
For the ShellExecute function, it wants a window handle.
handle from which window ?
-
Nov 18th, 2000, 10:34 AM
#7
Hyperactive Member
It wants the handle to tell who the owner is.
Give it something like me.hWnd (e.g. your hWnd of your form)
td.
"One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig
[email protected]
"but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.
-
Nov 18th, 2000, 10:37 AM
#8
Thread Starter
Hyperactive Member
k, tnx 4 the help
much appreciated.
-
Nov 18th, 2000, 11:24 AM
#9
Hyperactive Member
The OpenFile function creates, opens, reopens, or deletes a file.
Yes I did get that straight from MSDN
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
|