• Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

VB.NET Setting an External Program's Title window

1UP

Member
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.

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

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

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
 
General chit-chat
Help Users


      You do not have the permission to use the chat.
      @ QM|T_JinX: :weed:
      Back
      Top