locked
How can I get hwnd from another window? RRS feed

  • Question

  • How can I get hwnd from another window?
    Sunday, June 24, 2012 6:29 PM

Answers

  • Try EnumWindows and GetWindowThreadProcessId to find all top-level windows with a process ID that matches the one you're looking for.

    More detail in THIS MSDN article. It is from 2002 but right now I can't recall anything new from Vista in that area.


    If you find this p☺st helpful please remember to hit <Vote As Helpful> √ 1. Whiter than the white is UV bright! 2. Eat your vegetables or you are going to turn in to blobs of lazy fat! 3. Fruits won't cut it 4 wheel drive with levers to lock differentials was a hack. Always pass your objects as pointers or references and remember to clean ALL the keys from registry when you do uninstall.


    • Edited by D3F84U Sunday, June 24, 2012 7:09 PM
    • Proposed as answer by Elegentin Xie Tuesday, June 26, 2012 8:33 AM
    • Marked as answer by Elegentin Xie Thursday, June 28, 2012 6:27 AM
    Sunday, June 24, 2012 7:08 PM

All replies

  • Try EnumWindows and GetWindowThreadProcessId to find all top-level windows with a process ID that matches the one you're looking for.

    More detail in THIS MSDN article. It is from 2002 but right now I can't recall anything new from Vista in that area.


    If you find this p☺st helpful please remember to hit <Vote As Helpful> √ 1. Whiter than the white is UV bright! 2. Eat your vegetables or you are going to turn in to blobs of lazy fat! 3. Fruits won't cut it 4 wheel drive with levers to lock differentials was a hack. Always pass your objects as pointers or references and remember to clean ALL the keys from registry when you do uninstall.


    • Edited by D3F84U Sunday, June 24, 2012 7:09 PM
    • Proposed as answer by Elegentin Xie Tuesday, June 26, 2012 8:33 AM
    • Marked as answer by Elegentin Xie Thursday, June 28, 2012 6:27 AM
    Sunday, June 24, 2012 7:08 PM
  • manWithBallsOfSteel wrote:

    How can I get hwnd from another window?

    From which other window? What do you know about the particular window  you are interested in?


    Igor Tandetnik

    Monday, June 25, 2012 4:12 AM