Change of className in 64-bit v16

We use the FindWindowsEx function https://msdn.microsoft.com/en-us/library/windows/desktop/ms633500(v=vs.85).aspx to retrieve a handle for the main 4D window in our plugin. We normally do this by setting the class name to the path of the 4D.exe file:

handle = FindWindowEx( NULL, NULL, pathTo4DExecutable, NULL ); /* where pathTo4DExecutable is the path to 4D.exe */

In V16, 32-bit the “className” is still the same as previous versions (the path to the 4D executable). However, in 4D V16, 64-bit the class name has changed to: “XTB_MAIN_MDI_CE02B642”.

  1. Is “XTB_MAIN_MDI_CE02B642” dynamic?
  2. Will it ever change between versions?
  3. How is the class name derived?

Thanks,

Spencer Lerch
Development Team Lead
Orchard Software

Hi,

  1. Is “XTB_MAIN_MDI_CE02B642” dynamic?
    Yes, main window class name depends on executable path

  2. Will it ever change between versions?
    The root should not change

  3. How is the class name derived?
    It’s not public

If you want to retreive the main window, use the entry point 719.
It is not documented yiet but available in 16.x (32 & 64) here is sample code.

HWND PA_GetMainWindowHWND()
{
HWND result = NULL;
EngineBlock pb = {0};
Call4D( -719, &pb );
if(pb.fError==0)
result = (HWND)pb.fParam1;
return result;
}

Regards
Patrick