문제

I'm creating a utility program which draws some (user customizable) icons onto other windows on the desktop using a global hook. As bitmap objects are specific to a process, I'm creating separate HBITMAP objects for these icons in each process before I draw them, and all these handles are stored in a shared segment in the dll.

Now when an icon is removed in my program (by the user), all the HBITMAP objects for it in these different processes should be deleted. Can I do this using DeleteObject() in my main program or do I have to delete each handle in the process in which it was created?

도움이 되었습니까?

해결책

Definitely you have to delete them from a process that created them - even if it works for you, for different windows version it might not.

다른 팁

Handle to GDI Objects are normally private a process. You can check the return value of DeleteObject anyway.

I'm just guessing this one...
you should use a hook, to hook to a different window.

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