Check if certain dialog is minimized or not


i just want to get if a certain window is minimized or not with a true false result


local _USER32 =
src=“using System;”
src += “using System.Runtime.InteropServices;”
src += “class _user32”
src += “{”
src += " [DllImport(“User32.DLL”, EntryPoint=“GetWindowLong”)]"
src += " public static extern Int32 GetWindowLong(Int32 hWnd, Int32 index);"
src += “}”

  csharpProvider = dotnetobject "Microsoft.CSharp.CSharpCodeProvider"
  compilerParams = dotnetobject "System.CodeDom.Compiler.CompilerParameters"
  compilerParams.GenerateInMemory = true
  compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(src)
  _user32Assembly = compilerResults.CompiledAssembly
  _user32Assembly.CreateInstance "_user32"


fn getStyle hwnd = (_USER32.GetWindowLong hwnd -16)

(bit.and (getstyle (certain hwnd)) 0x20000000L) != 0

i got this to work but is there any simpler method ?

this code originally written by @denisT on this link

tried to simplify it a little but curious if is there any other way


in newer max versions you can use python libs directly from maxscript. Check Executing Python from MAXScript in the mxs reference

( python.import "ctypes" ).windll.user32.IsIconic hwnd


thanks a million works great and fast