Click here to Skip to main content
15,922,533 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: What different? Pin
Ravi Bhavnani6-Jun-03 15:04
professionalRavi Bhavnani6-Jun-03 15:04 
AnswerRe: What different? Pin
Mike Nordell7-Jun-03 6:20
Mike Nordell7-Jun-03 6:20 
GeneralOT Pin
Vikram A Punathambekar7-Jun-03 9:48
Vikram A Punathambekar7-Jun-03 9:48 
GeneralRe: What different? Pin
Ravi Bhavnani7-Jun-03 10:31
professionalRavi Bhavnani7-Jun-03 10:31 
GeneralRe: What different? Pin
Mike Nordell7-Jun-03 15:04
Mike Nordell7-Jun-03 15:04 
GeneralRight To Left Writing Pin
Asad Rasheed6-Jun-03 12:25
Asad Rasheed6-Jun-03 12:25 
GeneralSmart Card Inserts & Removes Pin
Fad B6-Jun-03 10:57
Fad B6-Jun-03 10:57 
GeneralWindow Size and position in registry Pin
electronicman_x6-Jun-03 10:11
electronicman_x6-Jun-03 10:11 
2 questions:

Q1:
I'm currently working on an MDI program with controlbars and the Stingray Toolkit. I want to save the program's last size and position in the registry when the program is closed. Currently i'm able to store the controlbars locations into the registry using the SaveBarState function. I basically need to create my own registry key or find some similar function that will store the program's size and position like the SaveBarState function. I'm not really sure how to go about doing this. I can get the information about the program, but i dont know how to store it to the registry properly.

Q2:
The reason I'm doing this is because i want to save the appearance of the program so when it runs again it looks just as it was when it was closed. I also want to be able to size the program according to the screen real-estate on the desktop (the first time it runs or if the resolution changes). The reason for this is i have a few systems im running this program on that use multiple monitors and i dont want the window stretched across them. I also want to have control over the window size and position when it runs. I have some rough code, but i dont know if i should do things this way.

some crappy code im playing with:
(This lets me control the size but im not sure how safe this method is)

//(inside MyApp())

CRect rClientSpace;
CRect rc2;
CWnd * pWndMain;
pWndMain=(CWnd *)pMainFrame;
pWndMain->GetWindowRect(rc2);
SystemParametersInfo(SPI_GETWORKAREA,0,&rClientSpace,0);

//checks horiz. and vert. to make sure it can make this window.
if ( ((rc2.left+1000) < rClientSpace.right)&&((rc2.top+750) < rClientSpace.bottom) )
{
pWndMain->SetWindowPos(NULL, rc2.left, rc2.top, 1000, 750,SWP_NOZORDER);//I want 1000x750 when feasible
}
pWndMain->GetWindowRect(rc2);//to see the results in debugger

Any ideas or code would be great.

Thanks !

Jeff Rothenberg

Project Engineer
Vector CANtech, Inc.
GeneralRe: Window Size and position in registry Pin
Miszou6-Jun-03 11:06
Miszou6-Jun-03 11:06 
GeneralRe: Window Size and position in registry Pin
electronicman_x9-Jun-03 11:11
electronicman_x9-Jun-03 11:11 
GeneralRe: Window Size and position in registry Pin
Neville Franks6-Jun-03 12:12
Neville Franks6-Jun-03 12:12 
GeneralRe: Window Size and position in registry Pin
electronicman_x9-Jun-03 11:14
electronicman_x9-Jun-03 11:14 
GeneralRe: Window Size and position in registry Pin
Neville Franks9-Jun-03 11:36
Neville Franks9-Jun-03 11:36 
Question(Non-programming) Virtual Machine Simulator like VMware? Pin
Dominik Reichl6-Jun-03 9:58
Dominik Reichl6-Jun-03 9:58 
AnswerRe: (Non-programming) Virtual Machine Simulator like VMware? Pin
Daniel Turini6-Jun-03 10:05
Daniel Turini6-Jun-03 10:05 
AnswerRe: (Non-programming) Virtual Machine Simulator like VMware? Pin
Mike Nordell7-Jun-03 6:44
Mike Nordell7-Jun-03 6:44 
GeneralRe: (Non-programming) Virtual Machine Simulator like VMware? Pin
Dominik Reichl7-Jun-03 9:36
Dominik Reichl7-Jun-03 9:36 
GeneralClass Wizard Problems Pin
a2k6-Jun-03 8:32
a2k6-Jun-03 8:32 
GeneralRe: Class Wizard Problems Pin
Cambalindo7-Jun-03 10:22
Cambalindo7-Jun-03 10:22 
GeneralCListView Pin
schoni6-Jun-03 7:58
schoni6-Jun-03 7:58 
GeneralMFC-Buch in Deutsch Pin
schoni6-Jun-03 7:50
schoni6-Jun-03 7:50 
GeneralRe: MFC-Buch in Deutsch Pin
David Crow6-Jun-03 10:40
David Crow6-Jun-03 10:40 
GeneralRe: MFC-Buch in Deutsch Pin
Anonymous7-Jun-03 0:06
Anonymous7-Jun-03 0:06 
GeneralAlign control in Visual C++ Editor Pin
doctorpi6-Jun-03 6:49
doctorpi6-Jun-03 6:49 
GeneralRe: Align control in Visual C++ Editor Pin
Maximilien6-Jun-03 7:04
Maximilien6-Jun-03 7:04 

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.