1

私は、Pythonで動作するより興味深いWindowsAeroエフェクトのいくつかを取得しようとしています。

DwmExtendFrameIntoClientArea関数を使用して、Aeroガラスをクライアント領域に拡張できますウィンドウハンドルとMARGINS構造体へのポインタが必要です。Pythonでウィンドウのハンドルを取得する方法はすでに知っています。ただし、マージン構造を作成する方法を知りません。

MARGINS構造、MSDNドキュメント

これが私がこれまでに持っているものです:

import Tkinter as tk
import string
import ctypes

root = tk.Tk()

handle = string.atoi(root.wm_frame(), 0)

dwm = ctypes.windll.dwmapi

# needs pointertomarginsstruct
dwm.DwmExtendFrameIntoClientArea(handel, pointertomarginsstruct)

root.mainloop()
4

1 に答える 1

4

これをテストするためにWin7を実行していませんが、ctypesを使用して構造体を定義してみてください。

class MARGINS(ctypes.Structure):
  _fields_ = [("cxLeftWidth", c_int),
              ("cxRightWidth", c_int),
              ("cyTopHeight", c_int),
              ("cyBottomHeight", c_int)
             ]
margins = MARGINS(1, 2, 1, 1)

dwm.DwmExtendFrameIntoClientArea(handel, ctypes.byref(margins))
于 2011-08-27T17:02:00.080 に答える