Announcement

Collapse
No announcement yet.

Get Names of Controls in Windows Application

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Get Names of Controls in Windows Application

    I have a client need to get the names and details of the controls in a Windows application. A few years back, I remember downloading an application that a PB user created.

    You would start the "viewer" application. Then, start the application of interest. You would click on the application of interest's form and it would give you all the information.

    Does anyone know where I can download this?

    Thanks!

    Rich
    _____________________________________________________________________________________
    It's hard when you're up to your armpits in alligators to remember you came here to drain the swamp.
    President Reagan
    February 10, 1982

  • #2
    It's called PBWinSpy. Borje's site:

    http://www.reonis.com/POFFS/index.htm
    kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

    Comment


    • #3
      If you can't find it (I would swear someone posted something in Source Code Forum to do this)...

      WindowFromPoint()
      followed by
      EnumChildWindows()

      .. would let you write one yourself. You can get whatever info you want about the child windows in your callback for EnumChildWindows.

      MCM
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        Rich,
        Funny you should mention something like that, since I am working on something along the lines of "PB Winspy" from Borje except it would be an *.inc file to catch and translate windows messages into code that the programmer would understand.

        (Aka: stuff like 8675309 would translate to Hdlg, %IDC_BUTTON1, %BN_CLICKED, 0)

        which you would know each parameter, the control that it was meant for, etc but from within your own program.

        Still just beginning, but one catch I do have is if 8675309 is the handle to the control, I can find (%WM_USER + 1) as the control id, but not the equates I used (aka: %IDC_BUTTON1 = %WM_USER + 1) where I would like to return "%IDC_BUTTON1"

        Maybe can't be done, maybe can....but still working on it
        Engineer's Motto: If it aint broke take it apart and fix it

        "If at 1st you don't succeed... call it version 1.0"

        "Half of Programming is coding"....."The other 90% is DEBUGGING"

        "Document my code????" .... "WHYYY??? do you think they call it CODE? "

        Comment


        • #5
          Still just beginning, but one catch I do have is if 8675309 is the handle to the control, I can
          find (%WM_USER + 1) as the control id, but not the equates I used (aka: %IDC_BUTTON1 = %WM_USER + 1)
          where I would like to return "%IDC_BUTTON1"
          Cannot be done.
          Well, the utility can ask for a list of the symbols the programmer assigned to controls on the dialogs
          it is about to scan, but even then it is not foolproof. Controls can create embedded child controls, the
          identifiers of which, the programmer has no control over. An impractical solution in my opinion.

          By the way, please don't use WM_xxx as ID symbols for controls. You will confuse your users.

          The following are the standard idenfiers for command buttons on a dialog.
          Note: IDC_STATIC is the identifier that is given to a control when its identifier is not important. For example, a label.
          Code:
          IDC_STATIC  = -1
          IDOK        = 1
          IDCANCEL    = 2
          IDABORT     = 3
          IDRETRY     = 4
          IDIGNORE    = 5
          IDYES       = 6
          IDNO        = 7
          IDCLOSE     = 8
          IDHELP      = 9
          IDTRYAGAIN  = 10
          IDCONTINUE  = 11
          Dominic Mitchell
          Phoenix Visual Designer
          http://www.phnxthunder.com

          Comment


          • #6
            >where I would like to return "%IDC_BUTTON1"

            Once a program is compiled, there are no symbols. %IDC_BUTTON1 has been reduced to a numeric value ( in your case, &h401, WM_USER + 1) .

            Symbolic debuggers build cross-reference tables of "programmer's symbol" to "compiled numeric value" at compile time, but if you had control over this program at compile time, you would not be asking this question, would you?

            MCM
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              > have a client need to get the names and details of the controls in a Windows application

              Let's go back a step. For what purpose do you "need" these details?

              Can't you look at the screen and figure out what kind of control you could use to "do that?"

              MCM
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                I can see where you are going MCM (even though a bit more than see a Button...but know it is a button? or of a button class????"


                Rich,
                Is most (if not all) of your questions solved with Borge's Winspy???

                (short, sweet, and no need for me to hijack someone else's question)

                Engineer's Motto: If it aint broke take it apart and fix it

                "If at 1st you don't succeed... call it version 1.0"

                "Half of Programming is coding"....."The other 90% is DEBUGGING"

                "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                Comment


                • #9
                  > can see where you are going MCM

                  I hope you can, because I have posted similar messages requesting the "What" so the poster can receive multiple suggestions for the "How" only about 6,214 times.

                  If the "what" is "make a new screen which does <something>", then looking at the application requirements as well as the existing screen should be sufficient.

                  If, however, the "what" is an attempt to control a non-cooperating application, that is something else, and likely what is needed to accomplish that is NOT "all details of all controls;" rather what is likely needed is certain specific information about certain specific controls.

                  MCM
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment

                  Working...
                  X