StopWatchMode function

[StopWatchMode is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

Retrieves a value that indicates which performance information is being logged.


DWORD StopWatchMode(void);


This function has no parameters.

Return value


The current stopwatch mode. If performance information is not being logged, then the stopwatch mode is zero. Otherwise, it consists of one or more of the following flags.

SPMODE_SHELL0x00000001Logs selected Windows Explorer actions.
SPMODE_DEBUGOUT0x00000002Has no effect.
SPMODE_TEST0x00000004Has no effect.
SPMODE_BROWSER0x00000008Logs selected activities of the Windows Explorer or Internet Explorer browser frame. This flag cannot be combined with SPMODE_EVENTTRACE.
SPMODE_FLUSH0x00000010Has no effect.
SPMODE_EVENT0x00000020Has no effect.
SPMODE_MSVM0x00000040Logs selected times for initializing the Microsoft VM.

Windows 2000: Indicates in the log which entries affect the browser frame.

Windows XP: Has no effect.

SPMODE_PROFILE0x00000100Has no effect.
SPMODE_DEBUGBREAK0x00000200Breaks into the debugger after each log entry is created. If there is no debugger available, the program halts with a STATUS_BREAKPOINT exception.
SPMODE_MSGTRACE0x00000400Enables message performance logs.
SPMODE_PERFTAGS0x00000800Has no effect.
SPMODE_MEMWATCH0x00001000Has no effect.
SPMODE_DBMON0x00002000Has no effect.
SPMODE_MULTISTOP0x00004000Logs all "stop" operations even if there is only one matching "start".
SPMODE_EVENTTRACE0x00008000Logs selected activities of the MSHTML rendering engine. This flag cannot be combined with SPMODE_BROWSER.



To enable performance logging, set the following REG_DWORD registry value. You should restart your computer after setting this value, to ensure that the change has taken effect.


The information in the performance log is intended for internal measurement purposes and the exact contents change regularly. Performance logging in its current form is subject to change in the future.

Enabling performance logging degrades performance slightly.

Note  When using Windows XP with Service Pack 2 (SP2) and later, performance data is not collected for a process until that process calls the StopWatchMode function for the first time, even if the above registry value has been set to a nonzero value.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

End of client support

Windows XP

End of server support

Windows Server 2003




Shlwapi.dll (version 5.0 or later)

See also