AHK中英文切换2

~#y::

                                 
                                         gosub 英文
 							
             
return

~#z::

                                 
                                         gosub 中文
 							
             
return



中文:
SwitchIME(00000804)


msgbox,,,已切换为中文模式,1
 str:="现在是中文模式",tt
     n:=StrLen(str)
       文本宽:=20,文本高:=20,间隔:=0
         背景色:="0xff88ff",文本色:="0x880055"
           CoordMode,Mouse,Screen
             SetWinDelay, 10
               初始化()
                 SetTimer,实时移动,10


gosub 文字尾巴

return





英文:
SwitchIME(0x04090409)


msgbox,,,已经切换英文模式,0.1


str:="现在是英文模式",tt
  n:=StrLen(str)
    文本宽:=20,文本高:=20,间隔:=0

   背景色:="0xffffff",文本色:="0x880055" 
     CoordMode,Mouse,Screen
         SetWinDelay, 10
          初始化()y
            SetTimer,实时移动,10

 gosub 文字尾巴

return

大写:
msgbox,,,大写模式,0.1
      

SetCapsLockState,on

return



SwitchIME(dwLayout){
   

 HKL:=DllCall("LoadKeyboardLayout", Str, dwLayout, UInt, 1)
  

  ControlGetFocus,ctl,A
   

 SendMessage,0x50,0,HKL,%ctl%,A


            }



;If (A_PriorHotkey = A_ThisHotkey && A_TimeSincePriorHotkey < 210)
                                











文字尾巴:



    
  


 
    Critical
    Random,r,0,255
    Random,g,0,255
    Random,b,0,255
    文本色:="0x" Format("{:x}",r) Format("{:x}",g) Format("{:x}",b)
 



    初始化(){
    global
    MouseGetPos,mouse_x,mouse_y
    x0:=mouse_x+50
    y0:=mouse_y ;+20


    loop,% n {
    	ix:=x0+(A_Index-1)*文本宽+间隔,iy:=y0 ;+(A_Index-1)*文本高+间隔
    	gui,ts%A_Index%:new,-Caption +ToolWindow Hwndtt%A_Index% AlwaysOnTop
    	gui,ts%A_Index%:Font,s14 w700         
    	gui,ts%A_Index%:Color,%背景色%
    	gui,ts%A_Index%:Add,Text,vt%A_Index% c%文本色% x0 y0,% SubStr(str,A_Index,1)
    	gui,ts%A_Index%:Show,w%文本高% h%文本高% x%ix% y%iy%
    	WinSet, TransColor, %背景色%,% "ahk_id " tt%A_Index%
    	Sleep,180
                }
    return



                }



    实时移动(){
    global
    MouseGetPos,mouse_x,mouse_y


    loop,% n {
    x0:=mouse_x+50
    y0:=mouse_y ;+20
    ix:=x0+(A_Index-1)*文本宽+间隔,iy:=y0 ;+(A_Index-1)*文本高+间隔
    WinMove,% "ahk_id " tt%A_Index%,,%ix%,%iy%
            }
              }



return






给TA捐赠
共{{data.count}}人
人已捐赠
其他

AHK中英文切换

2021-12-2 14:52:34

其他

AHK做一次同名目录存在检测

2021-12-2 14:52:46

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索