| | |
Target a web link, help me please.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
try this
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim txturl as string txturl ="http://www.daniweb.com" Shell "C:\Program Files\Internet Explorer\IExplore.exe " & txurl.Text, vbMaximizedFocus
•
•
Join Date: Mar 2009
Posts: 36
Reputation:
Solved Threads: 5
Yes because it's a API call missing.
Try this...
---
you can replace the mailto: part with any valid URL excluding http://
Kudos to the API-guide guys who are unfortunately closing down now.
This seems pretty cool too...
Try this...
---
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
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 Const SW_SHOWNORMAL = 1 Private Sub Form_Load() 'KPD-Team 1998 'URL: http://www.allapi.net/ 'E-Mail: KPDTeam@Allapi.net 'Send an E-Mail to the KPD-Team ShellExecute Me.hwnd, vbNullString, "mailto:KPDTeam@Allapi.net", vbNullString, "C:\", SW_SHOWNORMAL End Sub
you can replace the mailto: part with any valid URL excluding http://
Kudos to the API-guide guys who are unfortunately closing down now.
This seems pretty cool too...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean Dim lngRetVal As Long lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0) If lngRetVal = 0 Then DownloadFile = True End Function Private Sub Form_Load() 'example by Matthew Gates (Puff0rz@hotmail.com) DownloadFile "http://www.allapi.net", "c:\allapi.htm" End Sub
Last edited by javmedia; Mar 3rd, 2009 at 1:21 am.
sorry missing "t", i put txurl.. should be txturl
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim txturl as string txturl ="http://www.daniweb.com" Shell "C:\Program Files\Internet Explorer\IExplore.exe " & txturl.Text, vbMaximizedFocus
Last edited by cguan_77; Mar 3rd, 2009 at 2:57 am.
•
•
Join Date: Aug 2008
Posts: 77
Reputation:
Solved Threads: 0
•
•
•
•
sorry missing "t", i put txurl.. should be txturl
Dim txturl as string txturl ="http://www.daniweb.com" Shell "C:\Program Files\Internet Explorer\IExplore.exe " & txturl.Text, vbMaximizedFocus
the error in this code is invalid quantifiers.
•
•
Join Date: Aug 2008
Posts: 77
Reputation:
Solved Threads: 0
•
•
•
•
Yes because it's a API call missing.
Try this...
---
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
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 Const SW_SHOWNORMAL = 1 Private Sub Form_Load() 'KPD-Team 1998 'URL: http://www.allapi.net/ 'E-Mail: KPDTeam@Allapi.net 'Send an E-Mail to the KPD-Team ShellExecute Me.hwnd, vbNullString, "mailto:KPDTeam@Allapi.net", vbNullString, "C:\", SW_SHOWNORMAL End Sub
you can replace the mailto: part with any valid URL excluding http://
Kudos to the API-guide guys who are unfortunately closing down now.
This seems pretty cool too...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean Dim lngRetVal As Long lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0) If lngRetVal = 0 Then DownloadFile = True End Function Private Sub Form_Load() 'example by Matthew Gates (Puff0rz@hotmail.com) DownloadFile "http://www.allapi.net", "c:\allapi.htm" End Sub
I am having a hard time to understand the code. .can I have a simple example program using your code? I just want to know how it works so I can get the analysis. Thank you so much.
•
•
Join Date: Mar 2009
Posts: 36
Reputation:
Solved Threads: 5
I'll break it down for you...
Me.hwnd = the calling applications ID/reference to shell32.dll
vbNullString = NULL as "Not Specified" as a variable in the call to shell32.dll
C:\ = the default root drive / starting directory for the called application
SW_SHOWNORMAL = calling shell32.dll specifying the behaviour of the opened application window
You cannot get much simpler than this...
'inserts a definition of a Windows API function from the DLL file shell32.dll returning a LONG value 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 ' A constant used by the function to specify Show the opened window as normal, neither minimized or maximized Const SW_SHOWNORMAL = 1 ' on loading the form, which this code is in, execute this function... Private Sub Form_Load() 'Open the default browser and go to URL... ShellExecute Me.hwnd, vbNullString, "http://www.yourdomain.com", vbNullString, "C:\", SW_SHOWNORMAL End Sub
Me.hwnd = the calling applications ID/reference to shell32.dll
vbNullString = NULL as "Not Specified" as a variable in the call to shell32.dll
C:\ = the default root drive / starting directory for the called application
SW_SHOWNORMAL = calling shell32.dll specifying the behaviour of the opened application window
You cannot get much simpler than this...
Last edited by javmedia; Mar 3rd, 2009 at 4:51 am.
![]() |
Similar Threads
- How To Increase Your Page Rank And Web Traffic FREE (Promotion and Marketing Plans)
- Save Target as... (JavaScript / DHTML / AJAX)
- better search tips from google (Search Engine Optimization)
- 11 Power Search Tips to make your Google Experience easier (Search Engine Optimization)
- Link problem (PHP)
- How to remove cool web search (Viruses, Spyware and other Nasties)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: How to get Current Week Number of the Month
- Next Thread: Creating User Manual in Vb6 and Populating TreeView from Mysql database VB6
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows







If I counted every time I missplaced a semi colon and had one penny for all the missing leading letters, we could buy Microsoft by now *lol*