Created
April 3, 2012 22:40
-
-
Save kumatti1/2296026 to your computer and use it in GitHub Desktop.
クラスモジュール
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Implements IUICommandHandler | |
Implements IUIApplication | |
Const E_NOTIMPL = &H80004001 | |
Const MyButton = 30002 | |
Private Declare Sub RtlMoveMemory Lib "Kernel32.dll" (ByVal Destination&, ByVal Source&, ByVal length&) | |
Private Sub IUIApplication_OnCreateUICommand(ByVal commandId As Long, ByVal typeID As Long, ByVal commandHandler As Long) | |
Dim tmp As IUICommandHandler | |
If commandId = MyButton Then | |
Set tmp = Me | |
RtlMoveMemory commandHandler, VarPtr(tmp), 4 | |
Exit Sub | |
End If | |
Err.Raise E_NOTIMPL | |
End Sub | |
Private Sub IUIApplication_OnDestroyUICommand(ByVal commandId As Long, ByVal typeID As Long, ByVal commandHandler As Long) | |
Err.Raise E_NOTIMPL | |
End Sub | |
Private Sub IUIApplication_OnViewChanged(ByVal viewId As Long, ByVal typeID As Long, ByVal view As Long, ByVal verb As Long, ByVal uReasonCode As Long) | |
Err.Raise E_NOTIMPL | |
End Sub | |
Private Sub IUICommandHandler_Execute(ByVal commandId As Long, ByVal verb As Long, ByVal key As Long, ByVal currentValue As Long, ByVal commandExecutionProperties As Long) | |
If verb = UI_EXECUTIONVERB_EXECUTE Then | |
If commandId = MyButton Then | |
MsgBox "呼ばれた!!" | |
End If | |
End If | |
End Sub | |
Private Sub IUICommandHandler_UpdateProperty(ByVal commandId As Long, ByVal key As Long, ByVal currentValue As Long, ByVal newValue As Long) | |
Err.Raise E_NOTIMPL | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment