In IDE I got 11672 for shell and 42 for ShellExecute with Project4.exe not showing.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 Sub Command1_Click() MsgBox "" & Shell("D:\Test\ucShellBrowse\Demo2\Project4.exe", vbNormalFocus) End Sub Private Sub Command2_Click() MsgBox "" & ShellExecute(0, "open", "D:\Test\ucShellBrowse\Demo2\Project4.exe", vbNullString, vbNullString, 0) End Sub
When compiled, I got 12148 and 42 with Project4.exe executing as expected.
I tried on a Windows7 machine, and it works in the IDE as it should. I will try on other machines next week.
EDIT : I tried on a Windows 10 machine and it works in the IDE. Must be my main machine under Windows 11 which has a problem...




Reply With Quote
