Quantcast
Channel: The Old New Thing
Viewing all articles
Browse latest Browse all 24428

re: What happens if I call KillTimer with a NULL hwnd?

$
0
0

>>> So what's your proposal? while ( SetTimer( id ) != ERROR_SUCCESS ) ++id;? The point is, when you install a thread timer your code no longer controls which ID's are in use and which ones aren't.

Exactly, if I *install* a timer then I don't know the ID so passing an ID should fail. In other words, to *create* a timer one should call SetTimer(0, 0) and calling SetTimer(0, InvalidID) should fail. You can still hit another timer accidentally but at least it won't leak.


Viewing all articles
Browse latest Browse all 24428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>