|
-
Sep 6th, 2000, 05:38 AM
#1
Thread Starter
Conquistador
how do i use
Code:
Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
also, i have microsoft spy++ so how do i find the handle of ie, then change its title? setwindowtext maybe???
-
Sep 6th, 2000, 06:03 AM
#2
Addicted Member
Code:
Dim Path as String, strSave as string
'Create a buffer string
strSave = String(200, Chr$(0))
'Get the windows directory
Path = Left$(strSave, GetWindowsDirectory(strSave, Len(strSave)))
'The left$ strips the trailing spaces
Hope this helps
Regards
Matt Brown
Hamilton, NZ
VB6 C++ in Visual Studio 6sp4
VB.net Beta 1
-
Sep 6th, 2000, 06:17 AM
#3
_______
<?>
Code:
'find the windows directory path
'usefull in shell commands if you know something
'is in the windows directory
'example..instead of shell c:\windows\notepad.ext
'you could use shell windir$ & /notepad.exe
'if windows was stored in E:/Windows then you wouldn't get an error
'if you used shell c:/windosw\notepad.exe, it couldn't be found '(error)
'
Option Explicit
Private Declare Function GetWindowsDirectory _
Lib "kernel32" Alias "GetWindowsDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long
'
Private Sub Form_Load()
'
Dim strFindWinDir$, WinDir$
'
WinDir$ = Space(144)
strFindWinDir$ = GetWindowsDirectory(WinDir$, 144)
WinDir$ = Trim(WinDir$)
'
MsgBox "The Windows Directory Path is: " & WinDir$
'
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 6th, 2000, 06:19 AM
#4
http://www.vbapi.com/ref/g/getwindowsdirectory.html
2 above are completely right, to read up more on it though, heck out the above.
-
Sep 6th, 2000, 03:00 PM
#5
Originally posted by da_silvy
also, i have microsoft spy++ so how do i find the handle of ie, then change its title? setwindowtext maybe???
Put the following into a Form with a CommandButton. When you click it, IE (if open) will have its title changed to "New Title For IE".
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Sub Command1_Click()
Dim hApp As Integer
Dim NewTitle As String
NewTitle = "New Title for IE"
hApp = FindWindow("IEFrame", vbNullString)
If hApp <> 0 Then SetWindowText hApp, NewTitle
End Sub
-
Sep 7th, 2000, 12:16 AM
#6
Thread Starter
Conquistador
how do i find the name i.e "IEFRAME" to change the title of ie
for example
who do i find the name for other instances of ie or msn messenger or vb?
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
|