Win32: Having a dialog as a child of another window

Started by
37 comments, last by Evil Bill 20 years, 5 months ago
To tell the truth, there are some additional style my dialog uses. They all are, WS_CHILD, WS_VISIBLE, and WS_EX_CONTROLPARENT.
.
Advertisement
Or since you want to see the whole template:

IDD_CATALOG_VIEW DIALOGEX 0, 0, 566, 378STYLE WS_CHILD | WS_VISIBLEEXSTYLE WS_EX_CONTROLPARENTFONT 8, "MS Sans Serif"BEGIN    CONTROL         "List2",IDC_PICLIST,"SysListView32",LVS_REPORT |                     LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,31,272,324    CONTROL         "",IDC_PREVIEW,"Static",SS_BLACKRECT | SS_NOTIFY |                     SS_SUNKEN,284,31,275,160    CONTROL         "",IDC_PROPERTIES,"Static",SS_ETCHEDFRAME | SS_SUNKEN,                    284,203,275,152END 
.
Ahh, i forgot about WS_EX_CONTROLPARENT. If i include that style, the dialog appears, but i can move both the parent window and the dialog around freely, and i can set the focus to either (by clicking them)
Member of the Unban Mindwipe Society (UMWS)
Copying that code (and making up values to go in resource.h) crashes the app (it exists). Removing everything between "BEGIN" and "END" gives the same result as the image i posted, except the window is much bigger.

Edit: Ooh, its working now - i assume it didn't compile the resources or something. Lemme investigate fiurther.

Thanks!

[edited by - Evil Bill on November 11, 2003 9:24:54 PM]
Member of the Unban Mindwipe Society (UMWS)
You can''t use WS_POPUP with WS_CHILD.
.
Ahhh, thats probably what ui was doing wrong before...

Cool, tinkering time!

Thanks immensely
Member of the Unban Mindwipe Society (UMWS)
And what version of Windows are you using? Because the program works perfectly fine on Windows XP on my computer, and on Win2K for a cousin of mine.
.
Win2k - See my edit. I did a rebuild all and it worked perfectly.

Cheers,
Steve
Member of the Unban Mindwipe Society (UMWS)
Yeah, removing the WS_POPUP style from my dialog got it working.
Thanks again.

Cheers,
Steve
Member of the Unban Mindwipe Society (UMWS)

This topic is closed to new replies.

Advertisement