本文由 简悦 SimpRead 转码, 原文地址 blog.csdn.net
代码:
def WinGUI_Rounded_right_angles(window,V=0):#窗口边缘 1:直角 0:圆角
_, empty_icon_path = tempfile.mkstemp()
window.iconbitmap(empty_icon_path)
DwmApi = ctypes.windll.dwmapi
DwmSetWindowAttribute = DwmApi.DwmSetWindowAttribute
_master = win32gui.GetParent(window.winfo_id())
Value = ctypes.c_int(V)
def dwm_set_window_attribute(type, attribute, size):
DwmSetWindowAttribute(_master,type,attribute,size)
dwm_set_window_attribute(33,ctypes.byref(Value),ctypes.sizeof(Value))
测试:
#直角
a=tk1.Window()
WinGUI_Rounded_right_angles(a,1)
a.mainloop()
#圆角
a=tk1.Window()
WinGUI_Rounded_right_angles(a,0)
a.mainloop()
点个赞吧
Comments | NOTHING