Can't disable MFC PropertySheet OK Button 
Author Message
 Can't disable MFC PropertySheet OK Button

I am working with MFC in Windows CE which is a little
different than working with MFC in the bigger Windows
operating systems. I have an application that uses a
property sheet. Some of the tasks in the property sheet
take a little bit of time so I want to disable the 'OK'
button on the property sheet until the task is done. For
normal Windows MFC, I would just do something like this:

    pPropSheet->GetDlgItem( IDOK )->EnableWindow( FALSE );

However, for Windows CE, this does not work. Since
the 'OK' button appears in the top part of the window next
to the close button (the 'X'), I thought that it might be
a member of the system menu but I can't find any
references to that. I can disable the close button via the
system menu:

    CMenu SysMenu;
    SysMenu.Attach( GetSystemMenu( pPropSheet->m_hWnd,
FALSE ) );
    SysMenu.EnableMenuItem( SC_CLOSE, MF_GRAYED );
    SysMenu.Detach();

but can't find anything equivalent to SC_CLOSE that would
work for the 'OK' button. Can anybody help me find a way
to disable the 'OK' button on a property sheet in Windows
CE?

Thanks!



Sun, 25 Dec 2005 04:33:54 GMT  
 Can't disable MFC PropertySheet OK Button
This is what  I use :-

#ifdef POCKETPC
 SHDoneButton(this->GetSafeHwnd(), SHDB_HIDE);
#endif

Regards
Roger


Quote:
> I am working with MFC in Windows CE which is a little
> different than working with MFC in the bigger Windows
> operating systems. I have an application that uses a
> property sheet. Some of the tasks in the property sheet
> take a little bit of time so I want to disable the 'OK'
> button on the property sheet until the task is done. For
> normal Windows MFC, I would just do something like this:

>     pPropSheet->GetDlgItem( IDOK )->EnableWindow( FALSE );

> However, for Windows CE, this does not work. Since
> the 'OK' button appears in the top part of the window next
> to the close button (the 'X'), I thought that it might be
> a member of the system menu but I can't find any
> references to that. I can disable the close button via the
> system menu:

>     CMenu SysMenu;
>     SysMenu.Attach( GetSystemMenu( pPropSheet->m_hWnd,
> FALSE ) );
>     SysMenu.EnableMenuItem( SC_CLOSE, MF_GRAYED );
>     SysMenu.Detach();

> but can't find anything equivalent to SC_CLOSE that would
> work for the 'OK' button. Can anybody help me find a way
> to disable the 'OK' button on a property sheet in Windows
> CE?

> Thanks!



Sun, 25 Dec 2005 04:47:33 GMT  
 Can't disable MFC PropertySheet OK Button
Sorry. I forgot to mention that I am using Windows CE for
the Handheld PC, no the PocketPC. I thought that there
would be something generic that I can use in Windows CE.
The function you gave would be perfect for what I want to
do if only it would work for the Handheld PC version.

Quote:
>-----Original Message-----
>This is what  I use :-

>#ifdef POCKETPC
> SHDoneButton(this->GetSafeHwnd(), SHDB_HIDE);
>#endif

>Regards
>Roger



>> I am working with MFC in Windows CE which is a little
>> different than working with MFC in the bigger Windows
>> operating systems. I have an application that uses a
>> property sheet. Some of the tasks in the property sheet
>> take a little bit of time so I want to disable the 'OK'
>> button on the property sheet until the task is done. For
>> normal Windows MFC, I would just do something like this:

>>     pPropSheet->GetDlgItem( IDOK )->EnableWindow(
FALSE );

>> However, for Windows CE, this does not work. Since
>> the 'OK' button appears in the top part of the window
next
>> to the close button (the 'X'), I thought that it might
be
>> a member of the system menu but I can't find any
>> references to that. I can disable the close button via
the
>> system menu:

>>     CMenu SysMenu;
>>     SysMenu.Attach( GetSystemMenu( pPropSheet->m_hWnd,
>> FALSE ) );
>>     SysMenu.EnableMenuItem( SC_CLOSE, MF_GRAYED );
>>     SysMenu.Detach();

>> but can't find anything equivalent to SC_CLOSE that
would
>> work for the 'OK' button. Can anybody help me find a way
>> to disable the 'OK' button on a property sheet in
Windows
>> CE?

>> Thanks!

>.



Sun, 25 Dec 2005 21:55:51 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Force default button on PropertyPage instead of OK button on PropertySheet

2. Newbie, simulate pressing the OK button in a propertysheet

3. Deleting OK button from PropertySheet?

4. Newbie, how to simulate pressing the ok button in a propertysheet

5. Modeless PropertySheet / OK and Apply buttons

6. Modal PropertySheet without Ok and Cancel buttons?

7. HELP: Disabling standard buttons in (Wizard style PropertySheet

8. Enable/Disable OK button on CPropertySheet

9. Disabling OK button in property pages

10. disable or invisible the OK button

11. How to disable OK Button in dialog boxes

12. how to create a window without any close button (include OK button and X button)

 

 
Powered by phpBB® Forum Software