Send a simulated press Key to the Visual Studio running program

Source: Internet
Author: User

Link: http://blog.csdn.net/zhangxaochen/article/details/8096740

The following scenario occurs:

The program is a vs2010 project, but the logic is written in Lua. Therefore, when writing Lua, The scite editor provided in Notepad ++ and luaforwindows is used.
However, every time I write code in Notepad ++, I switch to vs2010 to run the program, and then switch back to find the error. It is very troublesome if the number of times is too large. So I want to switch to vs2010 and run the program directly on notepad ++ press Ctrl + F5?
With the autohotkey script, it is easy to implement:

$^F5:: SetTitleMatchMode 2if (WinExist("Microsoft Visual Studio") && not WinActive("Microsoft Visual Studio")){ MyToolTip("vs2010 NOT active", 666) ;ControlSend, , cmd{Enter}, cmd.exe ControlSend, , ^{F5}, Microsoft Visual Studio}else if WinActive("Microsoft Visual Studio"){ SendInput ^{F5} MyToolTip("vs2010 IS active", 666)}else MyToolTip("vs2010 CLOSED", 666)returnMyToolTip(msg, millisecond){ ToolTip, %msg% Sleep millisecond ToolTip}

In this way, if Visual Studio is on and the focus is not on it, for example, if the focus is on notepad ++ or another Editor, press Ctrl + F5 to send Ctrl + F5 to. It eliminates the trouble of switching to vs to run the program.

By the way, we are obligated to promote autohotkey O (?_ =) O, the gospel of shortcut key control:

Http://xbeta.info/autohotkey-guide-2.htm

Http://cn.autohotkey.com/

Link: http://blog.csdn.net/zhangxaochen/article/details/8096740

{Over }}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.