-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathAtl.ahk
47 lines (41 loc) · 1.31 KB
/
Atl.ahk
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
41
42
43
44
45
46
47
;------------------------------------------------------------------------------
; Atl.ahk Standard Library
; by Sean
;
; REQUIREMENT: 32/64-bit UNICODE AutoHotkey_L
;------------------------------------------------------------------------------
Atl_Init()
{
Static h
If Not h
h:=DllCall("LoadLibrary","Str","atl","Ptr"), DllCall("atl\AtlAxWinInit")
}
Atl_AxGetHost(hWnd)
{
Atl_Init()
If DllCall("atl\AtlAxGetHost", "Ptr", hWnd, "Ptr*", punk)=0
Return ComObjEnwrap(punk)
}
Atl_AxGetControl(hWnd)
{
Atl_Init()
If DllCall("atl\AtlAxGetControl", "Ptr", hWnd, "Ptr*", punk)=0
Return ComObjEnwrap(punk)
}
Atl_AxAttachControl(punk, hWnd)
{
Atl_Init()
If DllCall("atl\AtlAxAttachControl", "Ptr", IsObject(punk)?ComObjUnwrap(punk):punk, "Ptr", hWnd, "Ptr", 0)=0
Return IsObject(punk)?punk:ComObjEnwrap(punk)
}
Atl_AxCreateControl(hWnd, Name)
{
Atl_Init()
If DllCall("atl\AtlAxCreateControlEx", "WStr", Name, "Ptr", hWnd, "Ptr", 0, "Ptr", 0, "Ptr*", punk, "Ptr", VarSetCapacity(GUID,16,0)*0+&GUID, "Ptr", 0)=0
Return ComObjEnwrap(punk)
}
Atl_AxCreateContainer(hWnd, l, t, w, h, Name = "", ExStyle = 0, Style = 0x54000000)
{
Atl_Init()
Return DllCall("CreateWindowEx", "UInt", ExStyle, "Str", "AtlAxWin", "Str", Name, "UInt", Style, "Int", l, "Int", t, "Int", w, "Int", h, "Ptr", hWnd, "Ptr", 0, "Ptr", 0, "Ptr", 0, "Ptr")
}