|
-
May 5th, 2010, 09:59 AM
#1
Thread Starter
Member
Windows Explorer Location URL character
Hello Everybody.
i'm trying to list windows explorer opened windows and opened windows adress in vb6 But i have a this problem.
When i get LocationURL it return unknown characters in adress text.
Code:
Code:
public function getWindowList
Dim app, mx
Set app = CreateObject("Shell.Application")
Set mx = app.Windows
For Each st In mx
MsgBox "Title:" & st.LocationName & vbNewLine & "Adress:" & st.LocationUrl
Next
end function

it send a unknown characters like %20 ?
[Sorry For my English]
Thanks...
-
May 5th, 2010, 10:02 AM
#2
Re: Windows Explorer Location URL character
%20 means "this is hex(%): 20", which is a space.
You can do: newfilename = Replace(filename, "%20", " ") to turn them into spaces.
A better way would be to locate %, grab the two characters after it, and convert the hex into asc, if you really want it 'pretty printed'.
-
May 5th, 2010, 10:56 AM
#3
Lively Member
Re: Windows Explorer Location URL character
with replace your code must resembled his
vb Code:
public function getWindowList Dim app, mx Set app = CreateObject("Shell.Application") Set mx = app.Windows For Each st In mx MsgBox "Title:" & st.LocationName & vbNewLine & "Adress:" & replace(st.LocationUrl,"%20", " ") Next end function
-
May 5th, 2010, 11:59 AM
#4
Thread Starter
Member
Re: Windows Explorer Location URL character
Now i do This...
Code:
Public Function parsepath(ByVal path As String) As String
Dim sonuc As String
sonuc = path
sonuc = Replace(sonuc, "%20", " ")
sonuc = Replace(sonuc, "file:///", "")
sonuc = Replace(sonuc, "/", "\")
sonuc = Replace(sonuc, "%E7", "ç")
sonuc = Replace(sonuc, "%F6", "ö")
sonuc = Replace(sonuc, "%FC", "ü")
sonuc = Replace(sonuc, "%C7", "Ç")
sonuc = Replace(sonuc, "%D6", "Ö")
sonuc = Replace(sonuc, "%DC", "Ü")
parsepath = sonuc
End Function
Thanks Everybody
Last edited by mustiback; May 5th, 2010 at 02:06 PM.
-
May 6th, 2010, 08:28 AM
#5
Re: Windows Explorer Location URL character
Another possibility:
Code:
Function Unescape(ByVal Escaped As String) As String
Dim strSegments() As String
Dim intSegment As Integer
strSegments = Split(Escaped, "%")
For intSegment = 1 To UBound(strSegments)
strSegments(intSegment) = _
Chr$(CInt("&H0" & Left$(strSegments(intSegment), 2))) _
& Mid$(strSegments(intSegment), 3)
Next
Unescape = Join$(strSegments, "")
End Function
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
|