#define WIN32_LEAN_AND_MEAN #include #include #include typedef DWORD (WINAPI *ShellShFunc)(HWND hParent, WCHAR *Username, BOOL bHideLogoff); DWORD WINAPI TestShellShutdownDialog(HWND hParent, WCHAR *Username, BOOL bHideLogoff) { HINSTANCE msginaDll = LoadLibrary("msgina.dll"); if(!msginaDll) { printf("ERROR: Unable to load library: msgina.dll.\n"); return 0x60; } ShellShFunc pShellShutdownDialog = (ShellShFunc) GetProcAddress(msginaDll, "ShellShutdownDialog"); if(!pShellShutdownDialog) { printf("ERROR: ShellShutdownDialog could not be loaded or found.\n"); return 0x60; } return pShellShutdownDialog(hParent, Username, bHideLogoff); } int main() { DWORD returnValue = 0; printf("Loading ShellShutdownDialog\n"); returnValue = TestShellShutdownDialog(NULL, L"Carl", FALSE); printf("Return value = %lu", returnValue); return 0; }