|
-
Oct 11th, 2000, 03:19 PM
#1
Hello to all,
I have serious problem, whant to change a window caption, i created program to do that, but the problem is that window is showed on the tray bar, i writ the window name on my prog. and writ the second name that i whant to give her, on the tray bar the name is changed but on the own window the name is the same, i realy need help because i need to run a prog that locates the first one and closes him self down.
numibesi
-
Oct 11th, 2000, 03:34 PM
#2
Use SetWindowText.
Code:
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Sub Command1_Click()
SetWindowText hwnd, ByVal "NewText"
End Sub
-
Oct 11th, 2000, 03:56 PM
#3
not working
This is currently my code, but this is renaming my program window caption and i whant to change the othr prog. window caption.
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 W
W = FindWindow(vbNullString, "Cheat 'O Matic")
SetWindowText hwnd, ByVal "WON"
End Sub
numibesi
-
Oct 11th, 2000, 04:02 PM
#4
That's because you are stating your own application as the window to change.
hwnd = Your application's hwnd
Try this:
Code:
Private Sub Command1_Click()
Dim W
W = FindWindow(vbNullString, "Cheat 'O Matic")
SetWindowText W, ByVal "WON"
End Sub
[Edited by Matthew Gates on 10-11-2000 at 05:05 PM]
-
Oct 11th, 2000, 04:05 PM
#5
Yeh, but the prob still there
Yeh i have saw that after i posted the thread, but the problem is the same in the taskbar the name is WON but on the window the caption is Cheat 'O Matic.
I think i will quit. numibesi
-
Oct 11th, 2000, 04:16 PM
#6
Don't quit!!! Stay on with it and someone will help you! Here's the code that will change BOTH the title bar and the status tray:
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
Public Declare Function DrawMenuBar Lib "user32" _
Alias "DrawMenuBar" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Dim W
W = FindWindow(vbNullString, "Cheat 'O Matic")
SetWindowText W, ByVal "WON"
DrawMenuBar W
End Sub
-
Oct 11th, 2000, 04:28 PM
#7
Plese try finding on geocities
You can find the Cheat 'O Matic prog, with geocities help, try Http:\\www.geocities.com ----> advanced search ----> (check) Exact phrase and type Cheat omatic then please meke the download (Very small) and try changind is window title, you will see that it don´t change, but on the traybar it changes.
numibesi
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
|