Re: SDI app with no Titlebar?
Works fine, but now I'm trying to figure out how to "toggle" back and forth.
I can define a user message to "Freeze" the position by starting with the
TitleBar off (and thick frame to allow resizing). However, I want to allow
the user to "unfreeze" the position so they can drag it to another locaton
with the TitleBar.
The LoadFrame works ok with:
ModifyStyle(WS_CAPTION, 0, SWP_FRAMECHANGED);
But it seems "too late" to call LoadFrame again ... nothing happens. Should
I destroy the frame and recreate? If so, how?
I may try this with a CDialog based app ... I suppose I can Quit the DoModal
and have something like:
int nResponse;
do {
nResponse = dlg.DoModal();
if (nResponse == IDOK) {
// TODO: Dismissed with OK
}
else if (nResponse == IDCANCEL) {
// TODO: Dismissed with Cancel
}
} while ((nResponse != IDOK) && (nResponse != IDCANCEL));
Here is the definition from the NoTitleDlg.rc:
IDD_NOTITLEDLG_DIALOG DIALOGEX 0, 0, 147, 201
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE
EXSTYLE WS_EX_APPWINDOW
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,87,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,87,23,50,14
PUSHBUTTON "Freeze",IDC_FREEZE,87,41,50,14
PUSHBUTTON "Unfreeze",IDC_UNFREEZE,87,59,50,14
END
But I'm very fuzzy what to do within the OnInitDialog function ... or should
I have another IDD_TITLEDLG_DIALOG defined???
"David Ching" <dc@remove-this.dcsoft.com> wrote in message
news:j6Uaj.84285$YL5.42569@newssvr29.news.prodigy.net...
"L.Allan" <l.allan@worldnet.att.net> wrote in message
news:%23rlcKo9QIHA.4752@TK2MSFTNGP05.phx.gbl...
I'm trying to have a SDI (single document interface) application with no
title-bar.
I've been able to get a CDialog based app to have no titlebar, but I want
to use the DocView framework. I don't see how to remove the titlebar with
SDI.
Can this be done in the CMainFrame::PreCreateWindow by adjusting:
cs.style = ?
ModifyStyle(?, ?, ?);