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
48
49
|
| #module
#uselib "user32"
#func FindWindowA "FindWindowA" sptr,sptr
#func FindWindowExA "FindWindowExA" sptr,nullptr ,sptr,sptr
#defcfunc findwindowh str p1,str p2
s1=p1:s2=p2:if s1!""{s3=s1}else{s3=0}
if s2!""{s4=s2}else{s4=0}
FindWindowA s3,s4
return stat
#defcfunc FindWindowExh int _hnd,str _class, str _tit
s1=_class:s2=_title:if s1!""{s3=s1}else{s3=0}
if s2!""{s4=s2}else{s4=0}
FindWindowExA _hnd, s3, s4
return stat
#global
#module
#uselib "user32"
#cfunc GetMenu "GetMenu" int
#cfunc GetMenuItemID "GetMenuItemID" int,int
#func GetMenuItemInfo "GetMenuItemInfoA" int,int,int,int
#cfunc GetSubMenu "GetSubMenu" int,int
#deffunc SelectedOnipadMenuItem int menunum, int itemnum
honipad=findwindowh("onipad", "") if honipad = 0 : return 0 hnd=GetMenu(honipad)
hnd=GetSubMenu(hnd,menunum)
dim MENUITEMINFO,12
MENUITEMINFO.0=12*4
MENUITEMINFO.1=$00000002
GetMenuItemInfo hnd, itemnum, 1, varptr(MENUITEMINFO)
SendMsg honipad, $00000111, (MENUITEMINFO.4 | 0 << 16), 0
return honipad
#global
SelectedOnipadMenuItem 0,3
end
|