本文整理汇总了Python中win32gui.DestroyWindow方法的典型用法代码示例。如果您正苦于以下问题:Python win32gui.DestroyWindow方法的具体用法?Python win32gui.DestroyWindow怎么用?Python win32gui.DestroyWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类win32gui
的用法示例。
在下文中一共展示了win32gui.DestroyWindow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnTaskbarNotify
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def OnTaskbarNotify(self, hwnd, msg, wparam, lparam):
if lparam==win32con.WM_LBUTTONUP:
print "You clicked me."
elif lparam==win32con.WM_LBUTTONDBLCLK:
print "You double-clicked me - goodbye"
win32gui.DestroyWindow(self.hwnd)
elif lparam==win32con.WM_RBUTTONUP:
print "You right clicked me."
menu = win32gui.CreatePopupMenu()
win32gui.AppendMenu( menu, win32con.MF_STRING, 1023, "Display Dialog")
win32gui.AppendMenu( menu, win32con.MF_STRING, 1024, "Say Hello")
win32gui.AppendMenu( menu, win32con.MF_STRING, 1025, "Exit program" )
pos = win32gui.GetCursorPos()
# See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/menus_0hdi.asp
win32gui.SetForegroundWindow(self.hwnd)
win32gui.TrackPopupMenu(menu, win32con.TPM_LEFTALIGN, pos[0], pos[1], 0, self.hwnd, None)
win32gui.PostMessage(self.hwnd, win32con.WM_NULL, 0, 0)
return 1
示例2: TestSetWorldTransform
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def TestSetWorldTransform():
wc = win32gui.WNDCLASS()
wc.lpszClassName = 'test_win32gui_1'
wc.style = win32con.CS_GLOBALCLASS|win32con.CS_VREDRAW | win32con.CS_HREDRAW
wc.hbrBackground = win32con.COLOR_WINDOW+1
wc.lpfnWndProc=wndproc_1
class_atom=win32gui.RegisterClass(wc)
hwnd = win32gui.CreateWindow(wc.lpszClassName,
'Spin the Lobster!',
win32con.WS_CAPTION|win32con.WS_VISIBLE,
100,100,900,900, 0, 0, 0, None)
for x in xrange(500):
win32gui.InvalidateRect(hwnd,None,True)
win32gui.PumpWaitingMessages()
time.sleep(0.01)
win32gui.DestroyWindow(hwnd)
win32gui.UnregisterClass(wc.lpszClassName, None)
示例3: TestGradientFill
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def TestGradientFill():
wc = win32gui.WNDCLASS()
wc.lpszClassName = 'test_win32gui_2'
wc.style = win32con.CS_GLOBALCLASS|win32con.CS_VREDRAW | win32con.CS_HREDRAW
wc.hbrBackground = win32con.COLOR_WINDOW+1
wc.lpfnWndProc=wndproc_2
class_atom=win32gui.RegisterClass(wc)
hwnd = win32gui.CreateWindowEx(0, class_atom,'Kaleidoscope',
win32con.WS_CAPTION|win32con.WS_VISIBLE|win32con.WS_THICKFRAME|win32con.WS_SYSMENU,
100,100,900,900, 0, 0, 0, None)
s=win32gui.GetWindowLong(hwnd,win32con.GWL_EXSTYLE)
win32gui.SetWindowLong(hwnd, win32con.GWL_EXSTYLE, s|win32con.WS_EX_LAYERED)
win32gui.SetLayeredWindowAttributes(hwnd, 0, 175, win32con.LWA_ALPHA)
for x in xrange(30):
win32gui.InvalidateRect(hwnd,None,True)
win32gui.PumpWaitingMessages()
time.sleep(0.3)
win32gui.DestroyWindow(hwnd)
win32gui.UnregisterClass(class_atom,None)
示例4: DestroyViewWindow
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def DestroyViewWindow(self):
win32gui.DestroyWindow(self.hwnd)
self.hwnd = None
print "Destroyed view window"
# Message handlers.
示例5: OnClose
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def OnClose(self, hwnd, msg, wparam, lparam):
win32gui.DestroyWindow(hwnd)
# We need to arrange to a WM_QUIT message to be sent to our
# PumpMessages() loop.
示例6: desktop_name_dlgproc
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def desktop_name_dlgproc(hwnd,msg,wparam,lparam):
""" Handles messages from the desktop name dialog box """
if msg in (win32con.WM_CLOSE,win32con.WM_DESTROY):
win32gui.DestroyWindow(hwnd)
elif msg == win32con.WM_COMMAND:
if wparam == win32con.IDOK:
desktop_name=win32gui.GetDlgItemText(hwnd, 72)
print 'new desktop name: ',desktop_name
win32gui.DestroyWindow(hwnd)
create_desktop(desktop_name)
elif wparam == win32con.IDCANCEL:
win32gui.DestroyWindow(hwnd)
示例7: execute_menu_option
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def execute_menu_option(self, id):
menu_action = self.menu_actions_by_id[id]
if menu_action == self.QUIT:
win32gui.DestroyWindow(self.hwnd)
else:
menu_action(self)
示例8: quit
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def quit(cls):
"""Quit the program."""
win32gui.DestroyWindow(cls.hwnd)
#Example usage
示例9: _close
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def _close(klass, hwnd, msg, wparam, lparam):
win32gui.DestroyWindow(hwnd)
return
示例10: execute_menu_option
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def execute_menu_option(self, id):
if id == _ID_QUIT:
win32gui.DestroyWindow(self.main_frame.hwnd)
elif id == _ID_OPEN_FOLDER:
self.open_folder()
elif id == _ID_OPEN_WEBFRONT:
self.open_ui()
elif id == _ID_OPEN_CONSOLE:
self._show_console()
elif (_ID_NOTICE <= id < (_ID_NOTICE + base.NUM_OF_NOTICES)):
self._show_notice(id)
elif (_ID_STATUS_AVAILABLE <= id <= _ID_STATUS_DND):
self._update_user_status(id)
示例11: _terminate
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def _terminate(self):
win32gui.DestroyWindow(self.main_frame.hwnd)
示例12: execute_menu_option
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def execute_menu_option(self, id):
menu_action = self.menu_actions_by_id[id]
if menu_action == self.QUIT:
win32gui.DestroyWindow(self.hwnd)
else:
menu_action(self)
示例13: Destroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def Destroy(self):
win32gui.DestroyWindow(self.hwnd)
示例14: __del__
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def __del__( self ):
if hasattr( self, 'handle' ):
win32gui.DestroyWindow( self.handle )
示例15: destroy
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import DestroyWindow [as 别名]
def destroy( self ):
self.set_systray( None, None )
win32gui.DestroyWindow( self.window_handle )
win32gui.UnregisterClass( self.window_class_name, self.module_handle )
self.window_handle = None