Solved

C++ Win32 TabControl + Dialog (resources)

Posted on 2015-01-12
4
368 Views
Last Modified: 2016-11-10
Hello! How are you?

I'm trying to use resources but i found a problem.

I did a Dialog, added a tabcontrol, i want to use another dialog to display my controls in tab 1, so it's more easy to hide everything.

I'm doing this in the main callback dialog:

case WM_INITDIALOG:{
	MyControls::Instance().AddPageToTab(GetDlgItem(hWnd, IDC_TAB1), Main::Inst().items, "aaaaaaa", 0);
	MyControls::Instance().AddPageToTab(GetDlgItem(hWnd, IDC_TAB1), Main::Inst().items, "bbbbbbb", 1);
	MyControls::Instance().AddPageToTab(GetDlgItem(hWnd, IDC_TAB1), Main::Inst().items, "ccccccc", 2);
	TWin::Inst().hwnd = CreateDialog(NULL, MAKEINTRESOURCE(frmSecond), GetDlgItem(hWnd, IDC_TAB1), (DLGPROC)SecondProc);
	return TRUE;
	break;
}

Open in new window


screenshot about it
frmSecond = "IDD_FORMVIEW" type in visual studio.

IDC_TAB1 the tab control in resources.

What i need to do?

Ty!
0
Comment
Question by:Júlio
  • 2
4 Comments
 

Author Comment

by:Júlio
ID: 40546475
Idk if it is corret, but i'm setting the x,y position to fix it. But when i create it, it should be inside the tabcontrol, no?=(
0
 
LVL 30

Accepted Solution

by:
Zoppo earned 500 total points
ID: 40546917
Hi dm0000,

IMO you have to move the child dialog to down/right because I think it overlaps the tabs of the tab control. And I think it's clear because for a tab control the client-rect equals the window-rect, so placing a child dialog on client coordinate 0, 0 causes it to be place at the top/left of the complete tab control.

I think (allthough I'm not sure coz I didn't test) you can use the TCM_GETITEMRECT message to ask the tab control about the rectangle you can use for the child dialog.

Hope that helps,

ZOPPO
0
 

Author Closing Comment

by:Júlio
ID: 40547223
Yes, i'm doing this. Ty!
0
 

Expert Comment

by:a a
ID: 41882396
me too this problem
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sum28 challenge 31 96
fizzArray  challenge 1 47
ShiftLeft challenge 21 66
Add values of each row in an array 3 33
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now