.版本 2
.子程序 _启动子程序, 整数型, , 本子程序在程序启动后最先执行
.局部变量 hr, 整数型
.局部变量 pIUnk, 整数型, , , IUnknown*
.局部变量 pTrayNotify, 整数型, , , ITrayNotify*
.局部变量 callback_id, 整数型
.局部变量 NotiMgr, INotificationCB
CoInitialize (0)
hr = CoCreateInstance (#CLSID_TrayNotify, 0, #CLSCTX_LOCAL_SERVER, #IID_IUnknown, pIUnk)
.如果真 (hr ≥ 0)
hr = QueryInterface (pIUnk, _取字节集指针 (#IID_ITrayNotifyWin8), pTrayNotify)
.如果 (hr ≥ 0) ' Win8
NotiMgr = new_NotificationMgr ()
NotiMgr.m_pTrayNotify = pTrayNotify
NotiMgr.m_TrayType = 1
hr = ITrayNotifyWin8_RegisterCallback (pTrayNotify, _取INotificationCB指针 (NotiMgr), callback_id)
.如果真 (hr ≥ 0)
ITrayNotifyWin8_UnregisterCallback (pTrayNotify, callback_id)
.如果真结束
Release (pTrayNotify)
.否则
hr = QueryInterface (pIUnk, _取字节集指针 (#IID_ITrayNotify), pTrayNotify) ' Legacy
.如果真 (hr ≥ 0)
NotiMgr = new_NotificationMgr ()
NotiMgr.m_pTrayNotify = pTrayNotify
NotiMgr.m_TrayType = 0
hr = ITrayNotify_RegisterCallback (pTrayNotify, _取INotificationCB指针 (NotiMgr))
.如果真 (hr ≥ 0)
ITrayNotify_RegisterCallback (pTrayNotify, 0)
.如果真结束
Release (pTrayNotify)
.如果真结束
.如果结束
Release (pIUnk)
.如果真结束
标准输入 ()
返回 (0) ' 可以根据您的需要返回任意数值
.子程序 _取INotificationCB指针, 整数型, , 相当于 取变量数据地址()
.参数 INotificationCB, INotificationCB, 参考
置入代码 ({ 139, 69, 8, 201, 194, 4, 0 })
返回 (0)
.子程序 _取NOTIFYITEM指针, 整数型, , 相当于 取变量数据地址()
.参数 NOTIFYITEM, NOTIFYITEM, 参考
置入代码 ({ 139, 69, 8, 201, 194, 4, 0 })
返回 (0)
.子程序 _取字节集指针, 整数型, , 相当于 取变量数据地址()
.参数 字节集, 字节集, 参考
置入代码 ({ 139, 69, 8, 139, 0, 133, 192, 15, 132, 3, 0, 0, 0, 131, 192, 8, 201, 194, 4, 0 })
返回 (0)
.子程序 WriteInt
.参数 dst, 整数型
.参数 src, 整数型
' mov eax,[ebp+8]
' mov ebx,[ebp+12]
' mov dword[eax],ebx
置入代码 ({ 139, 69, 8, 139, 93, 12, 137, 24 })
.子程序 L, 字节集
.参数 ByteStr, 文本型, 参考
.局部变量 len, 整数型
.局部变量 Returned, 字节集
len = MultiByteToWideChar (0, 0, ByteStr, -1, { }, 0)
Returned = 取空白字节集 (len × 2)
MultiByteToWideChar (0, 0, ByteStr, -1, Returned, 取字节集长度 (Returned))
返回 (Returned)