Func _GlobalAddAtom($lpString, $hDll_Kernel32 = "kernel32.dll")
Local $avRval = DllCall($hDll_Kernel32, "short", "GlobalAddAtom", "str", StringLeft($lpString, 255))
If @error > 0 Then
SetError(1); DllCall Error
Return 0
ElseIf $avRval[0] = 0 Then
SetError(2); GlobalAddAtom Error
EndIf
Return $avRval[0]
EndFunc ;==>_GlobalAddAtom
Func _GlobalDeleteAtom($iAtom, $hDll_Kernel32 = "kernel32.dll")
Local $avRval = DllCall($hDll_Kernel32, "short", "GlobalDeleteAtom", "short", $iAtom)
If @error > 0 Then
SetError(1); DllCall Error
Return 0
EndIf
Return $avRval[0]
EndFunc ;==>_GlobalDeleteAtom
Func _GlobalGetAtomName($iAtom, $iBuffSize = 256, $hDll_Kernel32 = "kernel32.dll")
Local $vBuff = DllStructCreate("char[" & $iBuffSize & "]"), $sBuff
Local $avRval = DllCall($hDll_Kernel32, "int", "GlobalGetAtomName", "short", $iAtom, "long", DllStructGetPtr($vBuff, 1), "int", $iBuffSize)
If @error > 0 Then
SetError(1); DllCall Error
Return 0
ElseIf $avRval[0] = 0 Then
SetError(2); GlobalGetAtomName Error
Return $avRval[0]
EndIf
$sBuff = DllStructGetData($vBuff, 1)
$vBuff = 0
Return $sBuff
EndFunc ;==>_GlobalGetAtomName
Func _GlobalFindAtom($lpString, $hDll_Kernel32 = "kernel32.dll")
Local $avRval = DllCall($hDll_Kernel32, "short", "GlobalFindAtom", "str", $lpString)
If @error > 0 Then
SetError(1); DllCall Error
Return 0
ElseIf $avRval[0] = 0 Then
SetError(2); GlobalAddAtom Error
EndIf
Return $avRval[0]
EndFunc ;==>_GlobalFindAtom
我也是搜这个API然后得到了官网上的几个函数,MARK一下,其他人也可以看看,我是不懂怎么弄,只会用 |