|
-
Mar 29th, 2006, 08:44 PM
#1
Thread Starter
Member
-
Mar 29th, 2006, 08:46 PM
#2
Fanatic Member
Re: ShellExecute HELP !@!@!@!@!@
VB Code:
Private 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
Private Sub Command1_Click()
Dim x
x = ShellEx(Form1.hwnd, "open", "path of file", "", "", 1)
End Sub
-
Mar 29th, 2006, 09:13 PM
#3
Lively Member
Re: ShellExecute HELP !@!@!@!@!@
-
Mar 29th, 2006, 09:24 PM
#4
Re: ShellExecute HELP !@!@!@!@!@
VB Code:
Option Explicit
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 As Long = 1
Private Const SW_SHOWMINIMIZED As Long = 2
Private Const SW_SHOWMAXIMIZED As Long = 3
Private Sub Command1_Click()
On Error GoTo MyError
Dim lRet As Long
lRet = ShellExecute(Me.hwnd, "Open", "C:\MyApp.exe", vbNullstring, "C:\", SW_SHOWNORMAL)
If lRet <= 32 Then
MsgBox "Error Shelling"
End If
Exit Sub
MyError:
MsgBox Err.Number & " - " & Err.Description
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|