无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

用Rust調(diào)用winapi關(guān)閉顯示器

2022-06-02 23:05 作者:Tuple_元組  | 我要投稿

本文介紹如何在Rust語言中調(diào)用winapi,并發(fā)送關(guān)閉顯示器消息。相關(guān)程序代碼示例如下:

程序中:secound表示程序延時多少秒后,再發(fā)送關(guān)閉顯示的消息。

? ? ? ? ? ? ? 需要使用unself{}來執(zhí)行可能不安全的代碼。

? ? ? ? ? ? ? PostMessageA的解釋是:Places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread to process the message.

該段代碼 使用 cargo build --release 編譯后,生成的二進制可執(zhí)行文件大小為140K,相比用C++寫同樣功能的程序體積還是大的。后者僅為11K。

用Rust調(diào)用winapi關(guān)閉顯示器的評論 (共 條)

分享到微博請遵守國家法律
文化| 大荔县| 通海县| 武定县| 苍梧县| 扶风县| 遂昌县| 晋宁县| 青冈县| 白山市| 宾阳县| 莱西市| 博爱县| 平果县| 磐安县| 南平市| 安溪县| 五河县| 溆浦县| 蕉岭县| 法库县| 卓资县| 石狮市| 历史| 孝义市| 扎赉特旗| 庆城县| 高雄县| 和顺县| 囊谦县| 富川| 永安市| 姜堰市| 岳池县| 彭阳县| 梧州市| 罗田县| 山阴县| 黄山市| 崇明县| 普定县|