How can I use SetGlobalPreProcessURLHandler in vb6.0?

DLL Edition of the F-IN-BOX
attly
Posts: 7
Joined: Mon Mar 02, 2009 1:32 am

How can I use SetGlobalPreProcessURLHandler in vb6.0?

Postby attly » Sun Mar 22, 2009 8:04 am

I want to get URL in Flash,but I can't use SetGlobalPreProcessURLHandler in vb6.
Please give me a demo.Thank you.

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Sun Mar 22, 2009 2:44 pm

Thank you for your question.

Please check this code:

Code: Select all

FPC_SetPreProcessURLHandler(hFPC, AddressOf GlobalPreProcessURLHandler, 0)

Public Function GlobalPreProcessURLHandler(ByVal hFPC As Long, ByVal lParam As Long, ByRef URL As String, ByRef bContinue As Long)
...
End Function


Thank you.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

attly
Posts: 7
Joined: Mon Mar 02, 2009 1:32 am

Postby attly » Mon Mar 23, 2009 1:30 am

Thanks for your answer.I test the code ,but in runing vb terminated.
Please help me.

Public Declare Function FPC_SetPreProcessURLHandler Lib "f_in_box.dll" _
(ByVal hFPC As Long, _
ByVal pHandler As Long, ByVal lParam As Long) As Long

Public Function GlobalPreProcessURLHandler(ByVal hFPC As Long, ByVal lParam As Long, ByRef

URL As String, ByRef bContinue As Long)
'
bContinue = 1
If URL = "www.google.cn" Then
URL = "www.yahoo.com"
End If

End Function

'Prepare FlashPlayerControl
FPC_SetPreProcessURLHandler hFPC, AddressOf GlobalPreProcessURLHandler, 0&

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue Mar 24, 2009 8:05 am

I've modified it and it works:

attly wrote:Public Function GlobalPreProcessURLHandler(ByVal hFPC As Long, ByVal lParam As Long, ByRef URL As String, ByRef bContinue As Long) As Long
'
bContinue = 1
If URL = "www.google.cn" Then
URL = "www.yahoo.com"
End If

End Function

'Prepare FlashPlayerControl
FPC_SetPreProcessURLHandler hFPC, AddressOf GlobalPreProcessURLHandler, 0&


Please check it.

Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue Mar 24, 2009 9:04 am

Sorry, it doesn't work. I will try to create a working sample today.

Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue Mar 24, 2009 4:29 pm

OK, here the tested code:

Code: Select all

Private Declare Function lstrcmpiW Lib "kernel32" _
(ByVal lpString1 As Long, ByVal lpString2 As String) As Long

Public sNewURL As String

Public Function GlobalPreProcessURLHandler(ByVal hFPC As Long, ByVal lParam As Long, ByRef URL As Long, ByRef bContinue As Long) As Long
   
    bContinue = 1

    Dim s As String
    s = StrConv("http://FirstURL.com", vbUnicode)
   
    If lstrcmpiW(URL, s) = 0 Then
   
        sNewURL = "http://SecondURL.com"
       
        URL = StrPtr(sNewURL)

    End If

End Function


Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

attly
Posts: 7
Joined: Mon Mar 02, 2009 1:32 am

Thank you support.

Postby attly » Wed Mar 25, 2009 1:06 am

Thank you very much. How do I get clickable URL, and to deny any IE pop-up window

attly
Posts: 7
Joined: Mon Mar 02, 2009 1:32 am

Thank you support.

Postby attly » Wed Mar 25, 2009 1:27 am

I just use the buttons to use as a URL, do not want it to open any connection

attly
Posts: 7
Joined: Mon Mar 02, 2009 1:32 am

Thank you.

Postby attly » Wed Mar 25, 2009 6:21 am

Private Declare Function lstrlen Lib "kernel32" _
Alias "lstrlenA" _
(ByVal lpString As Any) As Long

Private Declare Function lstrcpy Lib "kernel32" _
Alias "lstrcpyA" _
(ByVal lpString1 As Any, _
ByVal lpString2 As Any) As Long

Private Function GetStringFromLongPtr(ByVal pStr As Long) As String
GetStringFromLongPtr = String$(lstrlen(ByVal pStr), 0)
Call lstrcpy(ByVal GetStringFromLongPtr, ByVal pStr)
End Function

Public Function GlobalPreProcessURLHandler(ByVal hFPC As Long, ByVal lParam As Long, ByRef

URL As Long, ByRef bContinue As Long) As Long

bContinue = 1

Debug.Print GetStringFromLongPtr(ByVal URL)
'always reture first char

End Function

GetStringFromLongPtr(ByVal URL) always reture first character.
How can I get all URL and to deny any IE pop-up window?

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Re: Thank you support.

Postby Softanics » Wed Mar 25, 2009 8:24 am

attly wrote:I just use the buttons to use as a URL, do not want it to open any connection


If you know what URL you should block:

Code: Select all

Private Declare Function lstrcmpiW Lib "kernel32" _
(ByVal lpString1 As Long, ByVal lpString2 As String) As Long

Public sNewURL As String

Public Function GlobalPreProcessURLHandler(ByVal hFPC As Long, ByVal lParam As Long, ByRef URL As Long, ByRef bContinue As Long) As Long
   
    Dim s As String
    s = StrConv("http://SomeURL.com", vbUnicode)
   
    If lstrcmpiW(URL, s) = 0 Then
   
       bContinue = 0

    End If

End Function


Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

attly
Posts: 7
Joined: Mon Mar 02, 2009 1:32 am

Thank you support.

Postby attly » Wed Mar 25, 2009 10:15 am

I want to get the URL, then the analysis carried out in accordance with intercept

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Re: Thank you support.

Postby Softanics » Wed Mar 25, 2009 3:52 pm

attly wrote:I want to get the URL


Code: Select all

Private Declare Function lstrlenW Lib "kernel32" _
(ByVal lpString1 As Long) As Long

Private Declare Function lstrcpyW Lib "kernel32" _
(ByVal lpString1 As String, ByVal lpString2 As Long) As Long

...

Public Function GlobalPreProcessURLHandler(ByVal hFPC As Long, ByVal lParam As Long, ByRef URL As Long, ByRef bContinue As Long) As Long
   
    Dim s As String
    s = String$(2 * lstrlenW(URL), 0)
    lstrcpyW s, URL
   
    Dim s1 As String
    s1 = StrConv(s, vbFromUnicode)
   
    MsgBox s1

End Function


Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

attly
Posts: 7
Joined: Mon Mar 02, 2009 1:32 am

Thanks very much.

Postby attly » Thu Mar 26, 2009 2:04 am

Thanks very much.


Return to “DLL Edition”

Who is online

Users browsing this forum: No registered users and 17 guests