?
Solved

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

Posted on 2011-03-11
4
Medium Priority
?
541 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When I was a beginner in Windows Mobile programming, even for small test I used to create a single MFC dialog-based application with one button, and put my test code in the OnLButtonDown method. For Pocket PC it worked fine, on some Windows CE d…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

762 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