Solved

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

Posted on 2011-03-11
4
527 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
  • 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article shows how to setup the internet connectivity on Windows Mobile Emulator.   I assume that you already have Microsoft Visual Studio, Microsoft Windows Mobile SDK's and the emulator installed. The emulator is available with Visual Studi…
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now