using System;
using System.Runtime.InteropServices; using HWND = System.IntPtr;
using HANDLE = System.IntPtr; namespace Win32
{ public struct DRAGINFO
{
public int uSize;
public POINT pt;
public int fNC;
public string lpFileList;
public int grfKeyState;
}
public struct APPBARDATA
{
public int cbSize;
public HWND hwnd;
public int uCallbackMessage;
public int uEdge;
public RECT rc;
public int lParam;
}
public struct SHFILEOPSTRUCT
{
public HWND hwnd;
public int wFunc;
public string pFrom;
public string pTo;
public short fFlags;
public int fAnyOperationsAborted;
public HANDLE hNameMappings;
public string lpszProgressTitle;
}
public struct SHNAMEMAPPING
{
public string pszOldPath;
public string pszNewPath;
public int cchOldPath;
public int cchNewPath;
}
public struct SHELLEXECUTEINFO
{
public int cbSize;
public int fMask;
public HWND hwnd;
public string lpVerb;
public string lpFile;
public string lpParameters;
public string lpDirectory;
public int nShow;
public HANDLE hInstApp;
public int lpIDList;
public string lpClass;
public HANDLE hkeyClass;
public int dwHotKey;
public HANDLE hIcon;
public HANDLE hProcess;
}
public struct NOTIFYICONDATA
{
public int cbSize;
public HWND hwnd;
public int uID;
public int uFlags;
public int uCallbackMessage;
public HANDLE hIcon;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = )] public string szTip;
}
public struct SHFILEINFO
{
public HANDLE hIcon;
public int iIcon;
public int dwAttributes;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Kernel.MAX_PATH)] public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = )] public string szTypeName;
} public abstract class Shell
{
[DllImport("shell32")] public static extern int CommandLineToArgv(string lpCmdLine, short pNumArgs);
[DllImport("shell32")] public static extern int DoEnvironmentSubst(string szString, int cbString);
[DllImport("shell32")] public static extern int DragQueryFile(HANDLE hDROP, int UINT, string lpStr, int ch);
[DllImport("shell32")] public static extern int DragQueryPoint(HANDLE hDROP, ref POINT lpPoint);
[DllImport("shell32")] public static extern int DuplicateIcon(HANDLE hInst, HANDLE hIcon);
[DllImport("shell32")] public static extern int ExtractAssociatedIcon(HANDLE hInst, string lpIconPath, ref int lpiIcon);
[DllImport("shell32")] public static extern int ExtractIcon(HANDLE hInst, string lpszExeFileName, int nIconIndex);
[DllImport("shell32")] public static extern int ExtractIconEx(string lpszFile, int nIconIndex, ref int phiconLarge, ref int phiconSmall, int nIcons);
[DllImport("shell32")] public static extern int FindExecutable(string lpFile, string lpDirectory, string lpResult);
[DllImport("shell32")] public static extern int SHAppBarMessage(int dwMessage, ref APPBARDATA pData);
[DllImport("shell32")] public static extern int SHFileOperation(ref SHFILEOPSTRUCT lpFileOp);
[DllImport("shell32")] public static extern int SHGetFileInfo(string pszPath, int dwFileAttributes, ref SHFILEINFO psfi, int cbFileInfo, int uFlags);
[DllImport("shell32")] public static extern int SHGetNewLinkInfo(string pszLinkto, string pszDir, string pszName, ref int pfMustCopy, int uFlags);
[DllImport("shell32")] public static extern int ShellAbout(HWND hwnd, string szApp, string szOtherStuff, HANDLE hIcon);
[DllImport("shell32")] public static extern int ShellExecute(HWND hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, int nShowCmd);
[DllImport("shell32")] public static extern int Shell_NotifyIcon(int dwMessage, ref NOTIFYICONDATA lpData);
[DllImport("shell32")] public static extern void DragAcceptFiles(HWND hwnd, int fAccept);
[DllImport("shell32")] public static extern void DragFinish(HANDLE hDrop);
[DllImport("shell32")] public static extern void SHFreeNameMappings(HANDLE hNameMappings);
[DllImport("shell32")] public static extern void WinExecError(HWND hwnd, int error, string lpstrFileName, string lpstrTitle);
[DllImport("shell32")] public static extern int SHBrowseForFolder(BROWSEINFO lpbi);
[DllImport("shell32")] public static extern int SHGetPathFromIDList(int pidList, string lpBuffer); public const int ABE_BOTTOM = ;
public const int ABE_LEFT = ;
public const int ABE_RIGHT = ;
public const int ABE_TOP = ;
public const int ABM_ACTIVATE = 0x6;
public const int ABM_GETAUTOHIDEBAR = 0x7;
public const int ABM_GETSTATE = 0x4;
public const int ABM_GETTASKBARPOS = 0x5;
public const int ABM_NEW = 0x0;
public const int ABM_QUERYPOS = 0x2;
public const int ABM_REMOVE = 0x1;
public const int ABM_SETAUTOHIDEBAR = 0x8;
public const int ABM_SETPOS = 0x3;
public const int ABM_WINDOWPOSCHANGED = 0x9;
public const int ABN_FULLSCREENAPP = 0x2;
public const int ABN_POSCHANGED = 0x1;
public const int ABN_STATECHANGE = 0x0;
public const int ABN_WINDOWARRANGE = 0x3;
public const int ABS_ALWAYSONTOP = 0x2;
public const int ABS_AUTOHIDE = 0x1;
public const int EIRESID = -;
public const int FOF_ALLOWUNDO = 0x40;
public const int FOF_CONFIRMMOUSE = 0x2;
public const int FOF_FILESONLY = 0x80;
public const int FOF_MULTIDESTFILES = 0x1;
public const int FOF_NOCONFIRMATION = 0x10;
public const int FOF_NOCONFIRMMKDIR = 0x200;
public const int FOF_RENAMEONCOLLISION = 0x8;
public const int FOF_SILENT = 0x4;
public const int FOF_SIMPLEPROGRESS = 0x100;
public const int FOF_WANTMAPPINGHANDLE = 0x20;
public const int FO_COPY = 0x2;
public const int FO_DELETE = 0x3;
public const int FO_MOVE = 0x1;
public const int FO_RENAME = 0x4;
public const int NIF_ICON = 0x2;
public const int NIF_MESSAGE = 0x1;
public const int NIF_TIP = 0x4;
public const int NIM_ADD = 0x0;
public const int NIM_DELETE = 0x2;
public const int NIM_MODIFY = 0x1;
public const int PO_DELETE = 0x13;
public const int PO_PORTCHANGE = 0x20;
public const int PO_RENAME = 0x14;
public const int PO_REN_PORT = 0x34;
public const int SEE_MASK_CLASSKEY = 0x3;
public const int SEE_MASK_CLASSNAME = 0x1;
public const int SEE_MASK_CONNECTNETDRV = 0x80;
public const int SEE_MASK_DOENVSUBST = 0x200;
public const int SEE_MASK_FLAG_DDEWAIT = 0x100;
public const int SEE_MASK_FLAG_NO_UI = 0x400;
public const int SEE_MASK_HOTKEY = 0x20;
public const int SEE_MASK_ICON = 0x10;
public const int SEE_MASK_IDLIST = 0x4;
public const int SEE_MASK_INVOKEIDLIST = 0xC;
public const int SEE_MASK_NOCLOSEPROCESS = 0x40;
public const int SE_ERR_ACCESSDENIED = ;
public const int SE_ERR_ASSOCINCOMPLETE = ;
public const int SE_ERR_DDEBUSY = ;
public const int SE_ERR_DDEFAIL = ;
public const int SE_ERR_DDETIMEOUT = ;
public const int SE_ERR_DLLNOTFOUND = ;
public const int SE_ERR_FNF = ;
public const int SE_ERR_NOASSOC = ;
public const int SE_ERR_OOM = ;
public const int SE_ERR_PNF = ;
public const int SE_ERR_SHARE = ;
public const int SHGFI_ATTRIBUTES = 0x800;
public const int SHGFI_DISPLAYNAME = 0x200;
public const int SHGFI_EXETYPE = 0x2000;
public const int SHGFI_ICON = 0x100;
public const int SHGFI_ICONLOCATION = 0x1000;
public const int SHGFI_LARGEICON = 0x0;
public const int SHGFI_LINKOVERLAY = 0x8000;
public const int SHGFI_OPENICON = 0x2;
public const int SHGFI_PIDL = 0x8;
public const int SHGFI_SELECTED = 0x10000;
public const int SHGFI_SHELLICONSIZE = 0x4;
public const int SHGFI_SMALLICON = 0x1;
public const int SHGFI_SYSICONINDEX = 0x4000;
public const int SHGFI_TYPENAME = 0x400;
public const int SHGFI_USEFILEATTRIBUTES = 0x10;
public const int SHGNLI_PIDL = 0x1;
public const int SHGNLI_PREFIXNAME = 0x2;
}
}

ApiShell的更多相关文章

  1. Python学习进程

    1周第1天 主要是变量的学习(11月8日) 1.1 python安装(win和linux下)1.2 ipython安装及使用1.3 变量的定义1.4 变量赋值1.5 运算符(赋值.算术.关系.逻辑)1 ...

随机推荐

  1. 可变与不可变类型数据,列表的copy方法

    我们先来了解一下可变与不可变类型的数据 (1)可变类型:列表,字典(内存中的数据允许被修改) 不可变类型:数字,字符串,元组(内存中的数据不允许被修改) 接着我们通过一个实例来看一看可变与不可变类型数 ...

  2. Saltstack自动化操作记录(2)-配置使用

    之前梳理了Saltstack自动化操作记录(1)-环境部署,下面说说saltstack配置及模块使用: 为了试验效果,再追加一台被控制端minion机器192.168.1.118需要在master控制 ...

  3. 【原创】大叔经验分享(20)spark job之间会停顿几分钟

    今天遇到一个问题,spark应用中在一个循环里执行sql,每个sql都会向一张表写入数据,比如 insert overwrite table test_table partition(dt) sele ...

  4. linux 乌班图 xshell链接不上服务器

    输入  ps -e |grep ssh ,如果没有任何反应则是没有安装 命令 sudo apt-get install openssh-server 然后出现是否同意-Y,同意进行自动下载 如果提示  ...

  5. Nginx配置https证书

    目前的大趋势是升级HTTP为HTTPS 本章介绍怎样实装HTTPS证书 # 如果报 ssl 错误是Nginx安装时未安装ssl 请重新编译nginx 可以参考我之前的博客 申请/获取https 这里就 ...

  6. CSS选择器权重计算

    CSS各种选择器的权重: 1.ID选择器  +100 2.类.属性.伪类选择器   +10 3.元素.伪元素选择器   +1 4.其他选择器   +0 如果有两个CSS样式都作用于某元素,如: #id ...

  7. ansible的delegate_to、connection、和local_action

    由于工作需要,经常需要把目标节点获得的信息写入执行节点文件日志. 所以经常用到delegate_to和connection,而local_action写法难看,基本不用. delegate_to和co ...

  8. Javascript我学之三函数的参数

    本文是金旭亮老师网易云课堂的课程笔记,记录下来,以供备忘 函数的参数             对于参数值,JavaScript不会进行类型检查,任何类型的值都可以被传递给参数.             ...

  9. P1525 关押罪犯 并查集

    题目描述 SS城现有两座监狱,一共关押着NN名罪犯,编号分别为1-N1−N.他们之间的关系自然也极不和谐.很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突.我们用“怨气值”(一个正整数值) ...

  10. 删除倒数第k个元素

    给定一个链表,删除链表的倒数第 n 个节点,并且返回链表的头结点. 示例: 给定一个链表: 1->2->3->4->5, 和 n = 2. 当删除了倒数第二个节点后,链表变为 ...