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.
The code above will allow you to set the title window to an external program.Code: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
An example on how to use it
Code: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





Reply With Quote
Bookmarks