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
未经博主允许,禁止直接转载本博客任何内容(可以在文章中添加链接,禁止原文照搬),如需直接原文转载对应文章,请在该文章中留言联系博主,谢谢!!