3ds max pymxs 判断max窗口是否置顶

import ctypes
from pymxs import runtime as rt

user32 = ctypes.windll.user32
GA_ROOTOWNER = 3

def isMaxForeground():
    fgw = user32.GetForegroundWindow()
    fgw_root = user32.GetAncestor(fgw, GA_ROOTOWNER)
    
    return fgw_root == rt.windows.getMAXHWND()

在maxscript中,获取user32是这样实现的:user32 = (python.import ctypes).windll.user32

posted @ 2024-07-24 14:23  ibingshan  阅读(13)  评论(0编辑  收藏  举报