Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
MyPanel *myPanel = nullptr;
 
static HWND NavItemCreateWindow(NAVCREATEITEM* pCs)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	if ( myPanel == nullptr )
	{	
		myPanel = new MyPanel();
		myPanel->Create(pCs->hParent, CRect(pCs->rcWnd));			// The parent window and required rect for your window is passed in the NAVCREATEITEM structure
	}
	return myPanel->GetHwnd();
}

When the WMC disconnects from a WinGate Engine, the entire window hierarchy is destroyed and all GUI components are unloaded. However, If you need to close your window under your control you can do so at any appropriate time such as in your component's Stop() function or when it receives a COMPONENT_NOTIFY_PREDISCONNECT message in it's Notify callback.