golang ---调用window api函数执行程序
package main import "syscall"
import "unsafe" func main() {
var hand uintptr = uintptr(0)
var operator uintptr = uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr("open")))
var fpath uintptr = uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr("D:\\GOPATH\\src\\data.go\\data.go.exe")))
var param uintptr = uintptr(0)
var dirpath uintptr = uintptr(0)
var ncmd uintptr = uintptr(1)
shell32 := syscall.NewLazyDLL("shell32.dll")
ShellExecuteW := shell32.NewProc("ShellExecuteW")
_, _, _ = ShellExecuteW.Call(hand, operator, fpath, param, dirpath, ncmd)
}
golang ---调用window api函数执行程序的更多相关文章
- C#调用Windows API函数截图
界面如下: 下面放了一个PictureBox 首先是声明函数: //这里是调用 Windows API函数来进行截图 //首先导入库文件 [System.Runtime.InteropServices ...
- Linux C 调用MYSQL API 函数mysql_escape_string()转义插入数据
Title:Linux C 调用MYSQL API 函数mysql_escape_string()转义插入数据 --2013-10-11 11:57 #include <stdio.h> ...
- VBS调用Windows API函数
Demon's Blog 忘记了,喜欢一个人的感觉 Demon's Blog » 程序设计 » VBS调用Windows API函数 « 用VBS修改Windows用户密码 在VB中创建和使用 ...
- Python调用Windows API函数编写录音机和音乐播放器
功能描述: 1)使用tkinter设计程序界面: 2)调用Windows API函数实现录音机和音乐播放器. . 参考代码: 运行界面:
- C++多线程中调用python api函数
错误场景:一直等待全局锁. 解决方法: 一.首先定义一个封装类,主要是保证PyGILState_Ensure, PyGILState_Release配对使用,而且这个类是可以嵌套使用的. #inclu ...
- 调用win32 api 函数SendMessage() 实现消息直接调用
简单的调用例子, 适合初学者学习,当然 我也是初学者. #include <windows.h> #include <stdio.h> #include <stdlib. ...
- golang 调用windows API 中文的处理
Go语言发展势头很猛,其实缺点也很多,好在有广大爱好者提供了无数的库,把优点表现得太好了,搞得什么都是拿来就使用,基本完全不理会指针,性能还不错. 最近在windows下使用遇到一个中文的问题,首先要 ...
- MFC中调用Windows API函数的方式
windows aoi 函数的调用前面加::
- VBS调用windows api函数(postmessage)实现后台发送按键脚本
'=========================================================================='' VBScript Source File - ...
随机推荐
- 【JOISC2018|2019】【20190622】mergers
题目 一\(n\)个节点的树,节点被分成\(k\)个集合,\(i\)属于\(S_i\), 一条边是可划分的当且仅当左右两边的子树不存在相同集合的点 你一次可以合并两个集合,求最少的操作次数使得所有边都 ...
- 【loj2341】【WC2018】即时战略
题目 交互题: 一开始所有点都是黑的,你需要把所有点变白: explore(u,v)会将u到v路径上的第二个点变白: 一开始只有1号点是白色的,你需要让所有点变白: 对于一条链次数限制\(O(n+lo ...
- join 分割数组
返回一个字符串.该字符串是通过把 arrayObject 的每个元素转换为字符串,然后把这些字符串连接起来,在两个元素之间插入 separator 字符串而生成的. separator可以传可以传,不 ...
- 网易云音乐MP3外链地址
网易云音乐MP3外链地址下载方法很简单的方法: 下载公式:http://music.163.com/song/media/outer/url?id=ID数字.mp3 把上面红色部分(ID数字)换成 ...
- Ehcache API的使用和注意点
目录 创建CacheManager CacheManager常用的API 创建Cache Cache常用的API 创建Element Element常用的API 配置文件 配置文件名为ehcache. ...
- PAT 甲级 1074 Reversing Linked List (25 分)(链表部分逆置,结合使用双端队列和栈,其实使用vector更简单呐)
1074 Reversing Linked List (25 分) Given a constant K and a singly linked list L, you are supposed ...
- LeetCode_405. Convert a Number to Hexadecimal
405. Convert a Number to Hexadecimal Easy Given an integer, write an algorithm to convert it to hexa ...
- [LeetCode] 549. Binary Tree Longest Consecutive Sequence II 二叉树最长连续序列之 II
Given a binary tree, you need to find the length of Longest Consecutive Path in Binary Tree. Especia ...
- Python 获取文件类型后缀
import os path='file.txt' file=os.path.splitext(path) filename,type=file print(filename) print(type)
- springboot2 配置 https
package cn.xiaojf.aibus.configure; import org.apache.catalina.Context; import org.apache.catalina.co ...