|
Hello,
I have to develop a dialog based MFC app in which several dialogs are linked using next/previous buttons, like in all those install apps.
As i dont have much time to do this, and as i havent used C++ in 3 years, i was wondering if a framework, or even some sample source code for such an app existed somewhere.
Thank you for your time.
|
|
|
|
|
you want to look at CPropertySheet and CPropertyPage..
basicly you use the resource editor to create dialogs, but instead of creating dialogs you create Property Pages (set to child instead of popup).. you create these for each of the pages you need.
then to put it all together you do:
CPropertySheet MySheet("This is my installer");
CMyPage1 page1;
CMyPage2 page2;
...
CMyPageN pageN;
MySheet.AddPage(&page1);
MySheet.AddPage(&page2);
...
MySheet.AddPage(&pageN);
MySheet.SetWizardMode();
MySheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;
if (MySheet.DoModal() == ID_WIZFINISH)
{ AfxMessageBox("woop!"); }
the CMyPage1,2,3 are the classes you created from your dialogs(proppages)
in your first page you need
BOOL CMyPage1::OnSetActive()
{
CPropertySheet* psheet = (CPropertySheet*) GetParent();
psheet->SetWizardButtons(PSWIZB_NEXT);
return CPropertyPage::OnSetActive();
} in your middle pages you need
BOOL CMyPage2::OnSetActive()
{
CPropertySheet* psheet = (CPropertySheet*) GetParent();
psheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);
return CPropertyPage::OnSetActive();
} in your last page you need
BOOL CMyPageN::OnSetActive()
{
CPropertySheet* psheet = (CPropertySheet*) GetParent();
psheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH);
return CPropertyPage::OnSetActive();
}
theres enough code to get you started.. if you can't get there from this then you prolly need to read a book or somethin.. there are examples on this stuff in the articles on here..
-dz
|
|
|
|
|
hi
For the EditBox with the style ES_PASSWORD, WM_GETTEXT works fine in case of win98 like versions. But in windows 2K it not works.can anybody explain me the reason?
VIKS
|
|
|
|
|
vikrams wrote:
can anybody explain me the reason?
Security? Are you trying to send WM_GETTEXT from other process?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
YES I am. But what shouid I do to get text from other process
VIKS
|
|
|
|
|
Why do you need this? Are you going to steal somebody's passwords?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Actually I lost my own password. Trying to retrive that by this message
VIKS
|
|
|
|
|
As your already mentioned this does not work on Win2k and above.
But there are some hacks (i.e. hooks, what a nice play on words ) here at codeproject.
Maybe someone knows a direct link, I don't find the article right now.
greets
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
What kind of password it is?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
actaully long ago I configured my INBOX to POP3 mails of my many accounts .Now I forgot my passowrd . I want to access my emails through normal browser.So thought that using WM_GETTEXT I will able to retrive it ! coz it is present in the POP3 configuration dialog box in "*******"
VIKS
|
|
|
|
|
I'm trying to come up with a way to have a popup come up when my edit box receives focus.
I've tried the OnFocus, but there were problems with that.
What I want is a soft-keypad to come up so the user and input data.
Any ideas.
Thanks in advance.
Jim
|
|
|
|
|
Use some kind of static boolean flag variable in OnFocus handler and don't allow renentry into code which opens keypad.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
I see that this is probably the only way with an edit box. But I think there will be a problem of the focus staying on the edit box and the dialog coming up when the window looses then recieves focus will the "cursor" is still in the box.
Is there a command to move the focus to another "safe" place?
|
|
|
|
|
just set focus to another field when the dialog closes?
CEdit* pNextField = (CEdit*)GetDlgItem(IDC_ANOTHERITEM);
pNextField->SetFocus();
??
-dz
www.dzgraphics.com
don't hurt me im a newbie
|
|
|
|
|
Hi,
Anybody knows how create a modal dialog box initially invisible ?
Thanks,
Cristiano
|
|
|
|
|
Well, if it's modal and invisible your UI will be effectively frozen. Why do you want to do this?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
I want to use somes functions and received messages WM_USER in a only function, that will return when all functions and messages have been processed, but no appear the dialog. Like this:
BOOL fMyFunction()
{
//This dialog box have the functions and the
//messages to be processed.
CClassDlg objDlg;
if (objDlg.DoModal() == IDOK)
return TRUE;
else
return FALSE;
//My function will return when all done.
}
[]'s
|
|
|
|
|
In the properties of dialog change the 'visible' property to false.Then add the bool variable to your class.Lets name it m_bFirstShowWindow and in constructor make it true .Then overriden OnWindowPosChanging and put this code in it:
void CYourDlg::OnWindowPosChanging(WINDOWPOS* lpwndpos)
{
CDialog::OnWindowPosChanging(lpwndpos);
if(lpwndpos->flags&SWP_SHOWWINDOW)
{
if(m_bFirstShowWindow)
{
m_bFirstShowWindow=FALSE;
lpwndpos->flags&=~SWP_SHOWWINDOW;
}
}
}
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
I have to say that this method is by Joaquín M López Muñoz.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Then thansks and congradulation for you and Joaquim M López Muñoz, because the method was a success.
[]'s
Cristiano ...
|
|
|
|
|
Hello all,
I was reading here at CP about WndTabs and I've try to download it for several days now from www.wndtabs.com but the site doesn't seem to work. Does anybody knows anything about the status of wndtabs.com site or is there any other place where I can download it?
TIA,
Thomas
|
|
|
|
|
The site is working fine for me.
John
|
|
|
|
|
I need a sample using UDP Socket ..
Do you have ? Do you Know when can I found ?
Tks
|
|
|
|
|
Search Google for "UDP client" and you'll get many topics about programming with UDP sockets!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C# and C++!
|
|
|
|
|
Fellow Elites:
I use MFC created a explorer style SDI, leftside is CLeftView and I add a TreeView to it. On the right hand side I got CHtmlView.
So the problem is that when I double click on one of the Tree Item, the right hand side should load a new HTML Page, using Naviagte2 or LoadFromResouce to do it.
So can any one tell me how to do that?
Pelase
Thanks in Advance.
Andy.
|
|
|
|