本文整理汇总了Python中win32con.SW_SHOW属性的典型用法代码示例。如果您正苦于以下问题:Python win32con.SW_SHOW属性的具体用法?Python win32con.SW_SHOW怎么用?Python win32con.SW_SHOW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类win32con
的用法示例。
在下文中一共展示了win32con.SW_SHOW属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GUIAboutToInteract
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOW [as 别名]
def GUIAboutToInteract(self):
"Called as the GUI is about to perform any interaction with the user"
frame = win32ui.GetMainFrame()
# Remember the enabled state of our main frame
# may be disabled primarily if a modal dialog is displayed.
# Only get at enabled via GetWindowLong.
self.bFrameEnabled = frame.IsWindowEnabled()
self.oldForeground = None
fw = win32ui.GetForegroundWindow()
if fw is not frame:
self.oldForeground = fw
# fw.EnableWindow(0) Leave enabled for now?
self.oldFrameEnableState = frame.IsWindowEnabled()
frame.EnableWindow(1)
if self.inForcedGUI and not frame.IsWindowVisible():
frame.ShowWindow(win32con.SW_SHOW)
frame.UpdateWindow()
if self.curframe:
SetInteractiveContext(self.curframe.f_globals, self.curframe.f_locals)
else:
SetInteractiveContext(None, None)
self.GUIRespondDebuggerData()
示例2: _UpdateUIForState
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOW [as 别名]
def _UpdateUIForState(self):
"""Change the title to reflect the state of the document -
eg ReadOnly, Dirty, etc
"""
filename = self.GetPathName()
if not filename: return # New file - nothing to do
try:
# This seems necessary so the internal state of the window becomes
# "visible". without it, it is still shown, but certain functions
# (such as updating the title) dont immediately work?
self.GetFirstView().ShowWindow(win32con.SW_SHOW)
title = win32ui.GetFileTitle(filename)
except win32ui.error:
title = filename
if self._IsReadOnly():
title = title + " (read-only)"
self.SetTitle(title)
示例3: EditValue
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOW [as 别名]
def EditValue(self, item):
# Edit the current value
class EditDialog(dialog.Dialog):
def __init__(self, item):
self.item = item
dialog.Dialog.__init__(self, win32ui.IDD_LARGE_EDIT)
def OnInitDialog(self):
self.SetWindowText("Enter new value")
self.GetDlgItem(win32con.IDCANCEL).ShowWindow(win32con.SW_SHOW)
self.edit = self.GetDlgItem(win32ui.IDC_EDIT1)
# Modify the edit windows style
style = win32api.GetWindowLong(self.edit.GetSafeHwnd(), win32con.GWL_STYLE)
style = style & (~win32con.ES_WANTRETURN)
win32api.SetWindowLong(self.edit.GetSafeHwnd(), win32con.GWL_STYLE, style)
self.edit.SetWindowText(str(self.item))
self.edit.SetSel(-1)
return dialog.Dialog.OnInitDialog(self)
def OnDestroy(self,msg):
self.newvalue = self.edit.GetWindowText()
try:
index = self.GetNextItem(-1, commctrl.LVNI_SELECTED)
except win32ui.error:
return # No item selected.
if index==0:
keyVal = ""
else:
keyVal = self.GetItemText(index,0)
# Query for a new value.
try:
newVal = self.GetItemsCurrentValue(item, keyVal)
except TypeError, details:
win32ui.MessageBox(details)
return
示例4: OpenHelpFile
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOW [as 别名]
def OpenHelpFile(fileName, helpCmd = None, helpArg = None):
"Open a help file, given a full path"
# default help arg.
win32ui.DoWaitCursor(1)
try:
if helpCmd is None: helpCmd = win32con.HELP_CONTENTS
ext = os.path.splitext(fileName)[1].lower()
if ext == ".hlp":
win32api.WinHelp( win32ui.GetMainFrame().GetSafeHwnd(), fileName, helpCmd, helpArg)
# XXX - using the htmlhelp API wreaks havoc with keyboard shortcuts
# so we disable it, forcing ShellExecute, which works fine (but
# doesn't close the help file when Pythonwin is closed.
# Tom Heller also points out http://www.microsoft.com/mind/0499/faq/faq0499.asp,
# which may or may not be related.
elif 0 and ext == ".chm":
import win32help
global htmlhelp_handle
helpCmd = html_help_command_translators.get(helpCmd, helpCmd)
#frame = win32ui.GetMainFrame().GetSafeHwnd()
frame = 0 # Dont want it overlapping ours!
if htmlhelp_handle is None:
htmlhelp_hwnd, htmlhelp_handle = win32help.HtmlHelp(frame, None, win32help.HH_INITIALIZE)
win32help.HtmlHelp(frame, fileName, helpCmd, helpArg)
else:
# Hope that the extension is registered, and we know what to do!
win32api.ShellExecute(0, "open", fileName, None, "", win32con.SW_SHOW)
return fileName
finally:
win32ui.DoWaitCursor(-1)
示例5: ShowDW
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOW [as 别名]
def ShowDW(self, bShow):
if bShow:
self.toolbar.ShowWindow(win32con.SW_SHOW)
else:
self.toolbar.ShowWindow(win32con.SW_HIDE)
示例6: request_admin_privileges
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOW [as 别名]
def request_admin_privileges():
ASADMIN = 'asadmin'
if sys.argv[-1] != ASADMIN:
script = os.path.abspath(sys.argv[0])
params = ' '.join([script] + sys.argv[1:] + [ASADMIN])
shell.ShellExecuteEx(lpVerb='runas', lpFile=sys.executable,
lpParameters=params, nShow=win32con.SW_SHOW)
sys.exit(0)
示例7: hide
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOW [as 别名]
def hide(self, new=True):
"""Hide a window from the task bar.
Kept the old way just to be on the safe side.
"""
if new:
win32gui.ShowWindow(self.hwnd, False)
else:
self.minimise()
win32gui.ShowWindow(self.hwnd, win32con.SW_HIDE)
win32gui.SetWindowLong(self.hwnd, win32con.GWL_EXSTYLE,
win32gui.GetWindowLong(self.hwnd, win32con.GWL_EXSTYLE) | win32con.WS_EX_TOOLWINDOW)
win32gui.ShowWindow(self.hwnd, win32con.SW_SHOW)
示例8: restore
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOW [as 别名]
def restore(self):
"""归还窗口"""
# 有bug,归还后窗口没有了WS_VISIBLE样式,不可见
widget = self.layout().itemAt(3).widget()
print('restore', widget.hwnd, widget.style, widget.exstyle)
win32gui.SetParent(widget.hwnd, widget.phwnd) # 让它返回它的父窗口
win32gui.SetWindowLong(
widget.hwnd, win32con.GWL_STYLE, widget.style | win32con.WS_VISIBLE) # 恢复样式
win32gui.SetWindowLong(
widget.hwnd, win32con.GWL_EXSTYLE, widget.exstyle) # 恢复样式
win32gui.ShowWindow(
widget.hwnd, win32con.SW_SHOW) # 显示窗口
widget.close()
self.layout().removeWidget(widget) # 从布局中移出
widget.deleteLater()
示例9: set_visibility
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOW [as 别名]
def set_visibility( self, visibility ):
state = win32con.SW_SHOW if visibility else win32con.SW_HIDE
win32gui.ShowWindow( self.window_handle, state )
win32gui.UpdateWindow( self.window_handle )