I have a DLL in which I want to play sounds using Direct Sound. To play sounds, I need an HWND executable. I do not have an HWND executable that loads the DLL. How do I get this in a DLL without passing it from an executable?
You can use GetCurrentProcessId to get the current process id.
You can then call EnumWindows and check each window with GetWindowThreadProcessId to find the window associated with your process.
. 1x1, , Direct Sound.
, ( ).
GetGUIThreadInfo . HWND. HWND , ( ) GetAncestor(GA_ROOT).
GetGUIThreadInfo
GetAncestor(GA_ROOT)
Source: https://habr.com/ru/post/1742609/More articles:What happens to this reverse bit order function? - cMySQL error order in PHP - phpStandard map / associative array structure for use in flash actionscript 3? - flexWhat are the benefits of GWT giving me Silverlight? - silverlightMessage Processing in Console Applications / DLL in C ++ Win32 - c ++viewForHeaderInSection disappears when scrolling - iosChoosing custom XML tags with phpQuery - xmlСписок неинтересных слов - text-processingPHP УДАЛИТЬ сразу после выбора - phpIs it faster to use a complex boolean to restrict the ResultSet at the end of MySQL or at the end of Java? - javaAll Articles