Click here to Skip to main content
15,915,019 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Happy Children's day to All! I met a problem. I can't use the derived Class from CSocket in Another Class. Pin
ocean20003-Jun-04 1:57
ocean20003-Jun-04 1:57 
GeneralRe: Happy Children's day to All! I met a problem. I can't use the derived Class from CSocket in Another Class. Pin
HENDRIK R3-Jun-04 2:49
HENDRIK R3-Jun-04 2:49 
GeneralLost/Corrupted Packets with CAsyncSocket Pin
User 127821-Jun-04 15:12
User 127821-Jun-04 15:12 
GeneralRe: Lost/Corrupted Packets with CAsyncSocket Pin
Johnny ²1-Jun-04 23:44
Johnny ²1-Jun-04 23:44 
GeneralRe: Lost/Corrupted Packets with CAsyncSocket Pin
User 127822-Jun-04 2:56
User 127822-Jun-04 2:56 
GeneralRe: Lost/Corrupted Packets with CAsyncSocket Pin
Johnny ²4-Jun-04 1:37
Johnny ²4-Jun-04 1:37 
GeneralRe: Lost/Corrupted Packets with CAsyncSocket Pin
User 127825-Jun-04 6:20
User 127825-Jun-04 6:20 
GeneralSubstitute Tite bar for window Pin
TrungHuynh1-Jun-04 15:09
TrungHuynh1-Jun-04 15:09 
Hello

I created a substitue title bar to replace the original title bar (gradient fill...)
of Dialog or CMDIFrameWnd or CMDIChildWnd.First i remove the original titlebar of windows.
Then i created a substitue window with style :
WS_VISIBLE | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN

and i put this window as the same place as original title bar:

RECT rcWnd;
::GetWindowRect(m_pParentWnd->m_hWnd, &rcWnd);
// The m_pParentWnd is the CWnd of Dialog or
// frame that i pass to this class.

TITLEBARINFO tbi;
tbi.cbSize = sizeof(TITLEBARINFO);
::GetTitleBarInfo(m_pParentWnd->m_hWnd, &tbi);
RECT rcTitlebar = tbi.rcTitleBar;

//Calculate the rect we need to create substitute
// window for titlebar
RECT rcSubstitute = {rcWnd.left, rcWnd.top,
rcWnd.right, rcTitlebar.bottom};

//pszTitle is text on title bar
//The CBMSTITLEBARDIALOG_CLASSNAME is already
register before create window
DWORD dwStyle = WS_VISIBLE | WS_POPUP |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
BOOL bResult = CreateEx(WS_EX_TOOLWINDOW,
CBMSTITLEBARDIALOG_CLASSNAME,
pszWindowName, dwStyle,
rcSubstitute.left,
rcSubstitute.top,
rcSubstitute.right - rcSubstitute.left,
rcSubstitute.bottom - rcSubstitute.top,
m_pParentWnd->m_hWnd,
NULL, NULL );

If the parent window is CMDIFrameWnd or CMDIChildWnd, it's ok
the substistute title bar is put the same place with the original titlebar and have these effects that i want.
But with dialog the substistue title bar was wrong.
(Not the same place with original title bar). ???
I think because the Dialog has WS_POPUP style, and the
Substitue title bar that i create has the same WS_POPUP style. So it's wrong, is it right ? or some another reason.

Please help me. Thanks
GeneralExporting/importing certificates to/from a file to Internet Explorer Pin
joelvolvo1-Jun-04 14:29
joelvolvo1-Jun-04 14:29 
QuestionMultiline edit word wrap bug in XP-themed apps? Pin
David Pritchard1-Jun-04 14:27
David Pritchard1-Jun-04 14:27 
GeneralMultiline cells in grid control. Pin
richiebabes1-Jun-04 12:13
richiebabes1-Jun-04 12:13 
GeneralRe: Multiline cells in grid control. Pin
Nirav Doshi1-Jun-04 23:39
Nirav Doshi1-Jun-04 23:39 
GeneralClosing SDI application Pin
dart131-Jun-04 12:10
dart131-Jun-04 12:10 
GeneralRe: Closing SDI application Pin
Michael Dunn1-Jun-04 13:10
sitebuilderMichael Dunn1-Jun-04 13:10 
GeneralRe: Closing SDI application Pin
dart132-Jun-04 0:32
dart132-Jun-04 0:32 
GeneralMnemonic Keys not working in menus Pin
Anonymous1-Jun-04 11:38
Anonymous1-Jun-04 11:38 
Generalquestion about API Pin
Anonymous1-Jun-04 11:36
Anonymous1-Jun-04 11:36 
GeneralCToolTipCtrl::Create fails... Pin
herbert_chow1-Jun-04 11:35
herbert_chow1-Jun-04 11:35 
GeneralRe: CToolTipCtrl::Create fails... Pin
Diddy2-Jun-04 22:46
Diddy2-Jun-04 22:46 
GeneralRe: CToolTipCtrl::Create fails... Pin
herbert_chow3-Jun-04 6:09
herbert_chow3-Jun-04 6:09 
GeneralToolbar Editor Pin
Bob Stanneveld1-Jun-04 11:06
Bob Stanneveld1-Jun-04 11:06 
GeneralRe: Toolbar Editor Pin
TrungHuynh1-Jun-04 15:22
TrungHuynh1-Jun-04 15:22 
GeneralRe: Toolbar Editor Pin
Bob Stanneveld1-Jun-04 23:25
Bob Stanneveld1-Jun-04 23:25 
GeneralRe: Enumerate registered window messages? Pin
Ryan Binns1-Jun-04 18:14
Ryan Binns1-Jun-04 18:14 
GeneralWeb Query Pin
GWG1-Jun-04 10:43
GWG1-Jun-04 10:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.