本文整理汇总了Python中win32con.SW_SHOWNORMAL属性的典型用法代码示例。如果您正苦于以下问题:Python win32con.SW_SHOWNORMAL属性的具体用法?Python win32con.SW_SHOWNORMAL怎么用?Python win32con.SW_SHOWNORMAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类win32con
的用法示例。
在下文中一共展示了win32con.SW_SHOWNORMAL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: maximizeMax
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOWNORMAL [as 别名]
def maximizeMax(self):
"""
Maximize max to ensure that the Time Configuration button is on the monitor and clickable, and to
ensure that the dialogs will be on screen.
"""
self.restoreMaxWindow = False
maxHwnd = GetWindowHandle()
if GetWindowPlacement(maxHwnd)[1] == win32con.SW_SHOWNORMAL:
ShowWindow( maxHwnd, win32con.SW_MAXIMIZE )
self.restoreMaxWindow = True
QTimer.singleShot(self.timerDelay, self.mouseToTimeButton)
return
self.mouseToTimeButton()
示例2: SetForeground
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOWNORMAL [as 别名]
def SetForeground(self):
win32gui.ShowWindow(self.root.Handle, win32con.SW_SHOWNORMAL) # 先把窗口取消最小化
UIAuto.Win32API.SetForegroundWindow(self.root.Handle) # 再把窗口设为前台,方便点击和截图
return True
示例3: InitInstance
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOWNORMAL [as 别名]
def InitInstance(self):
self.frame = HelloWindow()
self.frame.ShowWindow(win32con.SW_SHOWNORMAL)
# We need to tell MFC what our main frame is.
self.SetMainFrame(self.frame)
# Now create the application object itself!
示例4: runAsAdmin
# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_SHOWNORMAL [as 别名]
def runAsAdmin(cmdLine=None, wait=True):
if os.name != 'nt':
raise RuntimeError, "This function is only implemented on Windows."
import win32api
import win32con
import win32event
import win32process
from win32com.shell.shell import ShellExecuteEx
from win32com.shell import shellcon
python_exe = sys.executable
if cmdLine is None:
cmdLine = [python_exe] + sys.argv
elif type(cmdLine) not in (types.TupleType, types.ListType):
raise ValueError, "cmdLine is not a sequence."
cmd = '"%s"' % (cmdLine[0],)
# XXX TODO: isn't there a function or something we can call to massage command line params?
params = " ".join(['"%s"' % (x,) for x in cmdLine[1:]])
cmdDir = ''
#showCmd = win32con.SW_SHOWNORMAL
showCmd = win32con.SW_HIDE
lpVerb = 'runas' # causes UAC elevation prompt.
# print "Running", cmd, params
# ShellExecute() doesn't seem to allow us to fetch the PID or handle
# of the process, so we can't get anything useful from it. Therefore
# the more complex ShellExecuteEx() must be used.
# procHandle = win32api.ShellExecute(0, lpVerb, cmd, params, cmdDir, showCmd)
procInfo = ShellExecuteEx(nShow=showCmd,
fMask=shellcon.SEE_MASK_NOCLOSEPROCESS,
lpVerb=lpVerb,
lpFile=cmd,
lpParameters=params)
if wait:
procHandle = procInfo['hProcess']
obj = win32event.WaitForSingleObject(procHandle, win32event.INFINITE)
rc = win32process.GetExitCodeProcess(procHandle)
# print "Process handle %s returned code %s" % (procHandle, rc)
else:
rc = None
return rc