Any help is greatly appreciated.
Thanks
-Apurva
UINT CALLBACK PropSheetCallback(HWND hwnd, UINT uMsg, LPARAM lParam )
{
switch(uMsg)
{
case PSCB_INITIALIZED:
{
ShowWindow(GetDlgItem(hwnd,IDOK), SW_HIDE);
//DestroyWindow(GetDlgItem(hwnd,IDOK));
}
return 1;
case PSCB_GETVERSION:
return COMCTL32_VERSION;
default:
break;
}
return 0x0;
}
HWND CreatePropSheet( HWND hWnd)
{
HPROPSHEETPAGE hProp1 = CreatePropPages(hWnd,TEXT("Page1"));
HPROPSHEETPAGE hProp2 = CreatePropPages(hWnd,TEXT("Page2"));
HPROPSHEETPAGE hProp3 = CreatePropPages(hWnd,TEXT("Page3"));
HPROPSHEETPAGE hPageArray[3];
hPageArray[0] = hProp1;
hPageArray[1] = hProp2;
hPageArray[2] = hProp3;
PROPSHEETHEADER ps;
memset(&ps, 0x0, sizeof(PROPSHEETHEADER));
ps.dwSize = sizeof(PROPSHEETHEADER);
ps.dwFlags = PSH_USECALLBACK | PSH_MAXIMIZE | PSH_MODELESS;
ps.hwndParent = hWnd;
ps.hInstance = ghInstance;
ps.pszCaption = TEXT("AD-TEST");
ps.nPages = 3;
ps.phpage = hPageArray;
ps.pfnCallback = (PFNPROPSHEETCALLBACK)PropSheetCallback;
HWND hWndPropSheet = (HWND)PropertySheet(&ps);
return hWndPropSheet;
}
Here's an excerpt from the win32 help file on prop sheets:
"The OK and Apply Now buttons are similar; both direct a property
sheet's pages to validate and apply the property changes that the user
has made. The only difference is that choosing the OK button causes
the property sheet to be destroyed after the changes are applied, but
choosing the Apply Now button does not.
When the user chooses the OK or Apply Now button, the property sheet
sends the PSN_KILLACTIVE notification message to the active page,
giving it an opportunity to validate the user's changes. If the page
determines that the changes are valid, it should call the
SetWindowLong function to set the DWL_MSGRESULT value for the page to
FALSE. In this case, the property sheet sends the PSN_APPLY
notification message to each page, directing them to apply the new
properties to the corresponding item. If the page determines that the
user's changes are not valid, it should set DWL_MSGRESULT to TRUE and
display a dialog box informing the user of the problem. The page
remains active until it sets DWL_MSGRESULT to FALSE in response to a
PSN_KILLACTIVE message. An application can use the PSM_APPLY message
to simulate the choice of the Apply Now button.
The Apply Now button is initially disabled when a page becomes active,
indicating that there are not yet any property changes to apply. When
the page receives user input through one of its controls indicating
that the user has edited a property, the page should send the
PSM_CHANGED message to the property sheet. The message causes the
property sheet to enable the Apply Now button. If the user
subsequently chooses the Apply Now or Cancel button, the page should
reinitialize its controls and then send the PSM_UNCHANGED message to
disable again the Apply Now button.
Sometimes the Apply Now button causes a page to make a change to a
property sheet, and the change cannot be undone. When this happens,
the page should send the PSM_CANCELTOCLOSE message to the property
sheet. The message causes the property sheet to change the text of the
OK button to "Close," indicating that the applied changes cannot be
canceled.
Sometimes a page makes a change to the system configuration that
requires Windows to be to restarted or the system rebooted before the
change can take effect. After making such a change, a page should send
either the PSM_RESTARTWINDOWS or PSM_REBOOTSYSTEM message to the
property sheet. These messages cause the PropertySheet function to
return the ID_PSRESTARTWINDOWS or ID_PSREBOOTSYSTEM value after the
property sheet is destroyed.
The property sheet sends the the PSN_RESET notification message to all
pages when the user chooses the Cancel button, indicating that the
property sheet is about to be destroyed. A page should use the
notification to perform cleanup operations."
If you're disabling the ok button try the return key in your program
to see if it's activate when any controls are focused and see if
that's acceptable. Merely hiding the ok button is not always
sufficient.
... Dave
Can you think of anything else
Thanks
A.D.
d...@earthlink.net (Dave Bradshaw) wrote in message news:<3d09ea8b...@news.earthlink.net>...
Regards,
-Roger
"A.D." <apurv...@yahoo.com> wrote in message news:6683e236.02061...@posting.google.com...
> > > file://DestroyWindow(GetDlgItem(hwnd,IDOK));