找回密码
 加入
搜索
查看: 2674|回复: 2

如何刷新注册表?

[复制链接]
发表于 2008-7-29 11:25:41 | 显示全部楼层 |阅读模式
DllCall("user32.dll","int","SendMessageTimeout","hwnd",65535,"int",26,"int",0,"int",0,"int",0,"int",1000,"str","dwResult")

这个被强烈推荐的方法不起作用,哪里出问题了!

有管理员三恨回答,早该结贴了

[ 本帖最后由 星驰周 于 2008-12-11 13:22 编辑 ]
发表于 2008-7-29 18:05:11 | 显示全部楼层
注册表立即刷新





Func _ProcessGetName( $i_PID )
If Not ProcessExists($i_PID) Then
  SetError(1)
  Return ''
EndIf
Local $a_Processes = ProcessList()
If Not @error Then
  For $i = 1 To $a_Processes[0][0]
   If $a_Processes[$i][1] = $i_PID Then Return $a_Processes[$i][0]
  Next
EndIf
SetError(1)
Return ''
EndFunc
Func _ProcessGetPriority($vProcess)
    Local $i_PID = ProcessExists($vProcess)
    If Not $i_PID Then
        SetError(1)
        Return -1
    EndIf
    Local $hDLL = DllOpen('kernel32.dll')
    Local $aProcessHandle = DllCall($hDLL, 'int', 'OpenProcess', 'int', 0x0400, 'int', False, 'int', $i_PID)
    Local $aPriority = DllCall($hDLL, 'int', 'GetPriorityClass', 'int', $aProcessHandle[0])
    DllCall($hDLL, 'int', 'CloseHandle', 'int', $aProcessHandle[0])
    DllClose($hDLL)
    Switch $aPriority[0]
        Case 0x00000040
            Return 0
        Case 0x00004000
            Return 1
        Case 0x00000020
            Return 2
        Case 0x00008000
            Return 3
        Case 0x00000080
            Return 4
        Case 0x00000100
            Return 5
        Case Else
            SetError(1)
            Return -1
    EndSwitch

EndFunc  
Func _RunDOS($sCommand)
Return RunWait(@ComSpec & " /C " & $sCommand, "", @SW_HIDE)
EndFunc  
$rc = _RunDos("gpupdate /force /wait:100")
Exit
发表于 2008-7-29 20:36:08 | 显示全部楼层
刷新不是万能的。。。测试有些键值刷新还是无效的。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-19 20:33 , Processed in 0.070149 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表