[Win32 API]Child Dialog woes

Started by
1 comment, last by Clash Rocker 22 years, 10 months ago
OK, I have a my main program dialog, which has a menu and a tree view. At some time in the program the user will activate a child dialog to be displayed. Now when this happenes I get troubles. 1)When right clicking on title bar or left clicking on small icon: The system menu doesn''t show up. 2)I completely lose focus of my menu on treeview. Thou when I click repeatedy on the treeview control some, but not all of the tree view nodes show up... Child dialog stuff:
  
DLGTEMPLATE*         g_pChildDlgs[2];
//....

	g_pChildDlgs[0] = (DLGTEMPLATE *)LockResource(LoadResource(g_hMainInst, FindResource(0, MAKEINTRESOURCE(IDD_ONE), RT_DIALOG)));
	g_pChildDlgs[1] = (DLGTEMPLATE *)LockResource(LoadResource(g_hMainInst, FindResource(0, MAKEINTRESOURCE(IDD_TWO), RT_DIALOG)));
//....

	hChildDlg =  CreateDialogIndirect(g_hMainInst, g_pChildDlgs[0], hWnd, OneDlgProc);
	ShowWindow(hChildDlg, SW_SHOW);
  
Proc:
  BOOL CALLBACK OnetsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch(uMsg)
	{
		case WM_INITDIALOG:
		{
			SetWindowPos(hDlg, HWND_TOP, 193, 25, 0, 0, SWP_NOSIZE);
			return TRUE;
		}
		break;
	}
	return TRUE;
}
  
..anyone?.... One Must Fall: Battlegrounds
Advertisement
I''m kinda guessing, but it sounds as thought the child dialog is modal; but I see you call CreateDialogIndirect as though you''re creating a modeless dialog.

Is the child modeless?
Is the treeview on the main dialog or the child?
Is the system menu that doesn''t work on the child or the main?

Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Its all modeless.
Treeview is on the main dlg. System menu is on the main dialog.
The other drop down menu is on the main dlg too.

My child dlgs are setup as follows:
"Styles"
Style: Child
Border: None
"More Styles"
[X]Visible
[X]Control

I''ve done the very same setup before and it worked fine.

This topic is closed to new replies.

Advertisement