斌哥说大家好,我是斌哥。相信很多学习的Python的小伙伴都会遇到这样的难点:在Windows上开发Python项目,尽管Python的库成千上万,但是针对特殊情况,还是需要考虑到API来做特殊的需求。在Python上,window API调用大致分为2种方法。1、Python的第三方库:Pywin322、引用windowAPI动态链接库(将会在另一篇文章具体说明,包括指针
public Form1( bool aLock ) { if (aLock) { //锁屏+关屏 LockWorkStation(); SendMessage( this.Handle, (uint)0x0112, (IntPtr)0xF170, (IntPtr)2 ); } else { //禁止鼠标键盘动作+关屏 BlockInput( true ); System
package main import ( "syscall" ) func abort(funcname string, err string) { panic(funcname + " failed: "+err) } func print_version(v uint32) { major := byte(v) minor := uint8(v >> 8) build :=
package osapi import ( "syscall" "unsafe" "github.com/lxn/win" ) const ( DESKTOP_SWITCHDESKTOP = 0x0100 // The access to the desktop ) // get desktop locked status func ScreenIsLocked() bool { //
package osapi import ( "syscall" "unsafe" "github.com/lxn/win" ) const ( DESKTOP_SWITCHDESKTOP = 0x0100 // The access to the desktop ) // get desktop locked status func ScreenIsLocked() bool {
锁屏 func lockScreen() { var args []string args = append(args, "user32.dll", "LockWorkStation") _, err := common.StartProcess("rundll32.exe", args...) if err != nil { common.Log
Windows的锁屏图片都很好看,很适合做桌面壁纸。Win11实际上有将Windows聚焦图片作为桌面壁纸的选项,但是可能是由于网络原因经常不能自动更新,于是就写了一个将Windows聚焦图片设为壁纸的小程序。又因为官方的API返回的json数据内容太多了,就精简了一下,写了这个API。API的使用说明和示例如下。API文档此API接收GET请求,并返回以下格式的json数据
前言 在学Go相关的免杀,来提高木马的存活性,看到一些有意思的东西记下来 加载DLL syscall.NewLazyDLLsyscall.LoadLibrarysyscall.MustLoadDLL NewLazyDLL*LazyDLLLoadLibrary 创建函数 syscall.NewLazyDLL package mainimport ( "syscall" "unsafe")func
import{ "os/exec" "path/filepath" } //文件完整路径 filePath, _ := exec.LookPath(os.Args[0]) //文件相对路径 dirPath := filepath.Dir(osPath) //文件名 fileName := filepath.Base(osPath) 转载于:https://my
func getMacAddrs() (macAddrs []string) { netInterfaces, err := net.Interfaces() if err != nil { fmt.Printf("fail to get net interfaces: %v", err) return macAddrs } for _, netInterface :=