Re: How to: Trap System Message Dialog?
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Fri, 20 Jun 2008 10:15:53 -0700
On Fri, 20 Jun 2008 05:03:54 -0700, ESmith <eliana_smith@xxxxxxxxxxx> wrote:
[...]
Testing on Vista, the system dialog will popup first telling the user that
the drive is locked, after clicking away that dialog, my dialog will then
appear - how can I prevent the OS system's dialog from appearing?
I haven't tried this specifically with a "locked USB drive", but I suspect that "locking" the drive just makes it read-only. So you should be able to just check for it being read-only before you try to write to it.
If I recall correctly, there's an unmanaged API that controls whether Windows presents an error message before failing an operation, but I haven't used it since Windows 95. I'm not sure it'd even still be supported. To some extent, if checking for read-only status isn't suitable for your purposes, you probably should just trust the OS to deal with things correctly. The question as to whether an error will be presented to the user when a write to some device fails is really more a contract between the user and the OS. An application intervening or voiding that contract should do so only in the most unusual situations.
Pete
.
- Follow-Ups:
- Re: How to: Trap System Message Dialog?
- From: Jeroen Mostert
- Re: How to: Trap System Message Dialog?
- References:
- How to: Trap System Message Dialog?
- From: ESmith
- How to: Trap System Message Dialog?
- Prev by Date: Re: Reading non-standard XML file?
- Next by Date: Re: ThreadPool, ManualResetEvent and WaitOne()
- Previous by thread: How to: Trap System Message Dialog?
- Next by thread: Re: How to: Trap System Message Dialog?
- Index(es):
Relevant Pages
|