易语言U盘弹出与插入源码
系统结构:设置U盘状态,StateChange,IsClassUsb,SetupDiOpenClassRegKey,RegQueryValueEx,RegCloseKey,lstrcmpi,SetupDiGetClassDevs,SetupDiEnumDeviceInfo,LoadCursor,SetCursor,SetupDiSetClassInstallParams,SetupDiDestroyDeviceInfoList,CM_Get_Device_ID,SetupDiGetDeviceRegistryProperty,CM_Get_Parent,CM_Get_DevNode_Status,CM_Request_Device_Eject,SetupDiChangeState,SetWindowLong,RegisterDeviceNotification,UnregisterDeviceNotification,RtlMoveMemory_Ptr2DEV_BROADCAST_VOLUME,GetDriveType,CallWindowProc,
======窗口程序集1
| |
| |------ __启动窗口_创建完毕
| |
| |------ 设置U盘状态
| |
| |------ StateChange
| |
| |------ IsClassUsb
| |
| |------ _按钮1_被单击
| |
| |------ _按钮2_被单击
| |
| |
======调用的Dll
| |
| |---[dll]------ SetupDiOpenClassRegKey
| |
| |---[dll]------ RegQueryValueEx
| |
| |---[dll]------ RegCloseKey
| |
| |---[dll]------ lstrcmpi
| |
| |---[dll]------ SetupDiGetClassDevs
| |
| |---[dll]------ SetupDiEnumDeviceInfo
| |
| |---[dll]------ LoadCursor
| |
| |---[dll]------ SetCursor
| |
| |---[dll]------ SetupDiSetClassInstallParams
| |
| |---[dll]------ SetupDiDestroyDeviceInfoList
| |
| |---[dll]------ CM_Get_Device_ID
| |
| |---[dll]------ SetupDiGetDeviceRegistryProperty
| |
| |---[dll]------ CM_Get_Parent
| |
| |---[dll]------ CM_Get_DevNode_Status
| |
| |---[dll]------ CM_Request_Device_Eject
| |
| |---[dll]------ SetupDiChangeState
| |
| |---[dll]------ SetWindowLong
| |
| |---[dll]------ RegisterDeviceNotification
| |
| |---[dll]------ UnregisterDeviceNotification
| |
| |---[dll]------ RtlMoveMemory_Ptr2DEV_BROADCAST_VOLUME
| |
| |---[dll]------ GetDriveType
| |
| |---[dll]------ CallWindowProc
调用的DLL命令:
.DLL命令 SetupDiOpenClassRegKey, 整数型, "setupapi.dll", "SetupDiOpenClassRegKey"
.参数 ClassGuid, GUID
.参数 samDesired, 整数型
.DLL命令 RegQueryValueEx, 整数型, "advapi32.dll", "RegQueryValueExA"
.参数 hKey, 整数型
.参数 lpValueName, 文本型
.参数 lpReserved, 整数型
.参数 lpType, 整数型, 传址
.参数 lpData, 文本型
.参数 lpcbData, 整数型, 传址
.DLL命令 RegCloseKey, 整数型, "advapi32.dll", "RegCloseKey"
.参数 hKey, 整数型
.DLL命令 lstrcmpi, 整数型, "kernel32.dll", "lstrcmpiA"
.参数 lpString1, 文本型
.参数 lpString2, 文本型
.DLL命令 SetupDiGetClassDevs, 整数型, "setupapi.dll", "SetupDiGetClassDevsA"
.参数 ClassGuid, 整数型
.参数 Enumerator, 整数型
.参数 hwndParent, 整数型
.参数 Flags, 整数型
.DLL命令 SetupDiEnumDeviceInfo, 整数型, "setupapi.dll", "SetupDiEnumDeviceInfo"
.参数 DeviceInfoSet, 整数型
.参数 MemberIndex, 整数型
.参数 DeviceInfoData, SP_DEVINFO_DATA
.DLL命令 LoadCursor, 整数型, "user32.dll", "LoadCursorA"
.参数 hInstance, 整数型
.参数 lpCursorName, 整数型
.DLL命令 SetCursor, 整数型, "user32.dll", "SetCursor"
.参数 hCursor, 整数型
.DLL命令 SetupDiSetClassInstallParams, 整数型, "setupapi.dll", "SetupDiSetClassInstallParamsA"
.参数 DeviceInfoSet, 整数型
.参数 DeviceInfoData, SP_DEVINFO_DATA
.参数 ClassInstallParams, SP_PROPCHANGE_PARAMS
.参数 ClassInstallParamsSize, 整数型
.DLL命令 SetupDiDestroyDeviceInfoList, 整数型, "setupapi.dll", "SetupDiDestroyDeviceInfoList"
.参数 DeviceInfoSet, 整数型
.DLL命令 CM_Get_Device_ID, 整数型, "setupapi.dll", "CM_Get_Device_IDA"
.参数 dnDevInst, 整数型
.参数 Buffer, 文本型
.参数 BufferLen, 整数型
.参数 ulFlags, 整数型
.DLL命令 SetupDiGetDeviceRegistryProperty, 整数型, "setupapi.dll", "SetupDiGetDeviceRegistryPropertyA"
.参数 DeviceInfoSet, 整数型
.参数 DeviceInfoData, SP_DEVINFO_DATA, 传址
.参数 Property, 整数型
.参数 PropertyRegDataType, 整数型, 传址
.参数 PropertyBuffer, 文本型
.参数 PropertyBufferSize, 整数型
.参数 RequiredSize, 整数型, 传址
.DLL命令 CM_Get_Parent, 整数型, "setupapi.dll", "CM_Get_Parent"
.参数 pdnDevInst, 整数型, 传址
.参数 dnDevInst, 整数型
.参数 ulFlags, 整数型
.DLL命令 CM_Get_DevNode_Status, 整数型, "setupapi.dll", "CM_Get_DevNode_Status"
.参数 arg1, 整数型, 传址
.参数 arg2, 整数型, 传址
.参数 arg3, 整数型
.参数 arg4, 整数型
.DLL命令 CM_Request_Device_Eject, 整数型, "setupapi.dll", "CM_Request_Device_EjectA"
.参数 dnDevInst, 整数型
.参数 pVetoType, 整数型, 传址
.参数 pszVetoName, 文本型
.参数 ulNameLength, 整数型
.参数 ulFlags, 整数型
.DLL命令 SetupDiChangeState, 整数型, "setupapi.dll", "SetupDiChangeState"
.参数 arg1, 整数型
.参数 arg2, SP_DEVINFO_DATA
.DLL命令 SetWindowLong, 整数型, "user32", "SetWindowLongA"
.参数 hwnd, 整数型
.参数 nIndex, 整数型
.参数 dwNewLong, 整数型
.DLL命令 RegisterDeviceNotification, 整数型, "user32.dll", "RegisterDeviceNotificationA"
.参数 hRecipient, 整数型
.参数 NotificationFilter, DEV_BROADCAST_DEVICEINTERFACE
.参数 Flags, 整数型
.DLL命令 UnregisterDeviceNotification, 整数型, "User32.dll"
.参数 Handle, 整数型
.DLL命令 RtlMoveMemory_Ptr2DEV_BROADCAST_VOLUME, , "kernel32", "RtlMoveMemory"
.参数 Destination, DEV_BROADCAST_VOLUME
.参数 Source, 整数型
.参数 Length, 整数型
.DLL命令 GetDriveType, 整数型, "kernel32", "GetDriveTypeA"
.参数 nDrive, 文本型
.DLL命令 CallWindowProc, 整数型, "user32", "CallWindowProcA"
.参数 lpPrevWndFunc, 整数型
.参数 hwnd, 整数型
.参数 msg, 整数型
.参数 wParam, 整数型
.参数 lParam, 整数型
注:本站源码主要来源于网络收集。如有侵犯您的利益,请联系我们,我们将及时删除!
部分源码可能含有危险代码,(如关机、格式化磁盘等),请看清代码在运行。
由此产生的一切后果本站均不负责。源码仅用于学习使用,如需运用到商业场景请咨询原作者。
使用本站源码开发的产品均与本站无任何关系,请大家遵守国家相关法律。