Reputation: 1214
I need to create a Window that will follow an external program (ie. Notepad.exe). When user move Notepad.exe to a new position in the Desktop, I want my Window to move also.
I did some research :-
Using SetParent (where parent is Notepad)- I got this render initially, moving Notepad will not render my Window.
Using SetWindowPos and SetWindowHook on Notepad.
Using SetWindowSubClass. This doesn't work, getting error code. Possibly Notepad is a different process.
I am thinking no.2 is the path I want to go deeper. Do you think this is the right path? Is this overkilling?
Upvotes: 0
Views: 191
Reputation: 3102
See the SetWinEventHook function.
Also see the SetWindowsHookEx function, specifically the WH_GETMESSAGE
hook may be of use.
Upvotes: 2
Reputation: 774
You can possibly use Windows Hooks to monitor Window movements and Mouse Input. Perhaps that can be an alternative?
http://msdn.microsoft.com/en-gb/library/windows/desktop/ms644960(v=vs.85).aspx
Upvotes: 1