Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
I recently asked a question (http://www.experts-exchange.com/Programming/Smartphones/Android/Q_28684946.html) about Computer Inventory applications for Mobile Devices.  I was specifically interested in an app I could use on my android phone.  The be…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

618 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