Results 1 to 4 of 4

Thread: Other Application Message Box

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Posts
    64

    Other Application Message Box

    I'm trying to automatically close a window opened by another application. It is a message box, with a very generalized title, (like "ERROR"). What I would like to do is see the actual message box TEXT that is in the box, so I can compare it something else. I do have the exact string it should be, so is there a way to find the message box text like the way you do for the title text? Thanks

  2. #2
    Registered User
    Join Date
    Feb 2003
    Posts
    57
    You would have to find the class of the label in the messagebox - using Spy++ most likely.

    Then you can use FindWindow to get the handle to the messagebox, and use FindWindowEx to get the handle to the label.

    Then you can use GetWindowTextLength and GetWindowText to get the value of the label (most likely).

    After you retrieve the text, you can send a WM_CLOSE message to the messagebox using SendMessage.

    So have a look into some of that.

    s.

  3. #3
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    labels don't have handles as they are static controls.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  4. #4
    Registered User
    Join Date
    Feb 2003
    Posts
    57
    Beats me then.

    Sorry

    s.

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