My Win32 application is built with runtime packages. We may always use HInstance as a reference to know the runtime package of current execution point for a process.
My application may load few runtime packages at runtime. Given an object, is that possible to know which runtime package (or package THandle) the object (or class) belongs to?
You can use FindClassHInstance for this, but whether it returns a package or the exe file will depend upon whether you build with runtime packages or not.
var
instance: HMODULE;
begin
instance := FindClassHInstance(TButton);
Caption := GetModuleName(instance);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With