Hey,
I know that we can start another App from VB using the ShellExecute Function in the Windows API.
But I tried opening Notepad.exe ("just for testing") using the ShellExecute Command and it doesnt start Notepad. Here's my code.
Please tell me what's wrong and How I can make it work...
and BTW...I'm calling this from a Module...specifically from Sub Main() but it doesnt work for a Form either when I make the Hwnd to Me.hwnd.
Thanx in advance.
CODE
'API Declaration
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
CODE
retval = ShellExecute(0, _
  vbNullString, _
  "C:\windows\notepad.exe", _
  vbNullString, _
  "c:\temp", _  ' REFER [**] Â
  SW_SHOWNORMAL)
'[**] Frankly, I have no idea why the directory parameter is to be given.'Please let me know about it too.
This post has been edited by born2c0de: 27 Mar, 2005 - 01:32 AM