*AutoHotkey [#h82df47d]
#contents
**概要 [#adea700f]
[[AutoHotkeyを流行らせるページ:http://lukewarm.s101.xrea.com/]]より~
>
 AutoHotkeyはホットキーへの機能の割り当てなど常駐ソフトの作成に特化したスクリプトエンジンである。
 多彩なコマンドが用意されており、GUIを持ったプログラムの作成も可能。
 GNU GENERAL PUBLIC LICENSE Version 2の下で配布されるフリーソフトで、C++で作られている。
 公式サイト(http://www.autohotkey.com/)にて、インストーラー版とZIPアーカイブ版の2種類が配布されている。
 インストーラーを実行すると、スタートメニュー、新規作成メニュー、関連付けに変更が加えられる。 

-自動化 - 所謂マクロ。 
-ホットキー - スクリプトを常駐、特定のキーやボタンが押されたときにひとつ、あるいは複数の機能を割り当て。
-[[Hotstring:http://lukewarm.s101.xrea.com/Hotstrings.html]] - 日本語での利用には多少工夫が必要。
-GUI - GUI を設定できる。CUIのソフトのフロントエンドなどはおてのもの。 
-[[リマップ:http://lukewarm.s101.xrea.com/remap.html]] - キーやボタンをリマップできる。 特定のウィンドウやウインドウ毎にリマップすることも可能。
-実行ファイル - 実行に必要なファイルとともに自作スクリプトを実行ファイルに変換可能。AHKがインストールされていない環境に向けても配布が可能に。

詳しい特徴と機能についての紹介は [[AutoHotkeyを流行らせるページ → イントロダクション:http://lukewarm.s101.xrea.com/Introduction.html]] でされています。

//''初心者の場合''、作業の省力化、効率化、自動化などを目的にホットキーへの機能の割り当て、キーボードリマップ、マクロを組む、といった用途でAHK(AutoHotkey)を利用するのは問題ないんですが、(きっかけとしてはありかもしれませんが)'''プログラミング学習目的'''でAHKの選択はしない方が賢明だと思います。

**スクリプト [#e4410784]
//解説待ち

**DllCall [#b8001daa]
ホットキーへの機能の割り当て以外に、GUIがあり、[[DllCall():http://lukewarm.s101.xrea.com/commands/DllCall.html]](AutoHotkeyを流行らせるページ)がかなり強力な事もあり(向き不向きはありますが)大抵の事は出来ると思います。

//解説待ち

-→[[参考リンク>#yc223dfb]]

**COM [#xe018ac5]
COM([[Component Object Model - Wikipedia:http://ja.wikipedia.org/wiki/Component_Object_Model]])を利用する事も出来ます。

//解説待ち

-→[[参考リンク>#udcd699d]]

**FAQ [#kcda885c]
本家:AutoHotkeyを流行らせるページ →[[FAQのスレ:http://lukewarm.s101.xrea.com/test/read.cgi/bbs/1200674082/]]
***Q.文字化け?ダメ文字? [#oc2f06dc]
A.
:[[AutoHotkey スレッド part6:http://pc11.2ch.net/test/read.cgi/software/1219130051/]]より~|
>
 Q:「~AチЯ㌔荏柿義形港餐汁秦疏蛋伝覗描冒輿倭兪啻嫣彖拜杼歔」を含む文字列がうまく扱えないよ
 A:これらの文字の2バイト目が、AHKのエスケープ文字である0x60[`]なため。
   対処としてはこれらの文字の"直後"に「`」を記述する(例:「線形`代数」)か、
   #EscapeCharでエスケープ文字を別のものに変えるべし。 

::関連|
[[エスケープ文字:http://lukewarm.s101.xrea.com/Scripts.htm#escape]]、
[[#EscapeChar:http://lukewarm.s101.xrea.com/commands/_EscapeChar.htm]] (ともにAutoHotkeyを流行らせるページ)

対策用の関数、ライブラリは[[参考リンク>ダメ文字問題対策>#w52e9b62]]を参照。

***Q.コンパイルした実行ファイルがアンチウイルスソフトに怒られるんだけど? [#ia1516a8]
A.[[Compile_AHK II>AutoHotKey#Compile_AHK2]] を試してみて下さい(08年12月14日現在)。"No UPX"オプションがあるので、UPXで圧縮しないでコンパイルしてみて下さい。
もしかしたら改善されるかもしれません。~
関連用語:[[実行ファイル圧縮>プログラミング用語#exe_comp-ja]]

//{{追加お願いします。}}

**参考リンク [#la6d4373]
:[[AutoHotkey - Free Mouse and Keyboard Macro Program with Hotkeys and AutoText:http://www.autohotkey.com/]]|
公式サイト
:[[AutoHotkeyを流行らせるページ:http://lukewarm.s101.xrea.com/]]|
日本に於ける総本山

***スクリプト [#v67b1dcd]
:[[AutoHotkey Script Showcase:http://www.autohotkey.com/docs/scripts/]]|
代表的なスクリプト。

:[[AutoHotkey wiki - Category:Scripts - AutoHotkey:http://www.autohotkey.com/wiki/index.php?title=Category:Scripts]] , [[Script Listing - AutoHotkey:http://www.autohotkey.com/wiki/index.php?title=Script_Listing]]|
目当てのスクリプト(の記事)を見つけるのに[[Forum:http://www.autohotkey.com/forum/]]から検索して探すのが大変なら、先ずこのページにあるリンクからあたってみましょう。 - 中には古い記事もあるので記事の日付け、内容に注意。

:[[AutoHotkeyを流行らせるページ → My Scripts:http://lukewarm.s101.xrea.com/myscripts/index.html]]|
AutoHotkeyを流行らせるページの管理人さんが作成したスクリプト、ライブラリ各種。

***DllCall [#yc223dfb]
:[[API Wrappers - AutoHotkey wiki:http://www.autohotkey.com/wiki/index.php?title=API_Wrappers]]|
WinAPI関連:WinAPI ( [[Windows API - Wikipedia:http://ja.wikipedia.org/wiki/Windows_API]] )(Windowsが提供するさまざまな機能)にアクセス出来ます。

:[[Windows Data Types lookup tool - Autohotkey forums:http://www.autohotkey.com/forum/viewtopic.php?t=12036]]|
:[[Windows Data Types lookup tool - Autohotkey forums:http://www.autohotkey.com/forum/topic12036.html]]|
WinAPI関連:補助スクリプト

:[[Crazy Scripting : A handy tool to lookup Win32 Constants - Autohotkey forums:http://www.autohotkey.com/forum/topic19766.html]]|
WinAPI関連:補助スクリプト "W32C_R01.CSV is a listing of 11836 Constants"

:[[Easy WinAPI - WinAPI Parser, DllCall with single hotkey - Autohotkey forums:http://www.autohotkey.com/forum/viewtopic.php?t=33464]]|
:[[Easy WinAPI - WinAPI Parser, DllCall with single hotkey - Autohotkey forums:http://www.autohotkey.com/forum/topic33464.html]]|
WinAPI関連:補助スクリプト

:[[StructParser (for C/C++ structs) - Autohotkey forums:http://www.autohotkey.com/forum/viewtopic.php?t=27644]]|
:[[StructParser (for C/C++ structs) - Autohotkey forums:http://www.autohotkey.com/forum/topic27644.html]]|
補助スクリプト: →[[Known Issues - Autohotkey forums:http://www.autohotkey.com/forum/post-172883.html&sid=9497a16de8656b80cdf59bb961cb2ec1#172883]]

:[[OpenGL DllCalls - Autohotkey forums:http://www.autohotkey.com/forum/topic31078.html&sid=aedbea1e05c43ff9162903c45407c8d2]]|
:[[OpenGL DllCalls - Autohotkey forums:http://www.autohotkey.com/forum/topic31078.html]]|
OpenGL in AHK.~
関連:[[Zippos OpenGL - AHK 3D-Engine. - Autohotkey forums(独語):http://de.autohotkey.com/forum/topic3977.html&sid=c0317e48d9b3089947041249d742ac60]]→[[操作解説(英語)-Keys - Autohotkey forums:http://www.autohotkey.com/forum/post-233842.html&sid=9d3510f63696c83c85be97d91f0a2253#233842]]
関連:[[Zippos OpenGL - AHK 3D-Engine. - Autohotkey forums(独語):http://de.autohotkey.com/forum/topic3977.html]]→[[操作解説(英語)-Keys - Autohotkey forums:http://www.autohotkey.com/forum/post-233842.html&sid=9d3510f63696c83c85be97d91f0a2253#233842]]

***COM [#udcd699d]
:[[COM Wrappers - AutoHotkey wiki:http://www.autohotkey.com/wiki/index.php?title=COM_Wrappers]]|
いくつかCOMラッパーの提供もされています。

:[[COM Standard Library - Autohotkey forums:http://www.autohotkey.com/forum/topic22923.html&highlight=ws4ahk+ahk&sid=fb965ac2c916550b56c4a6b092c416a6]]|
:[[COM Standard Library - Autohotkey forums:http://www.autohotkey.com/forum/topic22923.html]]|
→ [[関数ライブラリスクリプト:http://lukewarm.s101.xrea.com/Function.html#library]]、[[#Include:http://lukewarm.s101.xrea.com/commands/_Include.html]] (ともにAutoHotkeyを流行らせるページ)

:[[Embed an Internet Explorer control in your AHK Gui via COM - Autohotkey forums:http://www.autohotkey.com/forum/viewtopic.php?t=19225]]|
:[[Embed an Internet Explorer control in your AHK Gui via COM - Autohotkey forums:http://www.autohotkey.com/forum/topic19225.html]]|
"This is a standard library for IE/WebBrowser controls."~
関連:[[IE and Gui Browser Com Tutorial - Autohotkey forums:http://www.autohotkey.com/forum/topic34972.html&sid=571b0156e248dca403d12412d3502571]]
関連:[[IE and Gui Browser Com Tutorial - Autohotkey forums:http://www.autohotkey.com/forum/topic34972.html]]

:[[Windows Scripting for Autohotkey - official homepage:http://www.autohotkey.net/~easycom/]]|
"Embed VBScript or JScript directly in your Autohotkey programs."~
[[Embedded Windows Scripting (VBScript & JScript) and COM - official thread in the Autohotkey forums:http://www.autohotkey.com/forum/topic21674.html]]

:[[AutoHotkeyを流行らせるページ → My Scripts → ActiveX:http://lukewarm.s101.xrea.com/myscripts/index.html]]|
WSH等で使われるActiveXObjectを扱えるようにする

***ダメ文字問題対策 [#w52e9b62]
-[[新・なまず日記(2006-01-11) - AutoHotkeyのダメ文字問題対策:http://www.tierra.ne.jp/~aki/diary/?date=20060111#p01]]
-[[(AutoHotkey)(IMEの制御をする 編) - もらかなです。:http://d.hatena.ne.jp/morakana/20080213/1202876561]]
-[[クリップボードを使わないで全角文字を貼付ける - eamatの日記:http://d.hatena.ne.jp/eamat/20050921/p1]]
-[[AutoHotkeyでマルチバイト(全角)文字を文字化けなしで出力する関数 - ナレッジデータベース モバイル:http://it.kndb.jp/m/entry/id/1188]]
:AutoHotkey駄目文字微対策版|
[[物置 > AutoHotkey:http://yak.myhome.cx/junks/#ahk.cp932]]~
1.0.47.06ベースにされたようです(08年12月25日現在)。~
''注'')文字列処理(含:正規表現)では依然駄目文字等の問題は残ります。

***デバッグ あれこれ [#c2514e63]
:[[AutoHotkeyを流行らせるページ → スクリプト → スクリプトのデバッグ:http://lukewarm.s101.xrea.com/Scripts.html]]|
スクリプトが期待通りに動作しているかを確認するには

:[[AutoHotkeyを流行らせるページ → リファレンス → OutputDebug:http://lukewarm.s101.xrea.com/commands/OutputDebug.html]]|
デバッガ([[DebugView for Windows>AutoHotKey#DebugView]]など)に文字列を出力

:[[Debugging - Autohotkey forums:http://www.autohotkey.com/forum/topic23678.html&highlight=debugview&sid=0a79db6b51152cae18afddfaa7e71364]]|
:[[110.22 Ahk script Debugger 1.1.5b (line-by-line capable):http://www.autohotkey.com/forum/topic7302.html]]|
"An interactive AHk debugger"

:[[Debugging - Autohotkey forums:http://www.autohotkey.com/forum/topic23678.html]]|
Debug helper スクリプト など

:[[Debug() [Func] - Autohotkey forums:http://www.autohotkey.com/forum/topic31416.html&highlight=debug&sid=632cf754985f59737c010cfc4aa11122]]|
:[[Debug() [Func] - Autohotkey forums:http://www.autohotkey.com/forum/topic31416.html]]|
>
 if you're working with #Include files
 function must be called from itself rather than calling from d.ahk
 to show correct info for currently executing function/filename 

:[[debugging using A_LIneNumber - Autohotkey forums:http://www.autohotkey.com/forum/topic24397.html&highlight=debugview&sid=0a79db6b51152cae18afddfaa7e71364]]|
:[[debugging using A_LIneNumber - Autohotkey forums:http://www.autohotkey.com/forum/topic24397.html]]|
RunDebugView.ahk - [[DebugView for Windows>AutoHotKey#DebugView]] を利用。

:[[Gui, Show bug - Autohotkey forums:http://www.autohotkey.com/forum/topic17316.html&highlight=debugview&sid=0a79db6b51152cae18afddfaa7e71364]]|
:[[Gui, Show bug - Autohotkey forums:http://www.autohotkey.com/forum/topic17316.html]]|
Trace.ahk - [[DebugView for Windows>AutoHotKey#DebugView]] を利用。

:[[DllCallDebugger Proof of Concept:http://www.autohotkey.com/forum/topic36665.html]]|
Requires: LowLevel.ahk([[LowLevel & dynamic code:http://www.autohotkey.com/forum/topic26300.html]])

**Tools [#c138c78c]

:&aname(DebugView){DebugView};([[DebugView for Windows - © Microsoft Corporation.:http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx]])|
デバッグトレースを表示
::使い方 - 参考:|[[差をつけるデバッグ術! ~ 知られざるログ出力 - プログラミング徹底解説:http://keicode.com/windows/win15.php]]

:[[Dependency Walker (depends.exe) Home Page:http://www.dependencywalker.com/]]|
最新版:2.2.6000が入手できる~
[[Dependency Walker 日本語化パッチ+α - G-PROJECT:http://www.gprj.net/wiki/index.php?title=Dependency_Walker_%E6%97%A5%E6%9C%AC%E8%AA%9E%E5%8C%96%E3%83%91%E3%83%83%E3%83%81%2B%CE%B1]]~
[[Dependency Walkerの文字化け対策 - G-PROJECT:http://www.gprj.net/wiki/index.php?title=Dependency_Walker%E3%81%AE%E6%96%87%E5%AD%97%E5%8C%96%E3%81%91%E5%AF%BE%E7%AD%96]]~
[[[SMS] Dependency Walker for Win32 (Depends.exe) について:http://support.microsoft.com/kb/198707/ja]]

:[[DLL Export Viewer:http://www.nirsoft.net/utils/dll_export_viewer.html]]|
システム内のdll/指定したdllの関数をスキャン
:[[Dll Export Finder:http://jacquelin.potier.free.fr/dllexportfinder/]]|
指定したディレクトリのdllの関数をスキャン

:[[ActiveVB - ApiViewer (en):http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.html]]|
WinAPIビューワー

:[[COMView:http://www.japheth.de/COMView.html]]|
PSDK付属のOleView.Exeの代替として使用できるツール
:[[MiTeC OLE/COM Object Explorer:http://www.mitec.cz/Data/XML/data_downloads.xml]]|
PSDK付属のOleView.Exeの代替として使用できるツール

:[[SPY for Internet Explorer:http://darksky.biz/index.php/Software/SPY%20for%20Internet%20Explorer]]|
実行中のInternet Explorerで発生するイベントの監視(WebBrowser control)

**mini info [#v3454dba]
:[[Beta version pre-v1.0.48: Up to 3x faster performance - Autohotkey forums:http://www.autohotkey.com/forum/viewtopic.php?t=38034]]|
赤くは無いけど、AutoHotkey本体のBetaバージョン(pre-v1.0.48)は三倍速くなってるそうです。

:&aname(Compile_AHK2){Compile_AHK II};([[Compile_AHK II - for those who compile! - Autohotkey forums:http://www.autohotkey.com/forum/topic22975.html]])|
Update of 2008-11-05 以降、"No UPX"オプションが付いています。~
(コンパイラそのものは公式サイトで配布されているものに標準で付いて来ます)

:[[SciTE4AutoHotkey - メニューの日本語化and日本語入力:http://www8.uploader.jp/dl/vipprog/vipprog_uljp00625.txt.html]]|
SciTE をAutoHotkey用に最適化された [[SciTE4AutoHotkey:http://www.autohotkey.net/~fincs/SciTE4AutoHotkey/index.htm]] の日本語化手順。~
Forum内のスレッド:[[SciTE4AutoHotkey - New version:http://www.autohotkey.com/forum/topic19323.html]]

:[[ironahk - Google Code:http://code.google.com/p/ironahk/]]|
クロスプラットホーム向けに開発が進められているAutoHotkeyからのフォーク。~
Forum内のスレッド:[[IronAHK - .NET port of AutoHotkey for Windows, Linux, Mac...:http://www.autohotkey.com/forum/topic34421.html]]

:chm版リファレンス - [[スクリプト投稿スレ > 127:http://lukewarm.s101.xrea.com/test/read.cgi/bbs/1092315194/127]]|
『AutoHotkeyを流行らせるページ』のHTML HELP版、 v1.0.47.00 対応。


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS