문제

I know how to get and set the handle of another applications window in the code, but I don't know how to set the applications handle at runtime through an edit control. the problem is is that I have to keep compiling my application every time I want to use it, because the handle of the window in application 2 is dynamic.

does anyone have any ideas?

도움이 되었습니까?

해결책

To find current HWND of application window you are interested in, you can enumareate windows using EnumWindows:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms633497%28v=vs.85%29.aspx

or maybe easier is to use FindWindow, if you know its name/class:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms633499%28v=vs.85%29.aspx

you can also use GetWindow to iterate windows:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms633515%28v=vs.85%29.aspx

...lots of possibilities

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top