|
-
Jun 24th, 2000, 09:45 AM
#1
Thread Starter
Addicted Member
Hiyas,
I am building a web search program like webferret, currently it searches altavista, excite, google, yahoo, and goeureka, with about 9 other search engines I still need to code into it.
but my problem is with opening the item in the users default browser, I can open it but it opens the page in the browser session they currently have open, I need it to open a new browser session, to open the url in, can anyone help? because the way I am doing it only ever opens a new window when there is no browser currently open.
Also the nine other search engines that it is going to use are: webwombat, thunderstone, webcrawler, hotbot, snap, infoseek, 1blink, directhit, and msn. I've ruled out a few search engines like Lycos (couldn't get it to work properly, plus the search page was too big and was timing out inet control), metacrawler (search page too big in file size), metagopher (just searches other search engines so I would come up with alot more of the same results), and dogpile (just searches otehr search engines as well).
does anyone know of any search engines that I have missed that are anygood? if so can you list the url for them here.
thanx.
-
Jun 24th, 2000, 11:02 AM
#2
Frenzied Member
I beleve that it's setting that you can change in the Internet Options for the Internet Explorer, I'm not sure about netscape
NXSupport - Your one-stop source for computer help
-
Jun 24th, 2000, 11:36 AM
#3
please tell me how you are doing this...
I am plannin on making something similar to this, but I am not sure how, I would apreaciate it if you told me how to retrieve the URL's and how to search the engines..
thanks a bunch
-
Jun 24th, 2000, 11:56 AM
#4
Hyperactive Member
I'm not sure, but I believe that the ShellExecute command will open a file with the program that the file is associated with. The way that you would use it is:
Code:
Private sub Command1_click
'URL is the URL to be opened
Dim lResult
lResult = ShellExecute(&O0, "open", URL, vbNullString, CurDir$, SW_NORMAL)
Module1.bas
Code:
Public 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
Hope this helps.
(Using VB 6 SP3)
-
Jun 24th, 2000, 01:18 PM
#5
Hyperactive Member
ShellExecute doesn't open new window
It's too bad, i've wanted this function before too and nobody could answer... I mean, ICQ can open in a new window.. so vb should be able to too.
The code mentioned above will open the url in the browser last used and not open a new one (unless there doesn't exist any). If any one knows how, please post it.
(Also, SW_NORMAL should be declared (it's value is 1) before running the code or it would crash)
Signed, Rodik ([email protected])
Programmer,usesVB6ED
===========================
Copyright©RodikCo,2002.
Dont mind this signature ;] Its old
-
Jun 24th, 2000, 08:06 PM
#6
Hyperactive Member
Here y'all go.
well, I hate doing this because I spent a bit of time working on it, but I figure everybody here has helped me a bit, so it's just reciprocating. Have fun...
Code:
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 Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Const HKEY_CLASSES_ROOT = &H80000000
Public Sub ShellNewBrowser(ByVal URL As String, Optional ByVal ShowWindowState As VbAppWinStyle = vbNormalFocus)
Dim lRegKey As Long
Dim sBrowser As String
Dim sData As String * 255
Dim lData As Long
If RegOpenKey(HKEY_CLASSES_ROOT, "htmlfile\shell\open\command", lRegKey) = 0 Then
lData = 255
Call RegQueryValueEx(lRegKey, "", 0&, 0&, ByVal sData, lData)
sBrowser = Left(sData, lData - 1)
Call RegCloseKey(lRegKey)
End If
Shell sBrowser & URL, ShowWindowState
End Sub
Private Sub Form_Load()
ShellNewBrowser "www.hotmail.com", vbNormalNoFocus
ShellNewBrowser "www.slashdot.org", vbNormalNoFocus
End Sub
bob
-
Jun 25th, 2000, 07:06 AM
#7
Thread Starter
Addicted Member
thanx bob.
thanx for that bob, I really appreciate it.
To your question Dennis, well I wrote a module to extract links from a html file, which a few people took a look at on this board , but no one knew why it was playing up with the link titles, so I rewrote it but lost it to a reformat, and had to use the old playing up one. As for searching a search engine, I went to various search engines typed in a something to search for, then found that the search results url, has the search string in it, so I wrote down all the urls and then used the inet control to download the url just changeing the search text to a text boxes text, and then when the html was downloaded tried to use my module on it, but found that alot of search engines made it perform a run time error 5 because the links were to complex for my module to handle. so I scrapped that module, and know I have to write a function for each search engine to deal with its layout basically and where the links are positioned ect. but the only problem is that if a search engine changes its layout basically I'm stuffed, and I have currently made a function for altavista, excite, google, yahoo, goeureka, webwombat, thunderstone, webcrawler, and hotbot. with infoseek, 1blink, directhit, and msn still to go.
anyone want to recommend any other search engines (but not lycos, metacrawler, metagopher, or dogpile, or ask jeeves)?
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
|