|
-
Jun 27th, 2000, 10:59 AM
#1
Thread Starter
Junior Member
ok if you had a text file that held a url how would you use it in
lReturn = ShellExecute(hwnd, "open", "URL GOES HERE", vbNull, vbNull, SW_SHOWNORMAL)
^all one line^
thanks
-
Jun 27th, 2000, 11:22 AM
#2
Hyperactive Member
Your really pushing it...
Usually you couldn't do this but there is ONE possibility but it is a bit sketchy and relies on a few things...
Code:
lReturn = ShellExecute(hwnd,"open","echo txtfile.txt",vbNull,vbNull, SW_SHOWNORMAL)
What this does is uses the "echo" DOS command to display the contents of the text file but I suspect ANYTHING you place in the "URL GOES HERE" would be taken literally as a string instead of a DOS command which means you physically CANNOT do the whole thing in one line.
Instead you do this :
Code:
Dim sURL as String
Open "txtfile.txt" for input as #1
Line Input #1, sURL
Close(1)
lReturn = ShellExecute(hwnd,"open",sURL,vbNull,vbNull, SW_SHOWNORMAL)
Its not one line, its 4... but it works ;-)
-
Jun 27th, 2000, 12:05 PM
#3
Hyperactive Member
What am I missing
Gen-X:
I tried your snippet and could not make it work. IE4 opens but the url is not posted. I am on NT4 and as I said, IE4.72...
Regards
Paul Lewis
-
Jun 27th, 2000, 12:33 PM
#4
Hyperactive Member
You asked for a code that could put the URL in the place you wanted... and thats what I did...
If it doesn't work then that means something else in your statement is wrong.
Good luck
-
Jun 28th, 2000, 03:32 AM
#5
Hyperactive Member
Thanks
I was only an interested bystander. Microslip originally asked the question, and while browsing I thought I could use that idea myself so I tried it.
You're probably right that something else in my machines settings are askew so hopefully it works for Microslip and others.
I'll revisit it at another time as I'd like to make a nice little "html link" control which subclasses an ordinary label, but interprets (and highlights and tracks) http:// references, launching them if pressed.
All I want that for is my Help|About screen 
It was a good reply you made to Microslip anyhow Gen-X so don't think I was being unkind by saying it didn't work for me
Catch you later
Paul Lewis
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
|