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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
-
|
|
!
-
|
|
!
| #module
#uselib "imm32.dll"
#cfunc ImmCreateContext "ImmCreateContext"
#cfunc ImmAssociateContext "ImmAssociateContext" int, int
#func ImmSetCompositionWindow "ImmSetCompositionWindow" int,int,int
#func ImmGetCompositionString "ImmGetCompositionStringA" int,int,var,int
#func ImmSetCompositionFont "ImmSetCompositionFontA" int,int
#func ImmReleaseContext "ImmReleaseContext" int,int
#func ImmDestroyContext "ImmDestroyContext" int
#cfunc ImmGetContext "ImmGetContext" int
#deffunc ime_hwnd int hwnd2_
defime=ImmGetContext(hwnd_2)
return defime
#deffunc ime_creat int hwnd3_
hwnd_ime=ImmCreateContext()
k=ImmAssociateContext(hwnd3_,hwnd_ime)
return hwnd_ime
#deffunc ime_pos int hwnd2_ime,int com_posx, int com_posy
compositionform = 0x0002 ,com_posx ,com_posy
ImmSetCompositionWindow hwnd2_ime,varptr(compositionform)
return
#deffunc ime_getstr int hwnd2_ime,var buf,var str_size
str_size=0
ImmGetCompositionString hwnd2_ime,$800,buf,str_size
str_size=stat
sdim buf,str_size+1
ImmGetCompositionString hwnd2_ime,$800,buf,str_size
return
#deffunc ime_getstr_rt int hwnd6_ime,var buf3
buf3=""
str_size2=0
ImmGetCompositionString hwnd6_ime,$8,buf3,str_size2
str_size2=stat
sdim buf3,str_size2+1
ImmGetCompositionString hwnd6_ime,$8,buf3,str_size2
return
#deffunc ime_font int hwnd4_ime,str font_name,int font_size
dim logfont,20
lfFaceName =font_name
logfont(0)=font_size
poke logfont,23,1
memcpy logfont, lfFaceName, strlen(lfFaceName), 28, 0
ImmSetCompositionFont hwnd4_ime,varptr(logfont)
return
#deffunc ime_getstrex int hwnd3_ime,var buf2
ime_getstr hwnd3_ime,buf2,s
if s=0:ss=0
if s!0&&ss=0:str1_=buf:ss=1:else :buf2=""
return
#deffunc ime_ini int hwnd4_, var hwnd5_ime
ime_hwnd hwnd4_
hwnd5_ime=stat
if hwnd5_ime=0{
ime_creat hwnd4_
hwnd5_ime=stat
}
return
#deffunc ime_dest int hwnd5_
ime_ini hwnd5_, hwnd6_ime
defime=ImmGetContext(hwnd5_)
if defime!0{
ImmReleaseContext hwnd5_,defime
ImmDestroyContext defime
}
return
#global
|