Hey guys,
I'm running into an issue with a script I'm working on. It's for manipulating shells in the Unwrap UVW window, and unfortunately the UV window likes to steal the focus, sending my floating dialog behind it. Since it's an interactive tool, this renders it pretty unusable, especially if the UV window is maximized! I've done some searching, but I can't find anything, so I figured I'd ask here.
Does anyone know how to bring dialogs to the foreground?
Replies
I did some more testing, and I realized that the issue is due to the way that the UV dialog works: if you mouseover the UV field (not the controls, though), it automatically steals focus.
Is there a solution more elegant than running a timer and constantly stealing focus? What I'm really looking for is a way to have it always-on-top, like you can do with forms in Windows.
EDIT: blech, a timer doesn't work because you just get horrible flashing as the focus is constantly alternating between the UV window and the script window
I've never used it for the UV window, but when you create dotNET forms they tend to go behind the main max window unless you parent it (or use a MaxForm).
In the mean time, for interested parties, I've made the problem less severe by spawning the tool window underneath the cursor, which keeps it in focus until the user mouses off of it, which also means that the user will notice it getting eaten by the UV window. Not a solution at all, but it prevents the previous behavior, which was briefly popping up and then being immediately eaten.
here's the specific code for those interested:
when you use getChildHWND you get a bunch of crap, but the first element is the pointer to that window, which is what you care about when using the parent parameter of createDialog.
With this my big ol' pack o' scripts is nearly done, look forward to a thread soon!