(SDK) UIAccessor ... How can DLL related data be found using HWND?

(SDK) UIAccessor ... How can DLL related data be found using HWND?

denisT.MaxDoctor
Advisor Advisor
683 Views
6 Replies
Message 1 of 7

(SDK) UIAccessor ... How can DLL related data be found using HWND?

denisT.MaxDoctor
Advisor
Advisor

Does anyone know or have an idea about how UIAccessor's GetWindowDllDescription and GetWindowDllFileName methods retrieve DLL information using HWND?

0 Likes
Accepted solutions (1)
684 Views
6 Replies
Replies (6)
Message 2 of 7

denisT.MaxDoctor
Advisor
Advisor

Well... I can find the process (GetWindowThreadProcessId), find all the modules of the process with their paths (EnumProcessModules, GetModuleFileNameEx)... one of those modules is the DLL I'm looking for, but how do I know which one?

0 Likes
Message 3 of 7

denisT.MaxDoctor
Advisor
Advisor

As far as I guess, MAX keeps track of its modules and windows and stores the relevant data in certain internal structures. I don't see any other way yet...

0 Likes
Message 4 of 7

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

О! GetWindowModuleFileName is that simple.

 

 

But now I have a method that collects all the process modules, and hence the file names of all the DLLs used with MAX 😜

 
 
0 Likes
Message 5 of 7

klvnk
Collaborator
Collaborator

isn't that just DllDir ? then from there to all the DllDesc which stores the filename of the plugin.

 

 

 

 

DllDir& dlldir =  ip->GetDllDir();
for(int i = 0; i < dlldir.Count(); ++i)
{
    DllDesc& dlldesc = dlldir[i]; 
    mprintf(_T("%s\n"), dlldesc.fname);
}
 

 

 

 

 

should do it.

 

Ok I misunderstood it's not plugins you're interested in 🙂

0 Likes
Message 6 of 7

denisT.MaxDoctor
Advisor
Advisor

I'd like to clarify the purpose behind all of this. The reason is that certain built-in and third-party plugins and tools create dialogues and windows and pop them up. When operating in batch mode, these pop-ups can be quite bothersome. To address this, I've implemented a hook that monitors these pop-ups and has the capability to conceal them for specific plugins. Therefore, I aim to ensure a precise association between each window and its corresponding plugin.

 

Examples:
Biped - Move All Mode

Skin - the Weight Table

VertexPiant -  the Dialog
Unwrap_UVW - the Editor

etc.

0 Likes
Message 7 of 7

denisT.MaxDoctor
Advisor
Advisor

Maybe there is something I am missing.

My GetWindowModuleFilename method is three times faster than UIAccessor.GetWindowDllFileName. However, my GetWindowDllDescription method is about five times slower than UIAccessor.GetWindowDllDescription.

Perhaps MAX maintains a hash table of DLL descriptions, accessible either by DLL filename or DLL module handler.

0 Likes