Zu GetModuleHandle:
Zitat aus MSDN: "Retrieves a module handle for the specified module. The module must have been loaded by the calling process.
...
If lpModuleName does not include a path and there is more than one loaded module with the same base name and extension, you cannot predict which module handle will be returned. To work around this problem, you could specify a path, use side-by-side assemblies, or use GetModuleHandleEx to specify a memory location rather than a DLL name.
..."
Die ComCtl32.dll ist üblicherweise schon immer geladen. Die PSAPI.DLL offensichtlich nicht. Daher bringt GetModuleHandle() da auch die 0 als Ergebnis = Modul ist nicht geladen.
Und nun kommt's: GetModuleInformation() verwendet die PSAPI.DLL und lädt diese, wenn sie zuvor nicht geladen wurde. Das lässt sich zeigen, indem Du die Programmzeilen zur Ermittlung des Handles und Namens der PSAPI.DLL nach diesem Aufruf nochmal einbaust.
Zitat aus MSDN: "The GetModuleInformation function does not retrieve information for modules that were loaded with the LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx. Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI version number affects the name used to call the function and the library that a program must load.
If PSAPI_VERSION is 2 or greater, this function is defined as K32GetModuleInformation in Psapi.h and exported in Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetModuleInformation in Psapi.h and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetModuleInformation.
Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as GetModuleInformation."
Ich hoffe, das hilft Dir weiter.
Gruß
Roland