ListSet( NPFList, XXNFList)
{
global MBCDLL
global NpfGetDeviceInfo, NpfSetDevice
global WsGetAddressInfo, WsSetAddress
if (MBCDLL := DllCall("LoadLibrary", "str", "MBC.dll")) {
NpfGetDeviceInfo := DllCall("GetProcAddress", "uint", MBCDLL, "str", "NpfGetDeviceInfo")
NpfSetDevice := DllCall("GetProcAddress", "uint", MBCDLL, "str", "NpfSetDevice")
WsGetAddressInfo := DllCall("GetProcAddress", "uint", MBCDLL, "str", "WsGetAddressInfo")
WsSetAddress := DllCall("GetProcAddress", "uint", MBCDLL, "str", "WsSetAddress")
VarSetCapacity(deviceName, 64)
VarSetCapacity(deviceDesc, 256)
Stringmid,NPFList,NPFList,2,1
DllCall(NpfGetDeviceInfo, "uint", NPFList, "str", deviceName, "str", deviceDesc)
VarSetCapacity(address, 16)
Stringmid,XXNFList,XXNFList,2,1
DllCall(WsGetAddressInfo, "uint", XXNFList, "str", address)
}
}
MBC_InitTerm()
{
global MBCDLL, SignalGetMode, SignalSetMode
global NpfFindAllDevices, NpfGetDeviceCount, NpfGetDeviceInfo, NpfSetDevice, NpfStart, NpfStop, NpfGetState
global WsFindAllAddresses, WsGetAddressCount, WsGetAddressInfo, WsSetAddress, WsStart, WsStop, WsGetState
if (MBCDLL) {
DllCall(WsStop)
DllCall(NpfStopDevice)
DllCall("FreeLibrary", "uint", MBCDLL)
MBCDLL = 0
return
}
if (MBCDLL := DllCall("LoadLibrary", "str", "MBC.dll")) {
SignalGetMode := DllCall("GetProcAddress", "uint", MBCDLL, "str", "SignalGetMode")
SignalSetMode := DllCall("GetProcAddress", "uint", MBCDLL, "str", "SignalSetMode")
NpfFindAllDevices := DllCall("GetProcAddress", "uint", MBCDLL, "str", "NpfFindAllDevices")
NpfGetDeviceCount := DllCall("GetProcAddress", "uint", MBCDLL, "str", "NpfGetDeviceCount")
NpfGetDeviceInfo := DllCall("GetProcAddress", "uint", MBCDLL, "str", "NpfGetDeviceInfo")
NpfSetDevice := DllCall("GetProcAddress", "uint", MBCDLL, "str", "NpfSetDevice")
NpfStart := DllCall("GetProcAddress", "uint", MBCDLL, "str", "NpfStart")
NpfStop := DllCall("GetProcAddress", "uint", MBCDLL, "str", "NpfStop")
NpfGetState := DllCall("GetProcAddress", "uint", MBCDLL, "str", "NpfGetState")
WsFindAllAddresses := DllCall("GetProcAddress", "uint", MBCDLL, "str", "WsFindAllAddresses")
WsGetAddressCount := DllCall("GetProcAddress", "uint", MBCDLL, "str", "WsGetAddressCount")
WsGetAddressInfo := DllCall("GetProcAddress", "uint", MBCDLL, "str", "WsGetAddressInfo")
WsSetAddress := DllCall("GetProcAddress", "uint", MBCDLL, "str", "WsSetAddress")
WsStart := DllCall("GetProcAddress", "uint", MBCDLL, "str", "WsStart")
WsStop := DllCall("GetProcAddress", "uint", MBCDLL, "str", "WsStop")
WsGetState := DllCall("GetProcAddress", "uint", MBCDLL, "str", "WsGetState")
count := DllCall(NpfFindAllDevices)
loop %count% {
VarSetCapacity(deviceName, 64)
VarSetCapacity(deviceDesc, 256)
DllCall(NpfGetDeviceInfo, "uint", a_index, "str", deviceName, "str", deviceDesc)
msg = [%a_index%] %deviceDesc%
Guicontrol,5:,NPFList1,%msg%
Gui, 2:Add, Text, cred BackgroundTrans x80 y43 h20 , %deviceDesc%
}
if (!DllCall(NpfSetDevice, "str", deviceName))
msgbox,16,안내,NpfSetDevice 실패
count := DllCall(WsFindAllAddresses)
loop %count% {
VarSetCapacity(address, 16)
DllCall(WsGetAddressInfo, "uint", a_index, "str", address)
msg = [%a_index%] %address%
Guicontrol,5:,XXNFList1,%msg%
Gui, 2:Add, Text, cred BackgroundTrans x80 y63 h20 , %address%
}
if (!DllCall(WsSetAddress, "str", address))
msgbox,16,안내,WsSetAddress 실패
} else
{
msgbox,16,안내,DLL 로드 실패
exitapp
}
}
MBC_SignalMode(personal, employee, blockenter)
{
global MBCDLL, SignalGetMode, SignalSetMode
if (!MBCDLL)
MBC_InitTerm()
flags := 0
if (personal)
flags := flags | 0x1
else
flags := flags & ~0x1
if (employee)
flags := flags | 0x2
else
flags := flags & ~0x2
if (blockenter)
flags := flags | 0x4
else
flags := flags & ~0x4
if (MBCDLL)
DllCall(SignalSetMode, "uint", flags)
}
MBC_NPFOnOff()
{
global MBCDLL, NpfStart, NpfStop, NpfGetState, SignalSetMode
if (MBCDLL) {
if (!DllCall(NpfGetState)) {
if (!DllCall(NpfStart))
msgbox,16,안내,NpfStart 실패
} else
DllCall(NpfStop)
}
}
MBC_WSOnOff()
{
global MBCDLL, WsStart, WsStop, WsGetState, SignalSetMode
if (MBCDLL) {
if (!DllCall(WsGetState)) {
if (!DllCall(WsStart))
msgbox,16,안내,WsStart 실패
} else
DllCall(WsStop)
}
}
NPF
XXNFL 정보를가져와야하는데 가져오지를 못합니다 ㅜ.ㅜ 이부분만막하네요