I want to get URL in Flash,but I can't use SetGlobalPreProcessURLHandler in vb6.
Please give me a demo.Thank you.
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
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&
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
attly wrote:I just use the buttons to use as a URL, do not want it to open any connection
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
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
Users browsing this forum: No registered users and 15 guests