forked from hnakamur/w32uiautomation
-
Notifications
You must be signed in to change notification settings - Fork 1
/
iuiautomationinvokepattern.go
40 lines (32 loc) · 807 Bytes
/
iuiautomationinvokepattern.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package w32uiautomation
import (
"syscall"
"unsafe"
"github.com/go-ole/go-ole"
)
type IUIAutomationInvokePattern struct {
ole.IUnknown
}
type IUIAutomationInvokePatternVtbl struct {
ole.IUnknownVtbl
Invoke uintptr
}
var IID_IUIAutomationInvokePattern = &ole.GUID{0xfb377fbe, 0x8ea6, 0x46d5, [8]byte{0x9c, 0x73, 0x64, 0x99, 0x64, 0x2d, 0x30, 0x59}}
func (pat *IUIAutomationInvokePattern) VTable() *IUIAutomationInvokePatternVtbl {
return (*IUIAutomationInvokePatternVtbl)(unsafe.Pointer(pat.RawVTable))
}
func (pat *IUIAutomationInvokePattern) Invoke() error {
return invoke(pat)
}
func invoke(pat *IUIAutomationInvokePattern) error {
hr, _, _ := syscall.Syscall(
pat.VTable().Invoke,
1,
uintptr(unsafe.Pointer(pat)),
0,
0)
if hr != 0 {
return ole.NewError(hr)
}
return nil
}