當前位置: 首頁>>代碼示例>>Python>>正文


Python win32con.SW_SHOWNORMAL屬性代碼示例

本文整理匯總了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() 
開發者ID:blurstudio,項目名稱:cross3d,代碼行數:15,代碼來源:rescaletime.py

示例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 
開發者ID:AirtestProject,項目名稱:Poco,代碼行數:6,代碼來源:WindowsUI.py

示例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! 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:9,代碼來源:helloapp.py

示例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 
開發者ID:ElevenPaths,項目名稱:uac-a-mola,代碼行數:51,代碼來源:admin.py


注:本文中的win32con.SW_SHOWNORMAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。