CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2001
    Location
    Hong Kong
    Posts
    12

    Thread Problem for GetWindowText API

    When I try to use GetWindowText in one thread (t1) to get the text of window from the other thread (t2), I have some unknow problem. The call from t1 work normally when t2 window is idle, but the call from t1 is blocking when t2 window is looping for something. t1 is block until t2 window end looping.

    What is this problem? Why t1 is block? How to solve it? This problem also occur when using SendMessage, why?

    Always HMK

  2. #2
    igbrus is offline Elite Member Power Poster
    Join Date
    Aug 2000
    Location
    Los Angeles
    Posts
    4,658
    Because in order to process SendMessage or GetWindowText which involves SendMessage, thread should get to it's message loop. If thread is busy by some other processing, you should wait. I guess you should use some additional thread in order to separate UI and processing

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

Featured