Microsoft KB Archive/262261

{|
 * width="100%"|

BUG: ShellExecuteExW Fails on Windows 2000

 * }

Q262261

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), on platform(s):
 * the operating system: Microsoft Windows 2000

-

SYMPTOMS
The ShellExecuteExW function fails on Microsoft Windows 2000 when the SEE_MASK_CLASSKEY flag is not specified.

CAUSE
If hkeyClass is not NULL or if it is an invalid value (for example, it is not initialized), then ShellExecuteExW fails, even though hkeyClass should not be used by ShellExecuteExW, because SEE_MASK_CLASSKEY is not specified in the fMask member of the SHELLEXECUTEINFO structure.

RESOLUTION
Assign the hkeyClass member of SHELLEXECUTEINFO to NULL even though SEE_MASK_CLASSKEY is not specified.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

MORE INFORMATION
The problem occurs only with the wide version of ShellExecuteEx, that is, ShellExecuteExW, or when _UNICODE is defined for a project and ShellExecuteEx is used in the manner noted in the &quot;Cause&quot; section.

The workaround is to initialize the hkeyClass member to NULL or initialize the SHELLEXECUTEINFO structure to zero by using ZeroMemory or any other such means of initializing the members of the structure, especially assigning the hkeyClass member to NULL.

Additional query words:

Keywords : kbOSWin2000 kbShellGrp kbDSupport

Issue type : kbbug

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch