diff options
author | James Ross-Gowan <rossymiles@gmail.com> | 2016-06-10 22:37:29 +1000 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-06-11 15:35:17 +0200 |
commit | 9fcc517cee13ad446ddbf40cd63c013d50fd14d0 (patch) | |
tree | 5b2724f93193b1c07937d1d2a210fbba7c816361 /player/command.c | |
parent | de4c74e5a4a996e8ff431c8f33a32c4b580be203 (diff) | |
download | mpv-9fcc517cee13ad446ddbf40cd63c013d50fd14d0.tar.bz2 mpv-9fcc517cee13ad446ddbf40cd63c013d50fd14d0.tar.xz |
win32: use HINST_THISCOMPONENT
This is a common idiom used in MSDN docs and Raymond Chen's example
programs to get a HINSTANCE for the current module, regardless of
whether it's an .exe or a .dll. Using GetModuleHandle(NULL) for this is
technically incorrect, since it always gets a handle to the .exe, even
when the executing code (in libmpv) is running in a .dll. In this case,
using the wrong HINSTANCE could cause namespace issues with window
classes, since CreateWindowEx uses the HINSTANCE to search for the
matching window class name.
See:
https://blogs.msdn.microsoft.com/oldnewthing/20050418-59/?p=35873
https://blogs.msdn.microsoft.com/oldnewthing/20041025-00/?p=37483
Diffstat (limited to 'player/command.c')
0 files changed, 0 insertions, 0 deletions