使用和C里面完全一样
late final int _workerWHexHandle; int _enumWindowsProc(int hWnd,int lParam){ /// print(hWnd.toRadixString(16)); int pHWnd = FindWindowEx(hWnd, 0, TEXT("SHELLDLL_DefView"), nullptr); if(pHWnd != 0){ //print(int.parse(hWnd.toString(),radix: 16)); _workerWHexHandle = FindWindowEx(0, hWnd, nullptr, nullptr); //表示可以退出了 return FALSE; } //表示继续执行 return TRUE; } void amin(){ final enumWinsFunc = Pointer.fromFunction<EnumWindowsProc>(_enumWindowsProc, 0); EnumWindows(enumWinsFunc, 0); return _workerWHexHandle; }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步