Click here to Skip to main content
16,013,082 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ copy constructor questions Pin
Tim Smith15-Jun-04 17:48
Tim Smith15-Jun-04 17:48 
GeneralRe: C++ copy constructor questions Pin
Michael Dunn15-Jun-04 18:36
sitebuilderMichael Dunn15-Jun-04 18:36 
GeneralRe: C++ copy constructor questions Pin
Anonymous15-Jun-04 18:55
Anonymous15-Jun-04 18:55 
GeneralRe: C++ copy constructor questions Pin
Michael Dunn15-Jun-04 19:00
sitebuilderMichael Dunn15-Jun-04 19:00 
GeneralRe: C++ copy constructor questions Pin
Tim Smith16-Jun-04 3:16
Tim Smith16-Jun-04 3:16 
GeneralRe: C++ copy constructor questions Pin
Tim Smith16-Jun-04 4:31
Tim Smith16-Jun-04 4:31 
GeneralRe: Sutter's GotW #036 Pin
Tim Smith16-Jun-04 3:45
Tim Smith16-Jun-04 3:45 
GeneralStatus Bar Misplaced Pin
RobertW10015-Jun-04 16:43
RobertW10015-Jun-04 16:43 
Hi,
I am trying to create a simple Dialog Based form but have run into a problem that has me stumped.

My code is something like this:

HWND HWndParent;
WinMain(....) {
HWND HWNDStatus;

HWndParent = CreateWindow("PintrackrApp", "Pintracker",
WS_DLGFRAME|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX
|WS_BORDER, 200, 100, 600, 350, NULL,NULL,
hInstance, NULL);

HWndStatus = StatusBarCreate(hInstance);

ShowWindow(HwndParent,nShowCmd);
ShowWindow(HWndToolbar,nShowCmd); //This is fine
ShowWindow(HWndStatus,nShowCmd);

//Window message loop here
}

HWND StatusBarCreate(HINSTANCE hInstance) {

HWND StatusBar;
RECT rectTest;
int nArray[2];
int nParts;
InitCommonControls();
StatusBar = CreateWindow(STATUSCLASSNAME,"Test Status Bar",
WS_CHILD | WS_VISIBLE | WS_BORDER,
351,0,0,0,HWndParent,NULL,HInstance,NULL);

StatusDC = GetDC(HWndParent);
GetClientRect(HWndParent, &rectTest);
ReleaseDC(HWndParent, StatusDC);

nArray[0] = (rectTest.right)/2;
nArray[1] = (rectTest.right);

GetClientRect(HWndParent,&rectTest);
SendMessage(StatusBar,SB_SETPARTS,sizeof(nArray)/sizeof(nArray[0]), (LPARAM) (LPINT) nArray);
SendMessage(StatusBar,SB_SETTEXT,0(LPARAM) (LPSTR) "TEST STATUS MESSAGE");
SendMessage(StatusBar,SB_SETTEST,1,(LPARAM) (LPSTR) "Test Msg2");
return(StatusBar);
}

Everything compiles ok but when I run the program and display the window I don't see the status bar. If I maximize the window I see the Status Bar displayed about halfway down in my window. Both of the messages and partitions appear to be correct. The status bar is also only as wide as my Toolbar. It does not fill the whole width of my window.

I have tried searching MSDN & Code Project Fourms and the only thing I found suggested checking that my screen resolution is not smaller than my window. The screen resolution is 1024 x 768 and my windwo is 600 X 350. I am Stumped, I thought windows was supposed to be smart enough to place the status bar at the bottom of the window. Any ideas?

RWA
GeneralRe: Status Bar Misplaced Pin
toxcct15-Jun-04 20:52
toxcct15-Jun-04 20:52 
GeneralRe: Status Bar Misplaced Pin
RobertW10016-Jun-04 2:28
RobertW10016-Jun-04 2:28 
GeneralRe: Status Bar Misplaced Pin
toxcct16-Jun-04 2:32
toxcct16-Jun-04 2:32 
GeneralRe: Status Bar Misplaced Pin
RobertW10017-Jun-04 2:11
RobertW10017-Jun-04 2:11 
GeneralIntercept Dialup Connect Requests Pin
matrixprogrammer15-Jun-04 15:12
matrixprogrammer15-Jun-04 15:12 
GeneralRe: Intercept Dialup Connect Requests Pin
Scozturk15-Jun-04 21:25
professionalScozturk15-Jun-04 21:25 
Generaldynamic tooltips Pin
skatepro15-Jun-04 14:41
skatepro15-Jun-04 14:41 
GeneralRe: dynamic tooltips Pin
ohadp15-Jun-04 19:21
ohadp15-Jun-04 19:21 
QuestionEasy way to convert webpage to txt file? Pin
Selevercin15-Jun-04 12:26
Selevercin15-Jun-04 12:26 
AnswerRe: Easy way to convert webpage to txt file? Pin
toxcct15-Jun-04 12:35
toxcct15-Jun-04 12:35 
GeneralRe: Easy way to convert webpage to txt file? Pin
Selevercin15-Jun-04 13:42
Selevercin15-Jun-04 13:42 
GeneralRe: Easy way to convert webpage to txt file? Pin
georgiek5015-Jun-04 14:32
georgiek5015-Jun-04 14:32 
AnswerRe: Easy way to convert webpage to txt file? Pin
palbano15-Jun-04 12:37
palbano15-Jun-04 12:37 
AnswerRe: Easy way to convert webpage to txt file? Pin
Ravi Bhavnani15-Jun-04 18:34
professionalRavi Bhavnani15-Jun-04 18:34 
GeneralCALLBACK aka __stdcall Pin
Igor Mihailov15-Jun-04 10:04
Igor Mihailov15-Jun-04 10:04 
GeneralRe: CALLBACK aka __stdcall Pin
palbano15-Jun-04 10:24
palbano15-Jun-04 10:24 
GeneralRe: CALLBACK aka __stdcall Pin
15-Jun-04 10:28
suss15-Jun-04 10:28 

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.