What I am doing is a hack.
I have written a MFC gui that runs on top of Maya. Everything has been fine for the last few months. But one of the things this gui needs to do is display the Hypershade window and/or the attribute editor.
To make a long story short, I have a bug somewhere in my code. Because when I attempt to open these two maya windows from the API, it causes a crash or a incorrectly drawn ui. Because we are in a bit of a hurry, I resolved the problem by setting up a scriptJob that "listens" to a global variable. when that variable is set, it fires of a mel script that displays the hypershade and/or the attribute window. No side effects--except if the echo all commands is set.
Its a hack with a minor nuisance. I'll have to eventually solve the real problem. But this will get us through our deadline for now.