Win32: Having a dialog as a child of another window
To tell the truth, there are some additional style my dialog uses. They all are, WS_CHILD, WS_VISIBLE, and WS_EX_CONTROLPARENT.
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)
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]
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]
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement