Post: VB.NET Setting an External Program's Title window
08-19-2013, 05:33 PM #1
Default Avatar
Oneup
Guest
(adsbygoogle = window.adsbygoogle || []).push({}); I have been working on making some trainers for some games and I wanted a basic way of showing that a cheat was enabled. I couldn't figured out how to draw to the screen so I figured the title bar would be fine.

    
Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hWnd As IntPtr, ByVal lpString As String) As Boolean

Public Sub SetTitleText(ByVal processName() As Process, ByVal textToSend As String)

For Each proc In processName
SetWindowText(proc.MainWindowHandle, textToSend)
Next
End Sub


The code above will allow you to set the title window to an external program.

An example on how to use it

    
Dim notepad() As Process = Process.GetProcessesByName("notepad")

Private Sub btn_Notepad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Notepad.Click
SetTitleText(notepad,"Insert some text here")

End Sub

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo