pyqt练习x3.13

import time

import ctypes

import ctypes.wintypes

SEE_MASK_NOCLOSEPROCESS = 0x00000040

SEE_MASK_INVOKEIDLIST = 0x0000000C

class SHELLEXECUTEINFO(ctypes.Structure):

_fields_ = (

("cbSize",ctypes.wintypes.DWORD),

("fMask",ctypes.c_ulong),

("hwnd",ctypes.wintypes.HANDLE),

("lpVerb",ctypes.c_char_p),

("lpFile",ctypes.c_char_p),

("lpParameters",ctypes.c_char_p),

("lpDirectory",ctypes.c_char_p),

("nShow",ctypes.c_int),

("hInstApp",ctypes.wintypes.HINSTANCE),

("lpIDList",ctypes.c_void_p),

("lpClass",ctypes.c_char_p),

("hKeyClass",ctypes.wintypes.HKEY),

("dwHotKey",ctypes.wintypes.DWORD),

("hIconOrMonitor",ctypes.wintypes.HANDLE),

("hProcess",ctypes.wintypes.HANDLE),

)

ShellExecuteEx = ctypes.windll.shell32.ShellExecuteEx

ShellExecuteEx.restype = ctypes.wintypes.BOOL

sei = SHELLEXECUTEINFO()

sei.cbSize = ctypes.sizeof(sei)

sei.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_INVOKEIDLIST

sei.lpVerb = "properties"

sei.lpFile = "D:\\test.txt"

sei.nShow = 1

ShellExecuteEx(ctypes.byref(sei))

time.sleep(5)

时间: 2024-10-17 00:56:19

pyqt练习x3.13的相关文章

pyqt练习x3

# -*- coding: utf-8 -*- __author__ = 'Administrator' from PyQt4 import QtCore,Qt,QtGui import sys,time,datetime,os,sched,psutil,wmi from tools import Ui_Form class ExTools(QtGui.QDialog): def __init__(self,parent=None): super(ExTools,self).__init__(p

pyqt练习x3.12

import sys from PyQt4.QtGui import * class Browser(QWidget): def __init__(self): super(Browser, self).__init__() self.resize(700, 600) self.setWindowTitle("File Browser") self.treeView = QTreeView() self.fileSystemModel = QFileSystemModel(self.t

pyqt练习x3.20

#_*_ coding: utf-8 _*_ from PyQt4.QtCore import * from PyQt4.QtGui import * import sys QTextCodec.setCodecForTr(QTextCodec.codecForName("utf8")) class FindDialog(QDialog): def __init__(self,parent = None): super(FindDialog, self).__init__(parent

pyqt练习x3.14

import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import * class MyBrowser(QWidget): def __init__(self, parent = None): super(MyBrowser, self).__init__(parent) self.createLayout() self.createConnection() def search(s

pyqt练习x3.21

#!/usr/bin/env python2 "A web browser that will never exceed 128 lines of code. (not counting blanks)" import sys, os, json, tempfile from PyQt4 import QtGui, QtCore, QtWebKit, QtNetwork settings = QtCore.QSettings("ralsina", "dev

pyqt练习x3。1

# -*- coding: cp936 -*- import sys from PyQt4 import QtGui class MessageBox(QtGui.QWidget): def __init__(self,parent=None): QtGui.QWidget.__init__(self,parent) self.setGeometry(300,300,250,150) self.setWindowTitle(u'你想关闭?') def closeEvent(self,event)

pyqt练习x3.3

# -*- coding: cp936 -*- import sys from PyQt4 import QtGui class Tooltip(QtGui.QWidget): def __init__(self,parent=None): QtGui.QWidget.__init__(self,parent) self.setGeometry(300,300,250,150) self.setWindowTitle(u'屏幕提示内容') self.setToolTip(u'这是什么呢?') Q

pyqt练习x3.11

#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################################## #                                                                                      # # Copyright (c) 2009 Jakob

pyqt练习x3.7

# -*- coding: cp936 -*- import sys from PyQt4 import QtGui,QtCore class GridLayout(QtGui.QWidget): def __init__(self,parent=None): QtGui.QWidget.__init__(self) self.setWindowTitle('grid layout') title=QtGui.QLabel('Titel:') authot=QtGui.QLabel('Auhot