Passing (HMENU)4
as the hMenu
parameter to CreateWindowEx
to create a top level window tells the system to attach a menu to it. This menu has the menu handle 4. A menu handle (HMENU
) is returned from functions like CreateMenu
. If the handle is not a valid HMENU
window creation fails.
Your observation, that the window doesn't show up is misleading yourself into believing that the window actually exists. The window doesn't exist, and CreateWindowEx
returns NULL
. Checking return values is advisable, and calling GetLastError
when an API call fails is usually quite helpful.