Advertisement

05.09.2008 at 08:02AM PDT, ID: 23389606 | Points: 300
[x]
Attachment Details
C# application preventing visibility of XP shutdown dialog
Tags: C#/.NET 2.0
I have a C# application that's main purpose is to serve as an application menu to launch third party software.  The main window covers the entire screen, but is not "maximized" or "always on top".

The hardware platform is a custom designed tablet PC, with a Pentium M processor and Windows XP Pro, Tablet edition.

The issue I'm having is enabling the user to shutdown the computer.  In order to perform a shutdown we want the user to press our power button on the front bezel.  This should cause the normal windows response, which we have set to "Ask me what to do".  

When my main windows is being displayed, this works - but only once...  The first press of the button displays the dialog with the typical "standby", "shutdown", "restart" choices.  At that point, if I select "cancel", the window goes away and never comes back.  I believe it's being hidden by my application after the first time based on the fact that if I press Alt-Tab I can see another, unnamed window in the list.  Of course, I can't switch focus, because the keystroke automatically hides that dialog box.  

Some other points of information:  If I run another application (such as IE), pressing the power button always displays the dialog.  Only when my app has the focus do I run into the "first-time only" problem.  In addition, I have an on-screen keyboard that I developed which is "always on top".  If the power button is pressed while the OSK is displayed, my main window appears to come to the foreground and hide the OSK somehow (but still show the shutdown dialog the first time).

Note - there is no handling of this power button in my application - it is connected using the ATX power button pin, so windows should be taking care of it.  It appears to be a strange window interaction behavior.

Thanks for your help,
Mike


Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: gspace74
Question Asked On: 05.09.2008
Participating Experts: 1
Points: 300
Views: 0
Translate:
Loading Advertisement...
05.10.2008 at 04:26AM PDT, ID: 21538524

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 10:04AM PDT, ID: 21548669

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 10:39AM PDT, ID: 21548964

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 02:23PM PDT, ID: 21550646

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.13.2008 at 07:32PM PDT, ID: 21560833

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.14.2008 at 06:42AM PDT, ID: 21564042

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.14.2008 at 07:04AM PDT, ID: 21564305

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.14.2008 at 07:47AM PDT, ID: 21564787

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.14.2008 at 03:02PM PDT, ID: 21569103

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.14.2008 at 03:29PM PDT, ID: 21569258

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.10.2008 at 04:26AM PDT, ID: 21538524

Rank: Sage

Mike,

One possibility would be to design your own shutdown dialog tha you can have control over.  I could help you with that design, if you think that is a possibility.
 
05.12.2008 at 10:04AM PDT, ID: 21548669
Thanks, but I would rather not consider that option at this point.  That fact that it works the first time leads me to believe it can be fixed to work all the time.

Mike
 
05.12.2008 at 10:39AM PDT, ID: 21548964

Rank: Sage

You are going to have to get a handle to the dialog, and bring it on top of your application window which is set to always on top.
 
05.12.2008 at 02:23PM PDT, ID: 21550646
That's the thing - my main window is not always on top, just the OSK.  I don't know why my main window would be hiding the dialog.  Even when the OSK is hidden, the main window is causing the issue...
 
05.13.2008 at 07:32PM PDT, ID: 21560833

Rank: Sage

When the dialog is not visible, did it show or not show?
 
05.14.2008 at 06:42AM PDT, ID: 21564042
OK, I could swear that when I first looked at the issue that the window was being shown, just that it appeared to be behind my application window.  Now it looks like it's not being displayed at all.  When I hit Alt->Tab there is no dialog present in the list.  
 
05.14.2008 at 07:04AM PDT, ID: 21564305
I have a further related/unrelated question, LearnedOne...

I'll be the first to admit that I'm new to windows programming.  I've spent my past 10+ years in the embedded world.  When I started out developing this application, it seemed that C# was the latest language on the scene and it, along with .NET, provided many tools and reusable components to expidite application development.  At this point I'm concerned with the reliability of the framework.  Is .NET being used widely in the industry with successful results?  Are the issues I'm seeing common with windows programming in general, or would using VC++ to redo my application be advantageous?

I'm not trying to start any arguments, but I'm under the gun and am trying to pick the best course of action to remove as many bugs as possible from my applications...

Mike
 
05.14.2008 at 07:47AM PDT, ID: 21564787

Rank: Sage

C# is very good at some things, but may lack a little control that VC++ would have.  The thing that you have to know about VC++ is that you have to handle a lot more, and the syntax rules are very different from C#.  If you came from a Win32 or MFC background, I would say that VC++.NET would be a smooth transition, but if you didn't I would tend to stay away from this.  

.NET is used extensively, and successfully in many places, but that depends on how it is being used, and doesn't guarantee 100% success without a little work.  

Windows programming can be pretty tricky, so if you want some help to get you out from under the gun, then you can give me a better understand as to what you are trying to do, and maybe I can come up with a better game plan.
 
05.14.2008 at 03:02PM PDT, ID: 21569103
I appreciate the input.  At this point, I'm considering starting from a clean slate and building up the application again.  It will still be in C#/.NET, but I can incorporate some lessons learned over the past 6 months and hopefully yield a better product in the end.  At the least try to see if there is somewhere along the way that these nuisances get introduced to understand them better.

Back to the original question.  Did you have any more input/suggestions based on the fact that the dialog box is not being shown at all?  
 
05.14.2008 at 03:29PM PDT, ID: 21569258

Rank: Sage

No, but like I said, I don't know how you are showing the dialog.
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628