Results 1 to 2 of 2

Thread: Get Window Name As HEX/DEC?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2012
    Posts
    75

    Get Window Name As HEX/DEC?

    Hi,

    I am trying to retrieve a Window Named [ test ] as a HEX, or DEC value in Visual Basic.

    When Button1 is Clicked, TextBox1 Will Show The Window [ test ] as either a HEX or DEC value.

    Code Example of FindWindow:

    Code:
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowW" (
          ByVal lpClassName As String, _
          ByVal lpWindowName  As String) As IntPtr
    The Above May Or May Not Be Relevant To The Question..

    If Anyone Can Provide An Example For Me, It Would Be Greatly Appreciated. Thanks

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: Get Window Name As HEX/DEC?

    You make it sound like you are looking for the windows handle, but that's not quite clear. One point is whether the window in question is part of your program or part of some other program. Naturally, it is easier to solve this for a window in your program, but since you are showing an API function, it seems like you are probably looking for the windows handle of a different program.

    Upon reading the question again, I realize that you may not be looking for an actual form, but just a control on a form.

    I guess a bit more description would be good. In any case, if you are looking for the windows handle, then you have a reasonable API method to use (though not quite sufficient if you are looking for a control within a form), and the return can be turned into a string for display in a textbox as either hex or dec, as you wish.
    My usual boring signature: Nothing

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width