|
-
Sep 30th, 2000, 01:42 PM
#1
Thread Starter
Member
Hi
Can someone please tell me why my code don't work
Shell (App.Path + "Tit_edit.exe")
I need to start a little prog I made from another.
any clues.
And another question.
the Tit_edit.exe is a small text editor, and it is
missing a function I'd like it to have. FIND & REPLACE
Any clues to find & replace in a selected text.
hope you can help.
Best regards,
Chris
Christian Davidsen
If you go to sleep with an itchy
ass, you wake up with smelly fingers.
-
Sep 30th, 2000, 01:44 PM
#2
Lively Member
This should work
Shell (App.Path + "\Tit_edit.exe")
I think you forgot slash.
-
Sep 30th, 2000, 01:46 PM
#3
try this
hi there...try this code instead...
put your path and app name in the brackets
returnvalue = Shell("c:\app.exe", 1)
AppActivate returnvalue
john
-
Sep 30th, 2000, 02:12 PM
#4
Lively Member
Try looking up the ShellExecute API-command to, while you are at it.
-
Sep 30th, 2000, 02:29 PM
#5
Fanatic Member
Originally posted by Thomas Halsvik
Try looking up the ShellExecute API-command to, while you are at it.
Why? The code of the other people that have posted works.
-
Sep 30th, 2000, 02:44 PM
#6
jump in
hi..i think what thomas means is that you should also look up the shell api and see for yourself.one learns by doing and seeing. so go on...look it up anyway and you might just learn a few more tricks
john
-
Sep 30th, 2000, 02:50 PM
#7
_______
<?>
Code:
'use this to set App.Path to inclued \ if not present
Dim AppPath$
If Right(App.Path, 1) <> "\" Then
AppPath = App.Path & "\"
Else
AppPath = App.Path
End If
'notice the AppPath is your version with the \ and not App.Path
Shell (AppPath + "Tit_edit.exe")
'Shelldef works like this.
Option Explicit
'put this in a bas module
'
Public Declare Function ShellEx Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As Any, _
ByVal lpDirectory As Any, ByVal nShowCmd As Long) As Long
'
Sub ShellDef(strFileName)
x = ShellEx(Me.hwnd, "open", strFileName, "", "", 1)
End Sub
'''''''''''''''''''''''''''''''''''''''
'form code
Option Explicit
Private Sub Form_Load()
'
Dim strYourFileVariable$
strYourFileVariable = "Tit_edit.exe"
ShellDef strYourFileVariable
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 30th, 2000, 02:58 PM
#8
Thomas could be a tough VB teacher because he wants everyone to look up themselves.
The last time I posted about a VB Bug, he didn't tell me to look it up .
Anyway, it's:
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
'hwnd: Handle of the Object
'lpOperation: open, print, or explore
'lpFile: Name of the File
'lpParameters: Parameters to put BEHING the name of the app.
lpDirectory: Directory of the File or Folder
nShowCmd: Windowstate, see: ShellExecute in MSDN.
-
Sep 30th, 2000, 04:42 PM
#9
To answer your second question, you can use the Instr and Replace functions.
Code:
If Instr(Text1.text, "MyText") Then
Text1.text = Replace(Text1.text, "MyText", "YourText")
End If
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
|