Solved

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

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Check this on live cell-phone, please? 4 60
How to populate my ListView with XML data for Android 2 62
historical call history 6 66
Dictate a list of book titles 12 131
Progress means simplifying, not complicating. Bruno Munari Preface How to detect the name of the internal storage or an SD-card on Windows Mobile device from the desktop application? I got this question, when I was working on a PC applicati…
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 shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

772 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