Enabling Default Reply
Collapse the table of content
Expand the table of content

Enabling Default Reply

User32 provides the functionality to intercept every MessageBox function and automatically choose the default button. Not all message box windows are produced through the standard MessageBox function; therefore, this feature might not operate on all windows.

To instruct NTUSER to intercept messages, an additional key and values are required in the HKLM\System\CurrentControlSet\Control registry key. You might need to create the registry key and values on your system, as follows.

To set up your system to automatically reply to a message box without displaying it

  1. In the HKLM\System\CurrentControlSet\Control registry key, create a new key named Error Message Instrument.
  2. Under the Error Message Instrument key, add the values of type REG_DWORD from the following table.
    Value DataDescription
    EnableDefaultReply0x00000001Enables the Enable Default Reply feature.
    EnableLogging0x00000001Enables event logging.
  3. Under the Error Message Instrument registry key, add one of the LogSeverity values of type REG_DWORD from the following table.
    Value DataDescription
    LogSeverity0x00000000 = EMI_SEVERITY_ALLAll message box events are logged.
    LogSeverity0x00000001 = EMI_SEVERITY_USERMessage box events with the dwStyle parameter defined are logged, including MB_USERICON, MB_ICONASTERISK, MB_ICONQUESTION, MB_ICONEXCLAMATION, and MB_ICONHAND.
    LogSeverity0x00000002 = EMI_SEVERITY_INFORMATIONErrors, warnings, questions, and information are logged. Message box events with no dwStyle parameter or dwStyle = MB_ICONUSER are not logged.
    LogSeverity0x00000003 = EMI_SEVERITY_QUESTIONErrors, warnings, and questions are logged. Information, events with no style, and user-defined severity levels are not logged.
    LogSeverity0x00000004 = EMI_SEVERITY_WARNINGOnly errors and warnings are logged.
    LogSeverity0x00000005 = EMI_SEVERITY_ERROR. (EMI_SEVERITY_MAX_VALUE)Only errors are logged.

To log message information to the event log

  1. In the HKLM\System\CurrentControlSet\Services\EventLog\Application registry key, create a new key named Error Instrument.
  2. Under the Error Instrument key, add the registry values from the following table.
    Value TypeValue

You must reboot your target system for the changes to take effect.

See Also

Message Box and Balloon Pop-Up Interception

© 2006 Microsoft Corporation. All rights reserved.

© 2016 Microsoft