Re: How to: Trap System Message Dialog?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • HELP ERROR
    ... 940 printer error code 50c help ... certificate errors internet explorer help ... computer help error message on startup ... help for microsoft windows errors ...
    (sci.geo.fluids)
  • Re: The server has rejected your login. Please verify that your userna
    ... messages telling me that "The server has rejected your login. ... start windows Mail, I can get new mail, send mail, delete mail... ... Here's my exact error message track: ... Windows Mail with my Gmail account today and I'm running into the same issue ...
    (microsoft.public.windows.vista.mail)
  • Re: << SBS news for the week of February 1, 2004>>
    ... > 829358 Overview of the Critical Update for SQL Server 2000 Desktop Engine ... > 831747 Overview of the Business Contact Manager for Outlook 2003 Update: ... > 829114 How to remove and how to install the Windows Small Business Server ... > 831664 "The requested media failed to mount" error message when you try to ...
    (microsoft.public.backoffice.smallbiz)
  • Re: w2k sp4 and sqlsp3a - server continually restarts
    ... Windows 2000" ... 0x00000050' Error Message" ... Messages Occur When You Attempt to Synchronize Exchange Server Mail" ... message or your computer unexpectedly restarts" ...
    (microsoft.public.win2000.general)
  • Re: Why do I frequently get BSODs if I log in too fast?
    ... You May Receive a "Stop 0x1E" Error Message Intermittently in Windows 2000 ... Sfmsrv.sys on a Windows 2000-based server when more than half of the server's users have disconnected. ... frequently got a BSOD within a few seconds of logging in. ...
    (microsoft.public.win2000.general)