#1
  1. No Profile Picture
    Dude' Where's My JD and Coke
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Newbury, England
    Posts
    37
    Rep Power
    12

    Question SetFocus to a control in a different Process


    I am trying to find out if a control can get focus. I.E Is not blocked by another dialog (Modal dialog). I am calling SetFocus in the hope that it would give me the information i need, it doesn't. because the control is another process hence a different thread to the caller. MSDN say's this function is only successful when the caller is in the same thread as the control. Just wanted to know if there was a way i can get the information i need from the control.

    Thanks in advance.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    NC, USA
    Posts
    364
    Rep Power
    13
    You probably need to ask this question in a Microsoft specific programming board since it doesn't really have anything to do with any of the C-languages, even though you may be programming it in C, C++, or C#.
  4. #3
  5. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    Have you tried calling AttachThreadInput() first?
    http://msdn.microsoft.com/library/de...hreadinput.asp
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  6. #4
  7. No Profile Picture
    Dude' Where's My JD and Coke
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Newbury, England
    Posts
    37
    Rep Power
    12
    Yeah, Looks like the control has been subclassed and told not to allow that kind of operation.
  8. #5
  9. No Profile Picture
    Dude' Where's My JD and Coke
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Newbury, England
    Posts
    37
    Rep Power
    12
    I am going to have to use BM_CLICK with SendMessage and look at the return val of the call to see if it could click the control. If i cant i am going to have to assume that the control or it's parent is blocked. Thanks for the help people!!
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    88
    Rep Power
    12
    Just make a global variable with the other HWND, and then set focus. That's what I do :p (I know, bad programming habbits :p)

IMN logo majestic logo threadwatch logo seochat tools logo