How can I get a winMain's HWND hwnd's hInstance application handle without using globals? I'm trying to make a dialog box to be sent to the LRESULT CALLBACK to have certain menu items make it show up. Or is different way to set this up. I've done it with globals already but I can't seem to figure out how to set it up inside the LRESULT CALLBACK I tried
HINSTANCE hInst = (HINSTANCE)GetWindowLongPtr(hwnd, GWL_HINSTANCE);
HWND hDlgbox = CreateDialog(hInst, MAKEINTRESOURCE(ID_TOOL_BOX_CREATE) ,hwnd, ToolProc);
in the wndproc but that only makes it show up once then never appears again when I try to open it using a popupmenu item and the buttons and items don't seem to receive messages in the dialog box when made this way in the wndproc.