小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

[FUNC]為AutoHotkey寫(xiě)個(gè)print函數(shù)替代msgbox大法

 dinghj 2019-04-14

【方法一】學(xué)用AutoHotkey的可能不習(xí)慣沒(méi)有print函數(shù)吧,輸出都用msgbox有些怪怪的,下面我就為使用Scite4AutoHotkey的用戶寫(xiě)個(gè)print函數(shù),請(qǐng)將此函數(shù)另存到你的lib目錄,命名為print.ahk即可,不用引用而直接使用了。

 

print(text)
{
	oSciTE:= ComObjActive("SciTE4AHK.Application")
	oSciTE.Output(text)
}

輸出你好的效果如下

 

【清屏】

  1. scite可以支持輸出區(qū)清屏的,
  2. SciObj := ComObjActive("SciTE4AHK.Application") ;get pointer to active SciTE window
  3. SendMessage,SciObj.Message(0x111,420)
SciTE_Output("hello中國(guó)")
SciTE_Output("計(jì)算式1+1=" . 1+1,0,0)
SciTE_Output("計(jì)算式1+1=" . 1+1,0,1,1)
return

;https:///boards/viewtopic.php?f=7&t=20397
SciTE_Output(Text,Clear=1,LineBreak=1,Exit=0){
SciObj := ComObjActive("SciTE4AHK.Application") ;get pointer to active SciTE window
IfEqual,Clear,1,SendMessage,SciObj.Message(0x111,420) ;If clear=1 Clear output window
IfEqual, LineBreak,1,SetEnv,Text,`r`n%text% ;If LineBreak=1 prepend text with `r`n
SciObj.Output(Text) ;send text to SciTE output pane
IfEqual, Exit,1,MsgBox, 36, Exit App?, Exit Application? ;If Exit=1 ask if want to exit application
IfMsgBox,Yes, ExitApp ;If Msgbox=yes then Exit the appliciation
}

 

【方法二】網(wǎng)友寫(xiě)的調(diào)用cmd.exe來(lái)顯示輸出信息的:

  1. F4::
  2. a:=10
  3. 輸出(a)
  4. 輸出(a+10)
  5. 輸出(a*10)
  6. return
  7. ; OutputDebug, %內(nèi)容%
  8. 清空(){
  9. ControlSend,,cls`r,ahk_class ConsoleWindowClass
  10. }
  11. 輸出(內(nèi)容){
  12. if(WinExist("ahk_class ConsoleWindowClass")=0)
  13. {
  14. Run,cmd.exe
  15. sleep 500
  16. }
  17. ControlSend,,::%內(nèi)容%`r,ahk_class ConsoleWindowClass
  18. }

【推薦方法】:用ahk內(nèi)置命令OutputDebug來(lái)調(diào)試,需下載debugview工具:

 

https://github.com/CobaltFusion/DebugViewPP
DebugView 的增強(qiáng)版本。可以捕捉指定進(jìn)程、含命令行版本。

 

在ahk腳本中用OutputDebug命令來(lái)輸出調(diào)試信息,命令形式如下:
OutputDebug,想要輸出的字符串

  1. F4::
  2. a:=10
  3. 輸出(a)
  4. 輸出(a+10)
  5. 輸出(a*10)
  6. return
  7. 輸出(內(nèi)容){
  8. OutputDebug, %內(nèi)容%
  9. }

 

 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多