Solved

How do I on Windows CE 5 Prevent user to close a window.

Posted on 2011-03-11
4
535 Views
Last Modified: 2013-12-27
Hello,
I'am trying to create an application on a windows CE device that user can't close.
I've remove the title bar from the window so there is no more X to close, but when the user push enter button while the window have the focus, the application close.
I would like to trap the event and stop closing.

I do this :
BEGIN_MESSAGE_MAP(CSysPeaXIIDlg, CDialog)
#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
      ON_WM_SIZE()
      ON_WM_CLOSE()
      ON_WM_DESTROY()

      
#endif
      //}}AFX_MSG_MAP
END_MESSAGE_MAP()

#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
      afx_msg void OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/);
      afx_msg void OnDestroy();
      afx_msg void OnClose();

#endif
      DECLARE_MESSAGE_MAP()

When i have set a brakpoint on the ::OnClose and ::OnDestroy events The only one who is called is : OnDestroy ...

Any idea is wellcome
Thanks a lot
0
Comment
Question by:George
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 500 total points
ID: 35108394
override OnOK()
0
 

Author Comment

by:George
ID: 35108405
Sorry beeing so bad :) but how do I do this ?
0
 

Author Comment

by:George
ID: 35108426
Ok I understand i just create a afx_msg void OnOK();
and ::OnOk()
and i do nothing ... and because i do nothing ... window does not close :)

Thanks !!
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 35108462
it depends on what you're using. if this is MFC (looking at "afx_msg") then


      virtual void OnOK();

Put it right after OnInitDialog() declaration in your header file
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With Windows Embedded Handheld, called Windows Mobile, Microsoft re-designed the user interface. The Start Icon moved down to the bottom, inside the menu bar area.   If you need to hide the Start Icon and/or the SIP (soft input panel, softwar…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question