The only "help" I can provide, the Command Panel line from windows.getChildrenHWND #max:
Max2018.4:
#(3935548P, 31197526P, 31197526P, "Qt5QWindowIcon", "CommandPanelWindow", 0P, 31197526P, 31197526P)
Max2016.4:
#(1923704P, 5331588P, 5331588P, "#32770", "Command Panel", 5331588P, 5331588P, 5331588P)
But with that line of code you will not get a handle anyway if the command panel is floating. It's a child of the desktop, not max in this case. I wonder how one is supposed to solve this properly.
Good Luck