Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CProgressCtrl problem in long function Pin
IGx8921-Dec-03 12:57
IGx8921-Dec-03 12:57 
GeneralFinding out which button has focus Pin
blindcop21-Dec-03 8:22
blindcop21-Dec-03 8:22 
GeneralRe: Finding out which button has focus Pin
David Crow22-Dec-03 3:53
David Crow22-Dec-03 3:53 
GeneralUSB Pin
BladeIII21-Dec-03 4:40
BladeIII21-Dec-03 4:40 
GeneralAccurate window sizes Pin
nukenuts21-Dec-03 3:09
nukenuts21-Dec-03 3:09 
GeneralRe: Accurate window sizes Pin
nukenuts21-Dec-03 3:18
nukenuts21-Dec-03 3:18 
GeneralRe: Accurate window sizes Pin
Johann Gerell21-Dec-03 5:19
Johann Gerell21-Dec-03 5:19 
GeneralRe: Accurate window sizes Pin
nukenuts22-Dec-03 3:03
nukenuts22-Dec-03 3:03 
O.K., here's what I did:
I derived a class from CSplitterWnd so I could access the protected members relating to it's border size and the size of the splitter itself. Then in the precreatewindow() of my main frame I used this info to calculate the correct size of my main frame. I also added in the scrollbars sizes.


BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// Set the size and style of the window
cs.style &= ~WS_MAXIMIZEBOX;
// cs.style &= ~WS_MINIMIZEBOX;
cs.style &= ~WS_THICKFRAME;
cs.style &= ~FWS_ADDTOTITLE;

int totalWidth = m_mapViewWidth +
m_tileViewWidth +
m_splitter.GetSplitterSize().cx +
(m_splitter.GetBorderSize().cx * 2) + (SCROLLBAR_WIDTH*2);

int totalHeight = m_mapViewHeight +
(m_splitter.GetBorderSize().cx * 2) + SCROLLBAR_HEIGHT;


CRect rect(0, 0, totalWidth, totalHeight);

AdjustWindowRectEx(&rect, cs.style, true, cs.dwExStyle);

cs.cx = rect.right - rect.left;
cs.cy = rect.bottom - rect.top;

if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;

return TRUE;
}

GeneralRe: Accurate window sizes Pin
Johann Gerell22-Dec-03 11:40
Johann Gerell22-Dec-03 11:40 
General<b>Get Relations Betwwen The Tables</b> Pin
21-Dec-03 0:35
suss21-Dec-03 0:35 
GeneralChanging background and text color using microsoft visual c++ Pin
Asesh shrestha21-Dec-03 0:08
Asesh shrestha21-Dec-03 0:08 
GeneralRe: Changing background and text color using microsoft visual c++ Pin
Robert Kuster21-Dec-03 1:20
Robert Kuster21-Dec-03 1:20 
QuestionmsoControlSplitButtonPopup ??? Pin
YaronNir20-Dec-03 21:53
YaronNir20-Dec-03 21:53 
GeneralCONVERT RGBX to RGBTRIPLE Pin
Member 40481320-Dec-03 21:19
Member 40481320-Dec-03 21:19 
GeneralHide Installing Inf showing display progress bar popup window Pin
rohit.dhamija20-Dec-03 20:00
rohit.dhamija20-Dec-03 20:00 
Generalold c++ compiler Pin
mhmoud rawas20-Dec-03 19:22
mhmoud rawas20-Dec-03 19:22 
GeneralRe: old c++ compiler Pin
Monty220-Dec-03 19:50
Monty220-Dec-03 19:50 
GeneralRe: old c++ compiler Pin
mhmoud rawas20-Dec-03 19:59
mhmoud rawas20-Dec-03 19:59 
GeneralRe: old c++ compiler Pin
ZoogieZork20-Dec-03 19:55
ZoogieZork20-Dec-03 19:55 
GeneralRe: old c++ compiler Pin
mhmoud rawas20-Dec-03 20:00
mhmoud rawas20-Dec-03 20:00 
GeneralProblems with PRINTING Pin
Srdjan Mladenovic20-Dec-03 15:19
Srdjan Mladenovic20-Dec-03 15:19 
GeneralMDI Question Pin
Anonymous20-Dec-03 14:27
Anonymous20-Dec-03 14:27 
GeneralRe: MDI Question Pin
Robert A. T. Káldy20-Dec-03 23:38
Robert A. T. Káldy20-Dec-03 23:38 
GeneralCallback question Pin
Steve Messer20-Dec-03 12:41
Steve Messer20-Dec-03 12:41 
GeneralRe: Callback question Pin
valikac21-Dec-03 4:50
valikac21-Dec-03 4:50 

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.