Game Development Reference
If you select a command from the extension, you will see a message similar to the
one shown in Figure 41.3.
Command executed through the context menu extension.
Running the integrated executable as a normal console application will result in a
message similar to the one shown in Figure 41.4.
Figure 41.4 Command executed through the integrated console application.
Developing and debugging shell extensions has never been an easy task, especially
because the shell holds a copy of the previously loaded DLL. This can lead to prob-
lems overwriting the file or a change not being reflected until the shell is restarted
because of the local copy in memory.
A useful trick is to build a simple Win32 C++ application using the following
code, which will stop and restart the shell, removing the cached copy of the DLL.
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
HWND hwnd = FindWindow(“Progman”, NULL);
PostMessage(hwnd, WM_QUIT, 0, 0);
ShellExecute(NULL, NULL, “explorer.exe”, NULL, NULL, SW_SHOW);