AM电脑吧 - Win10精简版系统_Win11精简版_Win7旗舰版

Yes
查看: 8361|回复: 10
收起左侧

[其它] 台式机笔记本判断_开关小键盘

[复制链接]
ampc8110

签到天数: 3 天

[LV.2]二兆带宽

id fuldho 发表于 2012-01-07 16:22:46
2012-01-07_161533.jpg



#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=IsNotebook.ico
#AutoIt3Wrapper_outfile=IsNotebook.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Description=台式机/笔记本判断
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=@copyright 2010
#AutoIt3Wrapper_Res_Field=CompanyName|www.ampc8.com
#EndRegion AutoIt3Wrapper 预编译参数(常用参数)
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <ProgressConstants.au3>
;若为笔记本则关闭小键盘
$Form1 = GUICreate("台式机/笔记本判断", 250, 150,-1,-1)
FileInstall("1.bmp", @TempDir & "\")
FileInstall("2.bmp", @TempDir & "\")
$Pic = GUICtrlCreatePic(@TempDir & "\1.bmp", 5, 8, 90, 80)
FileInstall("LibGhostHlper.dll", @WindowsDir & "\LibGhostHlper.dll", 1)
$libghosthlperdll = DllOpen(@WindowsDir & "\LibGhostHlper.dll")
$isnotebook = DllCall($libghosthlperdll, "int", "Util_IsNotebook")
If $isnotebook[0] = "0" Then
$NumLock = "你的是台式机"
GUICtrlSetImage($Pic,@TempDir & "\1.bmp")
EndIf
If $isnotebook[0] = "1" Then
GUICtrlSetImage($Pic,@TempDir & "\2.bmp")
$NumLock = "你的是笔记本"
EndIf
$Button1 = GUICtrlCreateButton("开启小键盘", 25, 115, 75, 22, 0)
$Button2 = GUICtrlCreateButton("关闭小键盘", 125, 115, 75, 22, 0)
$Reg = RegRead("HKEY_USERS\.DEFAULT\Control Panel\Keyboard", "InitialKeyboardIndicators")
If StringInStr($Reg,"0") Then
$TXT = "小键盘已开启"
GUICtrlSetState($Button1,$GUI_DISABLE)
EndIf
If StringInStr($Reg,"2") Then
$TXT = "小键盘已关闭"
GUICtrlSetState($Button2,$GUI_DISABLE)
EndIf
$Label = GUICtrlCreateLabel("", 125, 25, 90, 20)
$Labe2 = GUICtrlCreateLabel("", 125, 60, 90, 20)

GUICtrlSetData($Label,$NumLock)
GUICtrlSetData($Labe2,$TXT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Select
        Case $nMsg = $GUI_EVENT_CLOSE
                    DllClose($libghosthlperdll)
                    FileDelete(@WindowsDir & "\LibGhostHlper.dll")
                    FileDelete(@TempDir & "\1.bmp")
                    FileDelete(@TempDir & "\2.bmp")
                    Exit
               Case $nMsg = $Button1
                    RegWrite("HKEY_USERS\.DEFAULT\Control Panel\Keyboard", "InitialKeyboardIndicators", "REG_SZ", 0)
             Send("{NumLock on}")
                        _IsNotebook()
                    GUICtrlSetState($Button1,$GUI_DISABLE)
                    GUICtrlSetState($Button2,$GUI_ENABLE)
                    GUICtrlSetData($Labe2,$TXT)
               Case $nMsg = $Button2
                    RegWrite("HKEY_USERS\.DEFAULT\Control Panel\Keyboard", "InitialKeyboardIndicators", "REG_SZ", 2)
                    Send("{NumLock off}")
                         _IsNotebook()
                    GUICtrlSetState($Button2,$GUI_DISABLE)
                    GUICtrlSetState($Button1,$GUI_ENABLE)
                    GUICtrlSetData($Labe2,$TXT)
    EndSelect
WEnd
Func _IsNotebook()
DllClose($libghosthlperdll)
$isnotebook = DllCall($libghosthlperdll, "int", "Util_IsNotebook")
$Reg = RegRead("HKEY_USERS\.DEFAULT\Control Panel\Keyboard", "InitialKeyboardIndicators")
If StringInStr($Reg,"0") Then
$TXT = "小键盘已开启"
EndIf
If StringInStr($Reg,"2") Then
$TXT = "小键盘已关闭"
EndIf  
EndFunc   ;==>_IsNotebook   


附件:

台式机笔记本判断.rar (109.48 KB, 下载次数: 454)

评分

参与人数 1带宽 +5 收起 理由
ampc84 ②號 + 5 比较实用

本文地址: https://www.ampc8.com/thread-5010-1-1.html
上一篇:QQ2011正式版(Q+) 3.0闪亮登场
下一篇:Windows7组策略配置全攻略(全套技巧)
回复

举报

ampc845973

签到天数: 1 天

[LV.1]一个记事本

id jianghido 发表于 2017-03-31 10:35:17
经常遇到不会弄的客户,有了这个就不怕了。

jianghido 于 2017-03-31 10:38:53 补充以下内容:
在系统中不能用啊  PE下呢
回复

举报

ampc88849

签到天数: 3 天

[LV.2]二兆带宽

id [帐号异常] 发表于 2016-01-18 16:34:04
让它自动开启关闭就好用了。可以用来封装系统。
回复

举报

ampc82742

签到: Lazy

id 清风无影 发表于 2012-11-20 21:28:31
不错啊,下载研究一下。谢谢楼主
回复

举报

ampc84408

签到天数: 2 天

[LV.1]一个记事本

id 小阳天空 发表于 2012-01-10 18:31:26 手机发帖
学习,很不错
回复

举报

ampc81652

签到天数: 14 天

[LV.3]三流显示器

id 快乐100 发表于 2012-01-08 17:45:18
AU3错误

Line 22  (File "C:\Documents and Settings\Administrator\桌面\新建 AutoIt v3 脚本.au3"):

If $isnotebook[0] = "0" Then
If $isnotebook^ ERROR

Error: 子脚本使用了非数组变量.
回复

举报

ampc81652

签到天数: 14 天

[LV.3]三流显示器

id 快乐100 发表于 2012-01-08 17:42:44
很好的AUTOIT例子
回复

举报

ampc8385

签到天数: 546 天

[LV.9]九级电脑高手

id wyghr 发表于 2012-01-08 12:50:59
下边的是代码吗?这么个小东西,看上去就这么复杂、
回复

举报

ampc84883

签到天数: 5 天

[LV.2]二兆带宽

id qq271859852 发表于 2012-01-08 12:28:18
挺不错的,下来试一下!
回复

举报

ampc84

签到天数: 15 天

[LV.4]四枚内存条

id ②號 发表于 2012-01-08 10:50:26
对于笔记本很很多关机不能自动关闭小键盘的机子很有用
回复

举报

您需要登录后才可以回帖 登录 | 验证注册

Powered by AMpc8.Com (晋ICP备13003365号ghs 晋公网安备 14090202000112号 |GMT+8, 2024/4/26 21:28 |
快速回复 返回顶部 返回列表