Program arguments
I need to write a program that would launch a webpage depending on the argument values sent to it. It must run from command prompt or from RUN. Something like: notepad.exe %1. This is what I have so far:
----------------------------------
Module code:
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
Public Const conSwNormal = 1
Public Sub vRandomLaunch(someString As String)
ShellExecute hwnd, "open", "http://www.mywebsite.com/test.asp?someid=" + someString, vbNullString, vbNullString, conSwNormal
End Sub
--------------------------------
Form Code:
Private Sub Form_Load()
Call vRandomLaunch("123")
Me.Hide
End Sub
--------------------------------------
How do I pass "123" to the Form on the launch?
I hope this makes sense.
Thanks.
|