Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to suppress windows system message
    primarykey
    data
    text
    <p>I have created a application which copies files from hard disk to Floppy drive using the CopyFile() API. In the middle of the copy process for a large file, if the floppy is removed from the drive then windows system popup's up an error message.</p> <p>I want to suppress this error message that is popped up by the system. I googled and read about SetErrorMode() API used by many applications to solve similar issues and tried using it with all the possible flag options but it fails. Sample code - </p> <p>UINT uOldErrorMode = SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); ::CopyFile("C:\text.dat","A:\text.dat", FALSE); SetErrorMode (uOldErrorMode);</p> <p>SetErrorMode() API fails to suppress the error message. Can anyone help me in understanding why is it not working with for my application?</p> <p>I then came across the below link : <a href="http://support.microsoft.com/kb/128642" rel="nofollow noreferrer">http://support.microsoft.com/kb/128642</a> which talks about the key</p> <p>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows\ErrorMode </p> <p>whose value can be set to 0,1 or 2 to suppress or show the error messages. This solution works for my application but I feel that</p> <p>a. It is not a good programming practices to access the system key directly? there should be a API that should do this. b. Such a code shall fail the UAC when executed on Windows Vista or Windows 7.</p> <p>Can anybody please provide some help with the above issue.</p> <p>Regards, Felix</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload