Notifications
Clear all

[Closed] DotNet and Window Focus Index

Hi guys,

I’ve noticed recently that 3ds Max (All versions) seems to have this bug where windows that are meant to float on top of the main 3ds Max Window, fall back behind it when it is focused.

I have seen this with the V-Ray frame buffer, and the old school help file/window from older versions of Max. The only way I know of fixing this is to restart 3ds Max, which can be a real pain. The error seems to occur when the V-Ray frame buffer opens, or the 3ds Max help opens, and other windows are already open.

Has anybody else noticed this? I’m trying to work out if there is a way to ‘reset’ the focus order to set all 3ds Max children windows back on top, but have yet to find anything.

Cheers
Tim

6 Replies

Is what you are looking for ?


-- Set the parent of the form to be Max. 
local maxHandlePointer = (Windows.GetMAXHWND());
local sysPointer = DotNetObject "System.IntPtr" maxHandlePointer;
local maxHwnd = DotNetObject "MaxCustomControls.Win32HandleWrapper" sysPointer;

-- Show the form
form.Show(maxHwnd);

1 Reply
(@gazybara)
Joined: 11 months ago

Posts: 0

Or shorter version


fn maxHW = (dotNetObject "maxCustomControls.win32HandleWrapper" (dotNetObject "System.IntPtr" (windows.getMaxHWND())))
form.show(maxHW ())

Thanks for the replies, but not it’s not what I’m looking for. Also, even shorter:


theFrm = dotNetObject "MaxCustomControls.MaxForm"
theFrm.showModeless()

The dotNet window itself works fine, but it seems to sometimes ‘unstick’ other windows like the 3ds Max help window and V-Ray Frame Buffer when it is open. Both the help window and vrfb will lose their focus order (z index?) and appear behind the 3ds max window. If you click on the 3ds max help window or vrfb, they will jump behind 3ds max. This has happened on multiple computers with multiple versions of 3ds max.

It’s a really odd bug, and I think it may have something to do with 3ds Max itself. I was wondering it it was possible to reset the parent child relationship of all child windows 3ds Max has open to fix the bug, or fix it from happening in the first place.

I get the vrfb falling behind max all the time, its very annoying, and only seems to happen when you have other max windows open. It also can mess up vrfb save dialog leaving you unable to click on anything in max at all, since its modal.

I normally have to click twice to get it back to the foreground, not had any issues with dotnet forms though.

Hmm interesting, cheers for the info Phil. I have never had it happen to a dotNet form directly, but I have had it happen to VRFB and 3ds Max Help with multiple windows open, usually some of them being dotNet forms. I’m not sure if more windows means it is more likely to happen.

It seems to only happen to windows that are parented to the main 3ds Max UI, but with their taskbars not hidden. Both the 3ds Max Help File and the VRFB do this, and they are the two windows that have this behaviour.

If anyone could shed some light onto this I would be very grateful. It’s pretty annoying to have windows fall behind when losing focus.

i have an issue kinda opposite… in my max 2012 sometimes somehow the track view dialog becomes topmost for all max child windows… maxteriously … the everyday fighting with max makes me strong and not bored.