How do I obtain the HINSTANCE for the CreateWindowEX function when using it outside of WinMain?
问题 I am trying to create a popup window when I click a button on my main window, and I am using the CreateWindowEX function for that purpose. However, the CreateWindowEx function recieves the HINSTANCE type variable as its second last parameter. Given that I am making this new window from inside the WndProcedure when a button is being clicked, the HINSTANCE variable in the WinMain function will not be available to me because it is not a global variable. The following code was obtained from the