Brokenhope Level: Trainee
 Registered: 15-05-2005 Posts: 1
|
Win32 API, Embedding a dialog?
Ok, you know how when you open notepad, theres a texteditor already there, seems like its part of the main window, and when you open windows calculator theres already a calculator there, with the calculator "embedded" in the main window. I dont know how I can do this, I only know how to open up a seprate dialog box, but I want this to be an actuall part of the main window. Heres the code I typed up for a dialog to use, but im not sure how I can do this.
IDD_CALC DIALOG DISCARDABLE 0, 0, 174, 122
STYLE WS_POPUP | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU
FONT 9, "MS Sans Serif"
BEGIN
EDITTEXT IDC_PROBLEM,7,8,155,12,ES_AUTOHSCROLL
GROUPBOX "Type",IDC_STATIC,7,23,155,39,WS_TABSTOP
CONTROL "Regular",IDC_TYPE_REG,"Button",BS_AUTORADIOBUTTON,13,33,
50,12
CONTROL "Solve for X",IDC_TYPE_SOLVE,"Button",BS_AUTORADIOBUTTON,
13,46,50,12
EDITTEXT IDC_RESULTS,9,76,150,12,ES_AUTOHSCROLL
GROUPBOX "Results",IDC_STATIC,7,65,155,49
PUSHBUTTON "Save",IDC_SAVE,7,93,50,14,WS_DISABLED
END
|
The only way I can think of doing this is open the dialog up from the main window, resize it to the same size as the main window (minus borders), and position it correctly, really sloppy, and I dont know any functions that can accomplish this. Im still really new to Win32 Api (C++) so im still trying to figure out how to do a lot of things. Ive been looking for answers everywhere, but this doesnt seem to be a common problem...
|