Advertisement

Dialog Box?

Started by July 28, 2000 06:06 PM
1 comment, last by cyberben 24 years, 4 months ago
Hi there, I''m writing my own setup program from scratch, which isn''t that hard, except I''m stuck at one thing. In a nice proffesional setup program you have a next/back buttong system to cycle through a number of panels of collecting information, well at first I just had 6 different dialog boxes, when you pressed next it would unload that dialog and load the next... It worked however it would blink between boxes and wasn''t that professional. So I went looking for more info and found CreatePropertySheetPage, an API call which is supposed to allow you to create a series of pages which you cycle thorugh just like this. Is this what I want? Ic ouldn''t get it to work myself. Does anyone have an example or source to a setup program? Or even a tutorial on Setup Programs? I really don''t have to do much more than confirm a user Registration number and setup some shortcuts. Oh yah! If you know how to create shortcuts in the startmenu and on the desktop that''d be great too! I know you simply get the directory of the Desktop from the registry and write a shortcut in that directory but how do you write a shortcut? Thanks! - Ben __________________________ Mencken's Law: "For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, forecasting the relentless march of science in 1949
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
I don't have a lot of time, so hopefully someone can cover any holes I leave.

The type of dialog box you are talking about is called a Wizard, which is just made from the PropertySheet and PropertyPage objects, so you are on the right track. MFC has some nice classes for doing these if you know how to use MFC.

As far as shortcuts go, I actually don't remember off hand, but my guess would be that they are created using the shell commands. If you look up in the documentation, you should be able to find what you are looing for. Oh, shortcuts are usually referred to as "Shell Links" in the programming docs. I know there is some information in MSDN about it, but I don't have the time to search there myself.


Edited by - I-Shaolin on July 28, 2000 12:02:23 AM
Advertisement
Try this using Win32:

    //---------------------------------------------------------------------------BOOL CALLBACK DlgProcMail(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam){	switch(uMsg)	{	case WM_INITDIALOG:		{				return TRUE;		}		case WM_COMMAND:			switch(LOWORD(wParam))	//HIWORD(wParam)==BN_CLICKED			{	case IDOK:				case IDCANCEL:					EndDialog(hDlg, 0);					return TRUE;			}			break;	}	return FALSE;}//---------------------------------------------------------------------------void __fastcall DoPropertySheet(HWND hWndOwner){    HINSTANCE hInst = (HINSTANCE)GetWindowLong(hWndOwner, GWL_HINSTANCE);    PROPSHEETPAGE psp[2];    PROPSHEETHEADER psh;    psp[0].dwSize = sizeof(PROPSHEETPAGE);    psp[0].dwFlags = 0;//PSP_USECALLBACK;//PSP_USEICONID;// | PSP_USETITLE;    psp[0].hInstance = hInst;    psp[0].pszTemplate = MAKEINTRESOURCE(IDD_INTERNET);    psp[0].pfnDlgProc = (DLGPROC)DlgProcInternet;    psp[1].dwSize = sizeof(PROPSHEETPAGE);    psp[1].dwFlags = 0;//PSP_USECALLBACK;//PSP_USEICONID;// | PSP_USETITLE;    psp[1].hInstance = hInst;    psp[1].pszTemplate = MAKEINTRESOURCE(IDD_MAIL);    psp[1].pfnDlgProc = (DLGPROC)DlgProcMail;    psh.dwSize = sizeof(PROPSHEETHEADER);    psh.dwFlags = PSH_USEICONID | PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW;    psh.hwndParent = hWndOwner;    psh.hInstance = hInst;    psh.pszIcon = MAKEINTRESOURCE(IDI_TASKBAR);    psh.pszCaption = (LPSTR) "Mail Properties";    psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);    psh.nStartPage = 0;    psh.ppsp = (LPCPROPSHEETPAGE)&psp    psh.pfnCallback = NULL;    PropertySheet(&psh);}    


This topic is closed to new replies.

Advertisement