c# 调用 ShellExecute
namespace ConsoleTest
{
class Program
{
public enum ShowCommands : int
{
SW_HIDE = 0,
SW_SHOWNORMAL = 1,
SW_NORMAL = 1,
SW_SHOWMINIMIZED = 2,
SW_SHOWMAXIMIZED = 3,
SW_MAXIMIZE = 3,
SW_SHOWNOACTIVATE = 4,
SW_SHOW = 5,
SW_MINIMIZE = 6,
SW_SHOWMINNOACTIVE = 7,
SW_SHOWNA = 8,
SW_RESTORE = 9,
SW_SHOWDEFAULT = 10,
SW_FORCEMINIMIZE = 11,
SW_MAX = 11
}
[DllImport("shell32.dll")]
static extern IntPtr ShellExecute(
IntPtr hwnd,
string lpOperation,
string lpFile,
string lpParameters,
string lpDirectory,
ShowCommands nShowCmd);
static void Main(string[] args)
{
ShellExecute(IntPtr.Zero, "open", @"c:\test.flv", "", "", ShowCommands.SW_SHOWNORMAL);
System.Console.ReadKey();
}
}
}
System.Diagnostics.Process.Start(@"c:\test.flv");
c# 调用 ShellExecute的更多相关文章
- 调用ShellExecute所须要头文件
调用ShellExecute所须要头文件 #include "windows.h " #include "shellapi.h "
- 调用ShellExecute需要头文件
调用ShellExecute需要头文件 #include "windows.h " #include "shellapi.h "
- 阻塞调用ShellExecute函数
SHELLEXECUTEINFO si;ZeroMemory(&si, sizeof(si));si.cbSize = sizeof(si);si.fMask = SEE_MASK_NOCLO ...
- Shellexecute头文件
调用ShellExecute所需要头文件 #include "windows.h " #include "shellapi.h "
- ShellExecute函数的问题
情境:自己写了一个loading画面,定时器到时间后调用shellexecute函数调用真正的程序. 问题:调用时出错,说找不到dll资源,但是用鼠标双击确可以打开. 经过分析之后,应该是路径的问题, ...
- C# ShellExcute与Process
C#运行外部程序的两种方法 ShellExecute using System.Runtime.InteropServices; public enum ShowWindowCommands : in ...
- c++打开浏览器
调用外部命令 如果用默认浏览器,就调用ShellExecute(NULL, _T("open"), _T("explorer.exe"), _T("h ...
- [转]Win7 UAC的安全、兼容及权限
[转]Win7 UAC的安全.兼容及权限 http://www.cnblogs.com/mydomain/archive/2010/11/24/1887132.html 网上关于这个问题讨论较多,但也 ...
- Windows 7 taskbar and startmenu pin
原文 Windows 7 taskbar and startmenu pin 在Windows 7上,用户可以将自己喜欢的软件“钉”在开始菜单或任务栏,使用起来更加方便.但有时候我们也需要用程序来将这 ...
随机推荐
- Promise A 规范的一个简单的浏览器端实现
简单的实现了一个promise 的规范,留着接下来模块使用.感觉还有很多能优化的地方,有时间看看源码,或者其他大神的代码 主要是Then 函数.回调有点绕人. !(function(win) { fu ...
- NYOJ 298 点的变换
题目链接:298 点的变换 这题放在矩阵快速幂里,我一开始想不透它是怎么和矩阵搭上边的,然后写了个暴力的果然超时,上网看了题解后,发现竟然能够构造一些精巧的矩阵来处理,不得不说实在太强大了! http ...
- HTTP POST GET 本质区别详解
HTTP POST GET 本质区别详解 一 原理区别 一般在浏览器中输入网址访问资源都是通过GET方式:在FORM提交中,可以通过Method指定提交方式为GET或者POST,默认为GET提交 Ht ...
- D3.js 第一个程序 HelloWorld
一.HTML 是怎么输出 HelloWorld 的 <html> <head> <meta charset="utf-8"> <title ...
- Virtualbox虚拟机安装CentOS6.5图文详细教程(zhuan)
http://www.2cto.com/os/201407/318477.html ************************************************* 什么是Virtu ...
- 20160805_笔记本_CentOS6.4x64分区
1.严gong 笔记本 CentOS6.4x64分区: 1.1.OS自动分区的方案: 1.2.我模仿上面的方案,自己弄的方案:(没有LVM卷组) 2.
- iOS开发 UIPanGestureRecognizer手势抽象类
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@sel ...
- JQuery基础汇总
1. 对象获取与赋值::$("#obj").val("Hello World!"); 2. 对象的显示与隐藏:$("#obj").show( ...
- 清除数据库中大于10W行的垃圾历史数据
-- =============================================-- Author: <Author,Name,龙鸿轩>-- Create date: &l ...
- #array_parents #parents的区别
https://www.drupal.org/node/279246 #array_parents => 一定会反映表单的物理结构 就是该是哪个下面就是哪个下面 不来虚的#parents = ...