Win32-GuiTest-1.64 > 1.3 との差分

Win32::GuiTest 1.3 と 1.64 の差分

11
2=encoding euc-jp
2=encoding utf8
33
4=head1 名前
4=head1 NAME
55
6Win32::GuiTest - Perl GUI テスト ユーティリティー
6=begin original
77
8=head1 概要
8Win32::GuiTest - Perl GUI Test Utilities.
99
10=end original
11
12Win32::GuiTest - Perl GUI テストユーティリティ
13
14=head1 SYNOPSIS
15
1016 use Win32::GuiTest qw(FindWindowLike GetWindowText
1117 SetForegroundWindow SendKeys);
1218
13 $Win32::GuiTest::debug = 0; # 冗長モードにするためには"1"に設定
19 $Win32::GuiTest::debug = 0; # Set to "1" to enable verbose mode
1420
1521 my @windows = FindWindowLike(0, "^Microsoft Excel", "^XLMAIN\$");
1622 for (@windows) {
1723 print "$_>\t'", GetWindowText($_), "'\n";
1824 SetForegroundWindow($_);
1925 SendKeys("%fn~a{TAB}b{TAB}{BS}{DOWN}");
2026 }
2127
22=head1 インストール方法
28=head1 INSTALLATION
2329
30 // This batch file comes with MS Visual Studio. Running
31 // it first might help with various compilation problems.
32 vcvars32.bat
33
2434 perl makefile.pl
2535 nmake
2636 nmake test
2737 nmake install
2838
29ActivePerl 5.6を使っているのであれば、
39 See more details in the DEVELOPMENT section elswhere in this document.
30(http://www.activestate.com/Products/ActivePerl/index.html)
31私が代わりに入れているバイナリ・パッケージをインストールすることができます。
32コマンドラインからPPM(Perl Package Manger)と入力する必要があります。
33私が送ったファイルを解凍し、あなたのマシンのディレクトリに入れた後、
34PPMと入力し以下のようにしてください:
3540
41=begin original
42
43You can get the most recent release from
44L<http://www.sourceforge.net/projects/winguitest>. The package will
45contain Win32-GuiTest.ppd file and Win32-GuiTest.tar.gz file,
46which is all that you need to use
47ppm. If you put those 2 files in C:\TEMP directory, the installation
48should look as follows. Enter PPM (Perl Package Manager) from the
49command-line and type commands as below
50
51=end original
52
53You can get the most recent release from
54L<http://www.sourceforge.net/projects/winguitest>. The package will
55contain Win32-GuiTest.ppd file and Win32-GuiTest.tar.gz file,
56which is all that you need to use
57ppm. If you put those 2 files in C:\TEMP directory, the installation
58should look as follows. Enter PPM (Perl Package Manager) from the
59command-line and type commands as below
60(TBT)
61
3662 C:\TEMP>ppm
3763 PPM interactive shell (2.0) - type 'help' for available commands.
3864 PPM> install C:\temp\win32-guitest.ppd
3965 Install package 'C:\temp\win32-guitest.ppd?' (y/N): Y
4066 Retrieving package 'C:\temp\win32-guitest.ppd'...
4167 Writing C:\Perl\site\lib\auto\Win32\GuiTest\.packlist
4268 PPM>
4369
44私は'c:\temp'に解凍しました。あなたが解凍したディレクトリを代わりに
70=begin original
45使ってください。
4671
72I extracted them to 'c:\temp', please use the directory where you extracted
73the files instead.
4774
48=head1 説明
75=end original
4976
50がこれで見てき/書いてきた、ほとんどのWin32用のGUIテストスクリプトは
77は'c:\temp'に展開し;
51なんらかのVisual Basicの一種(例えば MS-VB るいは MS-Visual Testど)
78あなたが展開したディレクトリ代わりに使ってください。
52使っていました。その主な理由はSendKeys関数が使えるということです。
5379
54テストスクリプトからWin32プログラムを動かす素晴らしい方法は、OLEオートメーション
80=head1 DESCRIPTION
55(ActiveXスクリプティング)です。しかし全てのWin32プログラムがこのインターフェースを
56サポートしているわけではありません。それこどSendkeysが役に立つのです。
5781
58以前Al WilliamsはDr. Dobb'sでDelphi版を公開しました
82=begin original
59(http://www.ddj.com/ddj/1997/careers1/wil2.htm)。私はそれをCに移植し、
60h2xsを使ってパッケージ化しました...
6183
62私は迷いながらもこのモジュールの名前をWin32::GuiTestとしました(私がより多くの
84Most GUI test scripts I have seen/written for Win32 use some variant of Visual
63GUIテスト機能を入れることを考えているのが主な理由です)
85Basic (e.g. MS-VB or MS-Visual Test). The main reason is the availability of
86the SendKeys function.
6487
65みなさんが参加することができる、このモジュールのためのYahooグループを作成
88=end original
66しています
90私がこれまで見てきた/書いてきた、ほとんどの Win32 用の GUI テストスクリプトは
91なんらかの Visual Basic の一種(例えば MS-VB あるいは MS-Visual Test など)を
92使っていました。
93その主な理由は SendKeys 関数が使えるということです。
94
95=begin original
96
97A nice way to drive Win32 programs from a test script is to use OLE Automation
98(ActiveX Scripting), but not all Win32 programs support this interface. That is
99where SendKeys comes handy.
100
101=end original
102
103テストスクリプトから Win32 プログラムを動かす素晴らしい方法は、
104OLE オートメーション (ActiveX スクリプティング)です。
105しかし全ての Win32 プログラムがこのインターフェースを
106サポートしているわけではありません。
107それこど Sendkeys が役に立つのです。
108
109=begin original
110
111Some time ago Al Williams published a Delphi version in Dr. Dobb's
112(http://www.drdobbs.com/keys-to-the-kingdom/184410429). I ported it to C and
113packaged it using h2xs...
114
115=end original
116
117以前 Al Williams は Dr. Dobb's で Delphi 版を公開しました
118(http://www.drdobbs.com/keys-to-the-kingdom/184410429)。
119私はそれを C に移植し、h2xs を使ってパッケージ化しました...。
120
121=begin original
122
123The tentative name for this module is Win32::GuiTest (mostly because I plan to
124include more GUI testing functions).
125
126=end original
127
128私は迷いながらもこのモジュールの名前を Win32::GuiTest としました
129(私がより多くの GUI テスト機能を入れることを考えているのが主な理由です)。
130
131=begin original
132
133I've created a Yahoo Group for the module that you can join at
67134 http://groups.yahoo.com/group/perlguitest/join
68135
69=head1 バージョン
136=end original
70137
71 1.3
138みなさんが参加することができる、このモジュールのための Yahoo グループを作成
139しています:
140 http://groups.yahoo.com/group/perlguitest/join
72141
73=head1 変更履歴
142=begin original
74143
750.01 Wed Aug 12 21:58:13 1998
144Also, an initial version of a script recording application has been written to use with this
145module. A copy of it may be found with this distribution (Recorder\Win32GuiTest.exe)
146or can be obtained at http://sourceforge.net/projects/winguitest
76147
77 - original version; created by h2xs 1.18
148=end original
78149
790.02 Sun Oct 25 20:18:17 1998
150Also, an initial version of a script recording application has been written to use with this
151module. A copy of it may be found with this distribution (Recorder\Win32GuiTest.exe)
152or can be obtained at http://sourceforge.net/projects/winguitest
153(TBT)
80154
81 - Added several Win32 API functions (typemap courtesy
155=begin original
82 of Win32::APIRegistry):
83 SetForegroundWindow
84 GetDesktopWindow
85 GetWindow
86 GetWindowText
87 GetClassName
88 GetParent
89 GetWindowLong
90 SetFocus
91156
92 - Ported FindWindowLike (MS-KB, Article ID: Q147659) from VB to
157If the documentation of these functions is not satisfactory, you can
93 Perl. Instead of using VB's "like", I used Perl regexps.
158try running a search on http://msdn.microsoft.com/ using the name of the function.
94
159Some of these functions are described there.
950.03 Sun Oct 31 18:31:52 1999
96160
97 - Perhaps first version released thru CPAN (user: erngui).
161=end original
98162
99 - Changed name from Win32::Test to Win32::GuiTest
163If the documentation of these functions is not satisfactory, you can
164try running a search on http://msdn.microsoft.com/ using the name of the function.
165Some of these functions are described there.
166(TBT)
100167
101 - Fixed bug: using strdup resulted in using system malloc and
168=begin original
102 perl's free, resulting in a runtime error.
103 This way we always use perl's malloc. Got the idea from
104 'ext\Dynaloader\dl_aix.xs:calloc'.
105169
1060.04 Fri Jan 7 17:44:00 2000
170This distribution of the module - the one you are looking at now - has
171its own CVS repository at http://sourceforge.net/projects/winguitest
172Patches to both the code and the documentation are welcome.
107173
108 - Fixed Compatibility with ActivePerl 522. Thanks to
174=end original
109 Johannes Maehner <johanm@camline.com> for the initial patch.
110 There were two main issues:
111 /1/ ActivePerl (without CAPI=TRUE) compiles extensions in C++ mode
112 (some casts from void*, etc.. were needed).
113 /2/ The old typemap + buffers.h I was using had been rendered
114 incompatible by changes in ActivePerl. As the incompatible typemaps
115 were redundant, I deleted them.
116 Now it works on ActivePerl (both using 'perl makefile.pl'
117 and 'perl makefile.pl CAPI=TRUE') and on CPAN perl
118 (http://www.perl.com/CPAN/src/stable.zip).
119175
120 - As requests for changes keep comming in, I've decided to put it all
176This distribution of the module - the one you are looking at now - has
121 under version control (cvs if you're curious about it).
177its own CVS repository at http://sourceforge.net/projects/winguitest
178Patches to both the code and the documentation are welcome.
179(TBT)
122180
1230.05 Sat Mar 11 23:11:42 2000
181=cut
124182
125 - Added support for sending function keys (e.g. "%{F4}"). A new test
183=head2 Functions
126 script is added to the distribution (eg\notepad.pl) to test
127 this functionality.
128184
129 - Code cleanup to make adding new keywords easier.
185(関数)
130186
1310.06 Sun Mar 12 01:51:18 2000
187=over 4
132188
133 - Added support for sending mouse events.
189=item $debug
134 Thanks to Ben Shern <shernbj@louisville.stortek.com> for the idea
135 and original code. Also added 'eg\paint.pl' to the distribution to
136 test this functionality.
137190
138 - Code cleanup.
191=begin original
139192
193When set enables the verbose mode.
140194
1410.07 Sun Nov 19 13:02:00 2000
195=end original
142196
143 - Added MouseMoveAbsPix to allow moving the mouse to an absolute pixel
197設定すると冗長モードになります。
144 coordinate instead of using mouse_event's (0, 0) to (65535, 65535)
145 coordinates.
146 Thanks to Phill Wolf <pbwolf@bellatlantic.net> for the idea
147 and original code. Also added 'eg\paint_abs.pl' to the distribution
148 to test this functionality.
149198
150 - Added binaries for the ActivePerl distribution.
199=item SendKeys($keys[,$delay])
151200
1520.08 Sun Dec 17 19:33:07 2000
201=begin original
153202
154 - Added WMGetText to allow getting the content of an EDIT window. See
203Sends keystrokes to the active window as if typed at the keyboard using the
155 'eg\notepad_text.pl' for more details.
204optional delay between key-up and key-down messages (default is 25 ms and
156 Thanks to Mauro <m_servizi@yahoo.it> from Italy for the idea.
205should be OK for most uses).
157206
1580.09 Thu Jan 4 22:30:50 2001
207=end original
159208
160 - Added {SPC} action to sendkeys to simulate hitting the spacebar.
209オプションでキーストロークの間に遅延を入れながら、アクティブな
161 Thanks to Sohrab Niramwalla <sohrab.niramwalla@utoronto.ca> for the
210ウィンドウにまるでキボードから打ち込んだようにキーアップと
162 idea.
211キーダウンのメッセージを送信します
212(デフォルトは25msでほとんどの利用では大丈夫でしょう)。
163213
1641.00 Sun May 13 22:02:01 2001
214=begin original
165215
166 - Fixed a bug in FindWindowLike that caused duplicated window handles to
216The keystrokes to send are specified in KEYS. There are several
167 be returned.
217characters that have special meaning. This allows sending control codes
218and modifiers:
168219
169 - Simplified the logic in FindWindowLike.
220=end original
170221
171 - Added IsChild and GetChildDepth functions. Exported GetChildWindows.
222送信されるキーストロークは KEYS で指定します。
223いくつかの特別な意味を持つ文字があります。
224これにより制御コードや修飾子も送信できます:
172225
173 - Added more tests (tightening the net in XP-speak)
226=begin original
174227
175 - Added 'eg\spy--.pl' to the distribution.
228 ~ means ENTER
229 + means SHIFT
230 ^ means CTRL
231 % means ALT
176232
1771.10 Sun Jun 17 19:54:27 2001
233=end original
178234
179 - Added GetWindowRect, GetScreenRes, ScreenToNorm and NormToScreen,
235 ~ ENTER
180 following suggestion and code from Frank van Dijk <fvdijk@oke.nl>.
236 + SHIFT
237 ^ は CTRL
238 % は ALT
181239
182 - Added SendMessage, PostMessage, GetCursorPos, AttachWin,
240=begin original
183 additional SendKeys flags (Windows keys and context menu),
184 WMSetText, GetCaretPos, GetFocus, GetActiveWindow, GetForegroundWindow,
185 SetActiveWindow, EnableWindow, IsWindowEnabled, IsWindowVisible and
186 ShowWindow (+ constants to use it).
187241
188 Thanks to Jarek Jurasz <jurasz@imb.uni-karlsruhe.de> for all of them.
242The parens allow character grouping. You may group several characters, so
243that a specific keyboard modifier applies to all of them. Groups can
244be enclosed in groups.
189245
190 Jarek also provided two scripts: 'eg\showmouse.pl' and 'eg\showwin.pl'.
246=end original
191 I found showwin very interesting (if somewhat dangerous!).
192247
193 He also fixed an export list problem (WMGetKey was mentioned instead
248かっこにより文字をグループ化することができます。
194 of WMGetText) and added export tags :ALL and :SW, so that full module
249複数の文字をグループにすることができ、
195 functionality can be imported with
250特定のキーボードの修飾子をそれらの全てに適用することができます。
251グループはグループで囲むことができます。
196252
197 use Win32::GuiTest qw(:ALL :SW);
253=begin original
198254
199 - Added IsWindow, ScreenToClient, ClientToScreen, IsCheckedButton and
255E.g. SendKeys("ABC") is equivalent to SendKeys("+(abc)")
200 IsGrayedButton.
201256
202 - SendKeys now takes an optional parameter to change the default 50 ms
257=end original
203 delay between keystrokes. Suggested by Wilson P. Snyder II
204 <wsnyder@world.std.com>.
205258
2061.20 Wed Jul 18 20:44:11 2001
259例: SendKeys("ABC") SendKeys("+(abc)") でも同じです
207260
208 - Added GetComboText, GetComboContents, GetListText and GetListContents
261=begin original
209 to allow easy extraction of data from list and combo boxes.
210262
211 - Added 'eg\fonts.pl' to show the new functionality. This script opens
263The curly braces are used to quote special characters (SendKeys("{+}{{}")
212 the Notepad "Font" dialog and prints to stdout the contents of the Font
264sends a '+' and a '{'). You can also use them to specify certain named actions:
213 combobox.
214265
215 - Fixed bug in SendMessage (and others), where the return value was lost
266=end original
216 Caused by a missing OUTPUT tag.
217267
218 - Added IsKeyPressed function. Suggested by Rudi Farkas.
268中かっこは特殊文字をクォートするために使われます(SendKeys("{+}{{}")
219 See 'eg\keypress.pl' for a demo. Works even if the script
269 '+' '{' を送信します)。
220 is running in the background.
270またそれらを使って名前が付けられたアクションを使うことができます:
221271
2221.30 Sat Dec 1 20:50:02 2001
272=begin original
223273
224 - Fixed bad POD formating. Added podchecker and html pod generation to makedist.bat.
274 Name Action
225275
226 - Added PushButton and PushChildButton. Based on code from an anonymous contributor. Thanks!
276=end original
227 See 'eg\pushbutton.pl' for an example.
228277
229 - Fixed a problem when building with Active State, build 526.
278 名前 アクション
230279
231=head1 関数
280=begin original
232281
233=over 8
282 {BACKSPACE} Backspace
283 {BS} Backspace
284 {BKSP} Backspace
285 {BREAK} Break
286 {CAPS} Caps Lock
287 {DELETE} Delete
288 {DOWN} Down arrow
289 {END} End
290 {ENTER} Enter (same as ~)
291 {ESCAPE} Escape
292 {HELP} Help key
293 {HOME} Home
294 {INSERT} Insert
295 {LEFT} Left arrow
296 {NUMLOCK} Num lock
297 {PGDN} Page down
298 {PGUP} Page up
299 {PRTSCR} Print screen
300 {RIGHT} Right arrow
301 {SCROLL} Scroll lock
302 {TAB} Tab
303 {UP} Up arrow
304 {PAUSE} Pause
305 {F1} Function Key 1
306 ... ...
307 {F24} Function Key 24
308 {SPC} Spacebar
309 {SPACE} Spacebar
310 {SPACEBAR} Spacebar
311 {LWI} Left Windows Key
312 {RWI} Right Windows Key
313 {APP} Open Context Menu Key
234314
315=end original
235316
236=item $debug
317 {BACKSPACE} Backspace
318 {BS} Backspace
319 {BKSP} Backspace
320 {BREAK} Break
321 {CAPS} Caps Lock
322 {DELETE} Delete
323 {DOWN} 下矢印
324 {END} End
325 {ENTER} Enter (~ と同じ)
326 {ESCAPE} Escape
327 {HELP} Help キー
328 {HOME} Home
329 {INSERT} Insert
330 {LEFT} 左矢印
331 {NUMLOCK} Num lock
332 {PGDN} Page down
333 {PGUP} Page up
334 {PRTSCR} Print screen
335 {RIGHT} 右矢印
336 {SCROLL} Scroll lock
337 {TAB} Tab
338 {UP} 上矢印
339 {PAUSE} Pause
340 {F1} ファンクションキー 1
341 ... ...
342 {F24} ファンクションキー 24
343 {SPC} スペース
344 {SPACE} スペース
345 {SPACEBAR} スペース
346 {LWI} 左 Windows キー
347 {RWI} 右 Windows キー
348 {APP} コンテキストメニューキー
237349
238設定すると冗長モードになります。
350=begin original
239351
352or supply a number that will be treated as a VK code. Note that a single-digit
353number will be treated as a character, so prepend these with '0'.
240354
241=item SendKeys KEYS [DELAY]
355=end original
242356
243オプションでキストロークの間に遅延(=delay)を入ながら、アクティブな
357または、VK コドとして扱わる数値を指定します。
244ウィンドウにまるでキボードから打ち込んだようキーストローク送信します
358一桁の数字は文字として扱われ、その前 '0' 付けてください
245(デフォルトは50msでほとんどの利用では大丈夫でしょう)
246359
247送信されるキーストロークはKEYSで指定されます。いくつかの特別な意味を持つ
360=begin original
248文字があります。これにより制御コードや修飾子も送信することができます:
249
250 ~ は ENTER を
251 + は SHIFT を
252 ^ は CTRL を
253 % は ALT を、それぞれ意味します
254361
255括弧により文字をグループ化することができます。いくつかの文字をグループに
362All these named actions take an optional integer argument, like in {RIGHT 5}.
256することができ、特定のキーボードの修飾子をそれらの全てに適用することが
363For all of them, except PAUSE, the argument means a repeat count. For PAUSE
257できます。
364it means the number of milliseconds SendKeys should pause before proceding.
258365
259例. SendKeys("ABC") は SendKeys("+(abc)") でも同じです
366=end original
260367
261大括弧は特殊文字を引用するために使わます(SendKeys("{+}{{}")
368らの全ての名前付きのアクションは、{RIGHT 5} のようにオプションで整数の
262は'+'と'{'送信します)またそれらを使って名前が付けられたアクションを
369引数取ります。
263使うこが出来ます。
370PAUSE を除いた全てにっては、引数は繰り返しの回数を意味します。
371PAUSE にとっては、先に進む前に SendKeys が中断するミリ秒数を意味します。
264372
265 名前 アクション
373=begin original
266374
267 {BACKSPACE} Backspace
375In this implementation, SendKeys always returns after sending the keystrokes.
268 {BS} Backspace
376There is no way to tell if an application has processed those keys when the
269 {BKSP} Backspace
377function returns.
270 {BREAK} Break
271 {CAPS} Caps Lock
272 {DELETE} Delete
273 {DOWN} 下矢印
274 {END} End
275 {ENTER} Enter (~を同じ)
276 {ESCAPE} Escape
277 {HELP} Helpキー
278 {HOME} Home
279 {INSERT} Insert
280 {LEFT} 左矢印
281 {NUMLOCK} Num lock
282 {PGDN} Page down
283 {PGUP} Page up
284 {PRTSCR} Print screen
285 {RIGHT} 右矢印
286 {SCROLL} Scroll lock
287 {TAB} Tab
288 {UP} 上矢印
289 {PAUSE} Pause
290 {F1} Function Key 1
291 ... ...
292 {F24} Function Key 24
293 {SPC} 空白
294 {SPACE} 空白
295 {SPACEBAR} 空白
296 {LWI} 左Windowsキー
297 {RWI} 右Windowsキー
298 {APP} オープン・コンテキスト・メニュー・キー
299378
300これらの全ての名前付きのアクションは、{RIGHT 5}のようにオプションで整数の
379=end original
301引数を取ります。PAUSEの除くこれらは全てにとって、引数は繰り返しの回数を
302意味します。PAUSEにとっては先に進む前に中断するミリ秒数を意味します。
303380
304この実装では、SendKeys常にキーストロークを送信した後、常に戻ります。
381この実装では、SendKeys は、キーストロークを送信した後、常に戻ります。
305この関数が戻ってきて時、アプリケーションがそれらのキーを処理しおえているか
382この関数が戻ってきたとき、アプリケーションがそれらのキーを
306知る方法はありません。
383処理し終えているかを知る方法はありません。
307384
308=back
385=begin original
309386
310=over 8
387Unicode characters in C<$keys> are translated into set of ALT+NUMPAD keystrokes.
388Note that not all applications can understand unicode input.
311389
312=item SendMouse COMMAND
390=end original
313391
314関数マウス入力をエミュレートます。COMMANDパラメータは
392C<$keys> 中の Unicode 文字、ALT+NUMPAD キロークに変換されます。
3151つあるいはそれ以上文字列が入った文字列す:
393全てアプリケーション Unicode 力を理解きるわけではないことに
394注意してください。
316395
396=cut
397
398=item SendMouse($command)
399
400=begin original
401
402This function emulates mouse input. The COMMAND parameter is a string
403containing one or more of the following substrings:
404
405=end original
406
407この関数はマウス入力をエミュレートします。
408COMMAND パラメータは一つあるいはそれ以上の文字列が入った文字列です:
409
410=begin original
411
412 {LEFTDOWN} left button down
413 {LEFTUP} left button up
414 {MIDDLEDOWN} middle button down
415 {MIDDLEUP} middle button up
416 {RIGHTDOWN} right button down
417 {RIGHTUP} right button up
418 {LEFTCLICK} left button single click
419 {MIDDLECLICK} middle button single click
420 {RIGHTCLICK} right button single click
421 {ABSx,y} move to absolute coordinate ( x, y )
422 {RELx,y} move to relative coordinate ( x, y )
423
424=end original
425
317426 {LEFTDOWN} 左ボタンのダウン
318427 {LEFTUP} 左ボタンのアップ
319428 {MIDDLEDOWN} 中ボタンのダウン
320429 {MIDDLEUP} 中ボタンのアップ
321430 {RIGHTDOWN} 右ボタンのダウン
322431 {RIGHTUP} 右ボタンのアップ
323432 {LEFTCLICK} 左ボタンのシングルクリック
324433 {MIDDLECLICK} 中ボタンのシングルクリック
325434 {RIGHTCLICK} 右ボタンのシングルクリック
326435 {ABSx,y} 絶対座標( x, y )に移動
327436 {RELx,y} 相対座標( x, y )に移動
328437
329注意: 絶対マウス座標の範囲は0から65535になります。
438=begin original
330 相対座標は正にも負にもすることができます。
331 ピクセル座標が必要であれば、MouseMoveAbsPixを使うことが出来ます。
332439
440Note: Absolute mouse coordinates range from 0 to 65535.
441 Relative coordinates can be positive or negative.
442 If you need pixel coordinates you can use MouseMoveAbsPix.
443
444=end original
445
446注意: 絶対マウス座標の範囲は 0 から 65535 になります。
447 相対座標は正にも負にもなります。
448 ピクセル座標が必要であれば、MouseMoveAbsPix を使えます。
449
450=begin original
451
452Also equivalent low-level functions are available:
453
454=end original
455
333456同等の低レベルの関数を利用することもできます:
334457
335 SendLButtonUp()
458 SendLButtonUp()
336 SendLButtonDown()
459 SendLButtonDown()
337 SendMButtonUp()
460 SendMButtonUp()
338 SendMButtonDown()
461 SendMButtonDown()
339 SendRButtonUp()
462 SendRButtonUp()
340 SendRButtonDown()
463 SendRButtonDown()
341 SendMouseMoveRel(x,y)
464 SendMouseMoveRel(x,y)
342 SendMouseMoveAbs(x,y)
465 SendMouseMoveAbs(x,y)
343466
344=back
467=cut
345468
346=over 8
469=item MouseMoveAbsPix($x,$y)
347470
348=item MouseMoveAbsPix(X,Y)
471=begin original
349472
473Move the mouse cursor to the screen pixel indicated as parameter.
474
475=end original
476
350477パラメータとして指定された画面上のピクセルにマウスカーソルを
351478移動します。
352479
480=begin original
353481
354 # ピクセル座標での x=200, y=100 に移動します。
482 # Moves to x=200, y=100 in pixel coordinates.
355 MouseMoveAbsPix(200, 100);
483 MouseMoveAbsPix(200, 100);
356
357484
485=end original
358486
359=item FindWindowLike WINDOW, TITLEPATTERN, CLASSPATTERN, CHILDID
487 # ピクセル座標での x=200, y=100 に移動します。
488 MouseMoveAbsPix(200, 100);
360489
361指定されたパラメータにマッチするウィンドウのウィンドウ・ハンドルを探し、
490=cut
491
492=item MouseMoveWheel($change)
493
494=begin original
495
496 Positive or negative value to direct mouse wheel movement.
497
498=end original
499
500マウスホイールの動きを示す正または負の値
501
502=cut
503
504=item FindWindowLike($window,$titleregex,$classregex,$childid,$maxlevel)
505
506=begin original
507
508Finds the window handles of the windows matching the specified parameters and
509returns them as a list.
510
511=end original
512
513指定されたパラメータにマッチするウィンドウのウィンドウハンドルを探し、
362514それをリストで返します。
363515
364下方に検索するウィンドウのハンドルを指定することが出来ます。このルーチンは
516=begin original
365このウィンドウの全ての子供とさらにその子供を再帰的に検索していきます。
366もし'undef'であれば、このルーチンは全てのウィンドウを探していきます。
367Windowのキャプションの文字列にマッチさせるために使われる正規表現もあります。
368子供ID番号を渡すと、この関数はそのIDを追ったウィンドウにのみマッチします。
369いずれもundefは全てにマッチします。
370517
371=back
518You may specify the handle of the window to search under. The routine
519searches through all of this windows children and their children recursively.
520If 'undef' then the routine searches through all windows. There is also a
521regexp used to match against the text in the window caption and another regexp
522used to match against the text in the window class. If you pass a child ID
523number, the functions will only match windows with this id. In each case
524undef matches everything.
372525
373=over 8
526=end original
374527
375=item PushButton BUTTON [, DELAY]
528検索対象のウィンドウハンドルを指定できます。
529このルーチンはこのウィンドウの全ての子供とさらにその子供を
530再帰的に検索していきます。
531もし 'undef' であれば、このルーチンは全てのウィンドウを探していきます。
532ウィンドウのキャプションの文字列にマッチングさせるために使われるものと
533ウィンドウクラスのテキストにマッチングさせるために
534使われるものの二つの正規表現もあります。
535子 ID 番号を渡すと、この関数はその ID を持つウィンドウにのみマッチングします。
536どちらの場合も undef は全てにマッチングします。
376537
538=cut
377539
540=item GetWindowID($window)
541
542=begin original
543
544 Returns the control Id of the specified window.
545
546=end original
547
548指定されたウィンドウの制御 ID を返します。
549
550=cut
551
552=item PushButton($button[,$delay])
553
554=begin original
555
556Equivalent to
557
558=end original
559
560次のものと同じです:
561
378562 PushChildButton(GetForegroundWindow, BUTTON, DELAY)
379563
380と同じです。
564=cut
381565
382=back
566=item PushChildButton($parent,$button[,$delay])
383567
384=over 8
568=begin original
385569
386=item PushChildButton( parent, button [, delay] )
570Allows generating a mouse click on a particular button.
387571
388特定のボタンへのマウスクリックを生成することを可能にします。
572=end original
389573
574特定のボタンへのマウスクリックを生成できるようにします。
575
576=begin original
577
578parent - the parent window of the button
579
580=end original
581
390582parent - そのボタンの親ウィンドウ
391583
584=begin original
585
586button - either the text in a button (e.g. "Yes") or the control ID
587of a button.
588
589=end original
590
392591button - ボタンのテキスト(例えば "Yes")あるいは、ボタンの
393コントロールIDのどちらかです。
592制御 ID のどちらかです。
394593
594=begin original
595
596delay - the time (0.25 means 250 ms) to wait between the mouse down
597and the mouse up event. This is useful for debugging.
598
599=end original
600
395601delay - マウスダウンとマウスアップイベントの間の時間
396(0.25 は 250 ms を意味します)を意味します。これはデバッグのときに
602(0.25 は 250 ms を意味します)を意味します。
397便利です。
603これはデバッグのときに便利です。
398604
605=cut
606
607=item PushChildById( $parent, $button, $level, $delay )
608
609=begin original
610
611Allows pushing a button, which control id is eqaul to a given parameter.
612C<PushChildButton> tries to match parameter against control id or
613caption.
614PushChildById matches only against control id. Secondly, PushChildById
615allows specifying search depth in the windows hierarchy tree.
616The default is 2, which means that only direct children will be
617pushed.
618
619=end original
620
621Allows pushing a button, which control id is eqaul to a given parameter.
622C<PushChildButton> tries to match parameter against control id or
623caption.
624PushChildById matches only against control id. Secondly, PushChildById
625allows specifying search depth in the windows hierarchy tree.
626The default is 2, which means that only direct children will be
627pushed.
628(TBT)
629
630=cut
631
632=item WaitWindowLike($parent,$wndtitle,$wndclass,$wndid,$depth,$wait)
633
634=begin original
635
636Function which allows one to wait for a window to appear
637vs. using hard waits (e.g. sleep 2).
638
639=end original
640
641Function which allows one to wait for a window to appear
642vs. using hard waits (e.g. sleep 2).
643(TBT)
644
645=begin original
646
647parent - Where to start (parent window)
648
649=end original
650
651parent - 開始位置 (親ウィンドウ)
652
653=begin original
654
655wndtitle - Regexp for the window title
656
657=end original
658
659wndtitle - ウィンドウタイトルのための正規表現
660
661=begin original
662
663wndclass - Regexp for the window class name
664
665=end original
666
667wndclass - ウィンドウクラス名のための正規表現
668
669=begin original
670
671wndid - Numeric Window or Control ID
672
673=end original
674
675wndid - ウィンドウ ID か 制御 ID の数値
676
677=begin original
678
679depth - How deep should we search before we stop
680
681=end original
682
683depth - How deep should we search before we stop
684(TBT)
685
686=begin original
687
688wait - How many seconds should we wait before giving up
689
690=end original
691
692wait - How many seconds should we wait before giving up
693(TBT)
694
695=cut
696
697=item WaitWindow($wndtitle,[$wait])
698
699=begin original
700
701Minimal version of WaitWindowLike. Only requires the window title
702regexp. You can also specify the wait timeout in seconds.
703
704=end original
705
706Minimal version of WaitWindowLike. Only requires the window title
707regexp. You can also specify the wait timeout in seconds.
708(TBT)
709
710=begin original
711
712wndtitle - Regexp for the window title
713
714=end original
715
716wndclass - ウィンドウクラス名のための正規表現
717
718=begin original
719
720wait - How many seconds should we wait before giving up
721
722=end original
723
724wait - How many seconds should we wait before giving up
725(TBT)
726
727=cut
728
729=item IsWindowStyle($window, $style)
730
731=begin original
732
733 Determines if a window has the specified style. See sample
734 script for more details.
735
736=end original
737
738ウィンドウが指定されたスタイルを持っているかどうかを判定します。
739さらなる詳細についてはサンプルスクリプトを参照してください。
740
741=cut
742
743=item IsWindowStyleEx($window, $exstyle)
744
745=begin original
746
747 Determines if a window has the specified extended
748 style. See sample script for more details.
749
750=end original
751
752ウィンドウが指定された拡張スタイルを持っているかどうかを判定します。
753さらなる詳細についてはサンプルスクリプトを参照してください。
754
755=cut
756
757=item GetMenu
758
759=begin original
760
761Using the corresponding library function (see MSDN) it returns a MenuID number
762
763=end original
764
765対応するライブラリ関数を使って(MSDN 参照) MenuID 番号を返します。
766
767=item GetMenuItemIndex($curr, $menu);
768
769=begin original
770
771$curr is a MenuId and $menu is the (localized !) name of the menu including the hot
772key: "Rep&eate"
773Returns the index of the menu item (-1 if not found)
774
775=end original
776
777$curr は MenuId で、$menu は
778ホットキーを含むメニューの(ローカル化された!)名前です: "Rep&eate"
779メニューアイテムのインデックスを返します (見つからない場合は -1)。
780
781=item GetMenuItemCount($menu)
782
783=begin original
784
785Returns the number of elements in the given menu.
786
787=end original
788
789指定されたメニューの要素数を返します。
790
791=item MenuSelect($menupath,$window,$menu)
792
793=begin original
794
795Allows selecting a menu programmatically.
796
797=end original
798
799メニューをプログラムで選択できるようにします。
800
801=begin original
802
803Simple Examples:
804 # Exit foreground application through application menu.
805 MenuSelect("&File|E&xit");
806
807=end original
808
809単純な例:
810
811 # Exit foreground application through application menu.
812 MenuSelect("&File|E&xit");
813
814 # Exit foreground application through system menu
815 MenuSelect("&Close", 0, GetSystemMenu(GetForegroundWindow(), FALSE));
816
817=item GetMenuItemInfo($menuHndl, $cnt)
818
819=begin original
820
821Receives a menu handler (one we got from GetMenu or GetSubMenu) and
822a number (which is the location of the item within the given menu).
823
824=end original
825
826Receives a menu handler (one we got from GetMenu or GetSubMenu) and
827a number (which is the location of the item within the given menu).
828(TBT)
829
830=begin original
831
832Returns a hash of which there are currently 2 keys:
833type can be either "string" or "separator" - this is the type of the menu item
834text is the visible text of the menu item (provided only for "string" type)
835
836=end original
837
838Returns a hash of which there are currently 2 keys:
839type can be either "string" or "separator" - this is the type of the menu item
840text is the visible text of the menu item (provided only for "string" type)
841(TBT)
842
843=begin original
844
845WARNING: This is an experimental function. Its behavior might change.
846
847=end original
848
849WARNING: This is an experimental function. Its behavior might change.
850(TBT)
851
852=cut
853
854=item MouseClick($window [,$parent] [,$x_offset] [,$y_offset] [,$button] [,$delay])
855
856=begin original
857
858Allows one to easily interact with an application through mouse emulation.
859
860=end original
861
862Allows one to easily interact with an application through mouse emulation.
863(TBT)
864
865=begin original
866
867window = Regexp for a Window caption / Child caption, or just a Child ID.
868
869=end original
870
871window = Regexp for a Window caption / Child caption, or just a Child ID.
872(TBT)
873
874=begin original
875
876parent = Handle to parent window. Default is foreground window. Use
877GetDesktopWindow() return value for this if clicking on an application
878title bar.
879
880=end original
881
882parent = Handle to parent window. Default is foreground window. Use
883GetDesktopWindow() return value for this if clicking on an application
884title bar.
885(TBT)
886
887=begin original
888
889x_offset = Offset for X axis. Default is 0.
890
891=end original
892
893x_offset = Offset for X axis. Default is 0.
894(TBT)
895
896=begin original
897
898y_offset = Offset for Y axis. Default is 0.
899
900=end original
901
902y_offset = Offset for Y axis. Default is 0.
903(TBT)
904
905=begin original
906
907button = {LEFT}, {MIDDLE}, {RIGHT}. Default is {LEFT}
908
909=end original
910
911button = {LEFT}, {MIDDLE}, {RIGHT}. Default is {LEFT}
912(TBT)
913
914=begin original
915
916delay = Default is 0. 0.50 = 500 ms. Delay between button down and
917button up.
918
919=end original
920
921delay = Default is 0. 0.50 = 500 ms. Delay between button down and
922button up.
923(TBT)
924
925=begin original
926
927Simple Examples:
928
929=end original
930
931単純な例:
932
933 # Click on CE button if its parent window is in foreground.
934 MouseClick('^CE$');
935
936 # Right click on CE button if its parent window is in foreground
937 MouseClick('^CE$', undef, undef, undef, '{RIGHT}');
938
939 # Click on 8 button window under the specified parent window; where
940 # [PARENTHWND] will be replaced by a parent handle variable.
941 MouseClick('8', [PARENTHWND]);
942
943 # Click on Calculator parent window itself
944 MouseClick('Calculator', GetDesktopWindow());
945
946=cut
947
948=item $buf_str = AllocateVirtualBuffer( $hwnd, $size )
949
950=begin original
951
952Allocates memory in the address space of the process, which is an owner of
953a window identified by $hwnd. Returns a reference to a hash, which has 2 elements:
954
955=end original
956
957Allocates memory in the address space of the process, which is an owner of
958a window identified by $hwnd. Returns a reference to a hash, which has 2 elements:
959(TBT)
960
961=over 8
962
963=item ptr - address of the allocated memory
964
965=item process - process handle (in the Win32 meaning, as returned by Win32 OpenProcess
966API function
967
399968=back
400969
401=head1 著作権(=COPYRIGHT)
970=cut
402971
972=item $value = ReadFromVirtualBuffer( $buf_str, $size )
973
974=begin original
975
976Read from a memory in the address space of the other process.
977C<$buf_str> is a reference to a hash returned by AllocateVirtualBuffer.
978
979=end original
980
981Read from a memory in the address space of the other process.
982C<$buf_str> is a reference to a hash returned by AllocateVirtualBuffer.
983(TBT)
984
985=begin original
986
987Returns read value.
988
989=end original
990
991Returns read value.
992(TBT)
993
994=cut
995
996=item WriteToVirtualBuffer( $buf_str, $value )
997
998=begin original
999
1000Write to a memory in the address space of the other process.
1001C<$buf_str> is a reference to a hash returned by AllocateVirtualBuffer.
1002C<$value> is a value to be copied.
1003
1004=end original
1005
1006Write to a memory in the address space of the other process.
1007C<$buf_str> is a reference to a hash returned by AllocateVirtualBuffer.
1008C<$value> is a value to be copied.
1009(TBT)
1010
1011=cut
1012
1013=item FreeVirtualBuffer( $buf_str )
1014
1015=begin original
1016
1017Frees memory allocated by AllocateVirtualBuffer
1018
1019=end original
1020
1021Frees memory allocated by AllocateVirtualBuffer
1022(TBT)
1023
1024=cut
1025
1026=item $text = WMGetText($hwnd) *
1027
1028=begin original
1029
1030Sends a WM_GETTEXT to a window and returns its contents
1031
1032=end original
1033
1034Sends a WM_GETTEXT to a window and returns its contents
1035(TBT)
1036
1037=item $set = WMSetText(hwnd,text) *
1038
1039=begin original
1040
1041Sends a WM_SETTEXT to a window setting its contents
1042
1043=end original
1044
1045Sends a WM_SETTEXT to a window setting its contents
1046(TBT)
1047
1048=item ($x,$y) = GetCursorPos() *
1049
1050=begin original
1051
1052Retrieves the cursor's position,in screen coordinates as (x,y) array.
1053
1054=end original
1055
1056Retrieves the cursor's position,in screen coordinates as (x,y) array.
1057(TBT)
1058
1059=item GetCaretPos()
1060
1061=begin original
1062
1063Retrieves the caret's position, in client coordinates as (x,y) array. (Like Windows function)
1064
1065=end original
1066
1067Retrieves the caret's position, in client coordinates as (x,y) array. (Like Windows function)
1068(TBT)
1069
1070=item HWND SetFocus(hWnd)
1071
1072=begin original
1073
1074Sets the keyboard focus to the specified window
1075
1076=end original
1077
1078Sets the keyboard focus to the specified window
1079(TBT)
1080
1081=item HWND GetDesktopWindow() *
1082
1083=begin original
1084
1085Returns a handle to the desktop window
1086
1087=end original
1088
1089Returns a handle to the desktop window
1090(TBT)
1091
1092=item HWND GetWindow(hwnd,uCmd) *
1093
1094=item SV * GetWindowText(hwnd) *
1095
1096=begin original
1097
1098Get the text name of the window as shown on the top of it.
1099Beware, this is text depends on localization.
1100
1101=end original
1102
1103Get the text name of the window as shown on the top of it.
1104Beware, this is text depends on localization.
1105(TBT)
1106
1107=item $class = GetClassName(hwnd) *
1108
1109=begin original
1110
1111Using the same Windows library function returns the name
1112of the class wo which the specified window belongs.
1113
1114=end original
1115
1116Using the same Windows library function returns the name
1117of the class wo which the specified window belongs.
1118(TBT)
1119
1120=begin original
1121
1122See MSDN for more details.
1123
1124=end original
1125
1126See MSDN for more details.
1127(TBT)
1128
1129=begin original
1130
1131You can also check out MSDN to see an overview of the Window Classes.
1132
1133=end original
1134
1135You can also check out MSDN to see an overview of the Window Classes.
1136(TBT)
1137
1138=item HWND GetParent(hwnd) *
1139
1140=begin original
1141
1142A library function (see MSDN) to return the WindowID of the parent window.
1143See MSDN for the special cases.
1144
1145=end original
1146
1147A library function (see MSDN) to return the WindowID of the parent window.
1148See MSDN for the special cases.
1149(TBT)
1150
1151=item long GetWindowLong(hwnd,index) *
1152
1153=item BOOL SetForegroundWindow(hWnd) *
1154
1155=begin original
1156
1157See corresponding Windows functions.
1158
1159=end original
1160
1161See corresponding Windows functions.
1162(TBT)
1163
1164=item @wnds = GetChildWindows(hWnd)
1165
1166=begin original
1167
1168Using EnumChildWindows library function (see MSDN) it returns the WindowID
1169of each child window. If the children have their own children the function
1170returns them too until the tree ends.
1171
1172=end original
1173
1174Using EnumChildWindows library function (see MSDN) it returns the WindowID
1175of each child window. If the children have their own children the function
1176returns them too until the tree ends.
1177(TBT)
1178
1179=item BOOL IsChild(hWndParent,hWnd) *
1180
1181=begin original
1182
1183Using the corresponding library function (see MSDN) it returns true
1184if the second window is an immediate child or a descendant window of
1185the first window.
1186
1187=end original
1188
1189Using the corresponding library function (see MSDN) it returns true
1190if the second window is an immediate child or a descendant window of
1191the first window.
1192(TBT)
1193
1194=item $depth = GetChildDepth(hAncestor,hChild)
1195
1196=begin original
1197
1198Using the GetParent library function in a loop, returns the distance
1199between an ancestor window and a child (descendant) window.
1200
1201=end original
1202
1203Using the GetParent library function in a loop, returns the distance
1204between an ancestor window and a child (descendant) window.
1205(TBT)
1206
1207=begin original
1208
1209Features/bugs:
1210If the given "ancsetor" is not really an ancestor, the return value is the distance of child from the root window (0)
1211If you supply the same id for both the ancestor and the child you get 1.
1212If the ancestor you are checking is not 0 then the distance given is 1 larger than it should be.
1213
1214=end original
1215
1216Features/bugs:
1217If the given "ancsetor" is not really an ancestor, the return value is the distance of child from the root window (0)
1218If you supply the same id for both the ancestor and the child you get 1.
1219If the ancestor you are checking is not 0 then the distance given is 1 larger than it should be.
1220(TBT)
1221
1222=begin original
1223
1224see eg\get_child_depth.pl
1225
1226=end original
1227
1228see eg\get_child_depth.pl
1229(TBT)
1230
1231=item $res = SendMessage(hWnd,Msg,wParam,lParam) *
1232
1233=begin original
1234
1235This is a library function (see MSDN) used by a number of the functions provided by
1236Win32::GuiTest. It sends the specified message to a window or windows.
1237HWnd is the WindowID or HWND_BROADCAST to send message to all top level windows.
1238 Message is not sent to child windows. (If I understand this correctly this means
1239 it is sent to all the immediate children of the root window (0).
1240Msg the message
1241wParam additional parameter
1242lParam additioanl parameter
1243
1244=end original
1245
1246This is a library function (see MSDN) used by a number of the functions provided by
1247Win32::GuiTest. It sends the specified message to a window or windows.
1248HWnd is the WindowID or HWND_BROADCAST to send message to all top level windows.
1249 Message is not sent to child windows. (If I understand this correctly this means
1250 it is sent to all the immediate children of the root window (0).
1251Msg the message
1252wParam additional parameter
1253lParam additioanl parameter
1254(TBT)
1255
1256=begin original
1257
1258It is most likely you won't use this directly but through one of the functions
1259implemented already in Win32::GuiTest.
1260
1261=end original
1262
1263It is most likely you won't use this directly but through one of the functions
1264implemented already in Win32::GuiTest.
1265(TBT)
1266
1267=begin original
1268
1269See the guitest.xs for some examples.
1270
1271=end original
1272
1273See the guitest.xs for some examples.
1274(TBT)
1275
1276=item $res = PostMessage(hwnd,msg,wParam,lParam) *
1277
1278=begin original
1279
1280See corresponding Windows library function in MSDN.
1281
1282=end original
1283
1284See corresponding Windows library function in MSDN.
1285(TBT)
1286
1287=item CheckButton(hwnd)
1288
1289=item UnCheckButton(hwnd)
1290
1291=item GrayOutButton(hwnd)
1292
1293=item BOOL IsCheckedButton(hwnd)
1294
1295=item BOOL IsGrayedButton(hwnd)
1296
1297=begin original
1298
1299The names say it. Works on radio buttons and
1300checkboxes. For regular buttons, use IsWindowEnabled.
1301
1302=end original
1303
1304The names say it. Works on radio buttons and
1305checkboxes. For regular buttons, use IsWindowEnabled.
1306(TBT)
1307
1308=item BOOL IsWindow(hwnd) *
1309
1310=item ($x,$y) = ScreenToClient(hwnd,x,y) *
1311
1312=item ($x,$y) = ClientToScreen(hwnd,x,y) *
1313
1314=item ($x,$y) = GetCaretPos(hwnd) *A
1315
1316=item HWND SetFocus(hWnd) *A
1317
1318=item HWND GetFocus(hwnd) *A
1319
1320=item HWND GetActiveWindow(hwnd) *A
1321
1322=item HWND GetForegroundWindow() *
1323
1324=item HWND SetActiveWindow(hwnd) *A
1325
1326=item BOOL EnableWindow(hwnd,fEnable) *
1327
1328=item BOOL IsWindowEnabled(hwnd)*
1329
1330=item BOOL IsWindowVisible(hwnd)*
1331
1332=item BOOL ShowWindow(hwnd,nCmdShow) *A
1333
1334=begin original
1335
1336See corresponding Windows functions.
1337
1338=end original
1339
1340対応する Windows 関数を参照してください。
1341
1342=item ($x,$y) = ScreenToNorm(x,y)
1343
1344=begin original
1345
1346Returns normalised coordinates of given point (0-FFFF as a fraction of screen
1347resolution)
1348
1349=end original
1350
1351Returns normalised coordinates of given point (0-FFFF as a fraction of screen
1352resolution)
1353(TBT)
1354
1355=item ($x,$y) = NormToScreen(x,y)
1356
1357=begin original
1358
1359The opposite transformation
1360
1361=end original
1362
1363The opposite transformation
1364(TBT)
1365
1366=item ($x,$y) = GetScreenRes()
1367
1368=begin original
1369
1370Returns screen resolution
1371
1372=end original
1373
1374Returns screen resolution
1375(TBT)
1376
1377=item HWND WindowFromPoint(x, y)
1378
1379=item ($l,$t,$r,$b) = GetWindowRect(hWnd) *
1380
1381=item ($l,$t,$r,$b) = GetClientRect(hWnd) *
1382
1383=begin original
1384
1385See corresponding Windows functions.
1386
1387=end original
1388
1389See corresponding Windows functions.
1390(TBT)
1391
1392=cut
1393
1394=item SelComboItem($window, $index)
1395
1396=begin original
1397
1398Selects an item in the combo box based off an index (zero-based).
1399
1400=end original
1401
1402Selects an item in the combo box based off an index (zero-based).
1403(TBT)
1404
1405=item SelComboItemText($window, $txt)
1406
1407=begin original
1408
1409Selects an item in the combo box based off text (case insensitive).
1410
1411=end original
1412
1413Selects an item in the combo box based off text (case insensitive).
1414(TBT)
1415
1416=item $txt = GetComboText(hwnd,index)
1417
1418=item $txt = GetListText(hwnd,index)
1419
1420=item @lst = GetComboContents(hWnd)
1421
1422=item @lst = GetListContents(hWnd)
1423
1424=begin original
1425
1426Fetch the contents of the list and combo boxes.
1427
1428=end original
1429
1430Fetch the contents of the list and combo boxes.
1431(TBT)
1432
1433=item GetAsyncKeyState($key)
1434
1435=item IsKeyPressed($key)
1436
1437=begin original
1438
1439Wrapper around the GetAsyncKeyState API function. Returns TRUE if the user presses the
1440specified key.
1441
1442=end original
1443
1444Wrapper around the GetAsyncKeyState API function. Returns TRUE if the user presses the
1445specified key.
1446(TBT)
1447
1448 IsKeyPressed("ESC");
1449 IsKeyPressed("A");
1450 IsKeyPressed("DOWN");
1451 IsKeyPressed( VK_DOWN);
1452
1453=cut
1454
1455=pod
1456
1457=item SendRawKey($virtualkey,$flags)
1458
1459=begin original
1460
1461Wrapper around keybd_event. Allows sending low-level keys. The first argument is any of the VK_* constants. The second argument can be 0, KEYEVENTF_EXTENDEDKEY, KEYEVENTF_KEYUP or a combination of them.
1462
1463=end original
1464
1465Wrapper around keybd_event. Allows sending low-level keys. The first argument is any of the VK_* constants. The second argument can be 0, KEYEVENTF_EXTENDEDKEY, KEYEVENTF_KEYUP or a combination of them.
1466(TBT)
1467
1468 KEYEVENTF_EXTENDEDKEY - Means it is an extended key (i.e. to distinguish between arrow keys on the numeric keypad and elsewhere).
1469 KEYEVENTF_KEYUP - Means keyup. Unspecified means keydown.
1470
1471 #Example
1472 use Win32::GuiTest qw/:FUNC :VK/;
1473
1474 while (1) {
1475 SendRawKey(VK_DOWN, KEYEVENTF_EXTENDEDKEY);
1476 SendKeys "{PAUSE 200}";
1477 }
1478
1479=item VkKeyScan(int)
1480
1481=item C<GetListViewContents($handle)>
1482
1483 Return the items of the list view with C<$handle> as a list, each
1484 element of which is a reference to an array containing the values
1485 in each column.
1486
1487=cut
1488
1489=item SelListViewItem($window, $idx, [$multi_select])
1490
1491 Selects an item in the list view based off an index (zero-based).
1492
1493 # Select first item, clears out any previous selections.
1494 SelListViewItem($win, 0);
1495 # Select an *additional* item.
1496 SelListViewItem($win, 1, 1);
1497
1498=cut
1499
1500=item SelListViewItemText($window, $txt, [$multi_select])
1501
1502 Selects an item in the list view based off text (case insensitive).
1503
1504 # Select first item, clears out any previous selections.
1505 SelListViewItemText($win, 'Temp');
1506 # Select an *additional* item.
1507 SelListViewItemText($win, 'cabs', 1);
1508
1509=cut
1510
1511=item IsListViewItemSel($window, $txt)
1512
1513 Determines if the specified list view item is selected.
1514
1515=cut
1516
1517=item GetTabItems($window)
1518
1519 Returns a list of a tab control's labels.
1520
1521=cut
1522
1523=item SelTabItem($window, $idx)
1524
1525 Selects a tab based off an index (zero-based).
1526
1527=cut
1528
1529=item SelTabItemText($window, $txt)
1530
1531 Selects a tab based off text label (case insensitive).
1532
1533=cut
1534
1535=item IsTabItemSel($window, $txt)
1536
1537 Determines if the specified tab item is selected.
1538
1539=cut
1540
1541=item SelTreeViewItemPath($window, $path)
1542
1543 Selects a tree view item based off a "path" (case insensitive).
1544
1545 # Select Machine item and Processors sub-item.
1546 SelTreeViewItemPath($window, "Machine|Processors");
1547
1548 SelTreeViewItemPath($window, "Item");
1549
1550=cut
1551
1552=item GetTreeViewSelPath($window)
1553
1554 Returns a string containing the path (i.e., "parent|child") of
1555 the currently selected tree view item.
1556
1557 $oldpath = GetTreeViewSelPath($window);
1558 SelTreeViewItemPath($window, "Parent|Child");
1559 SelTreeViewItemPath($window, $oldpath);
1560
1561=cut
1562
1563=item $hpopup = GetPopupHandle($hwnd, $x, $y, [$wait])
1564
1565 This function gets the handle of a popup window generated by
1566 right-clicking at the $x and $y screen coordinates (absolute). An
1567 optional delay can be entered which will wait the given number of
1568 milliseconds after the right-click for the window to appear (default
1569 is 50). Zero is returned when no popup menu is found.
1570
1571=back
1572
1573=head2 DibSect
1574
1575=begin original
1576
1577A class to manage a Windows DIB section. Currently limited in functionality to
157824-bit images. Pulled from old code into GuiTest when I (jurasz@imb.uni-karlsruhe.de)
1579needed to create several grayscale screen dumps.
1580
1581=end original
1582
1583A class to manage a Windows DIB section. Currently limited in functionality to
158424-bit images. Pulled from old code into GuiTest when I (jurasz@imb.uni-karlsruhe.de)
1585needed to create several grayscale screen dumps.
1586(TBT)
1587
1588=begin original
1589
1590Possible future extenstions: other color resolutions, loading, comparison of bitmaps,
1591getting from clipboard.
1592
1593=end original
1594
1595Possible future extenstions: other color resolutions, loading, comparison of bitmaps,
1596getting from clipboard.
1597(TBT)
1598
1599=begin original
1600
1601Synopsis:
1602
1603=end original
1604
1605Synopsis:
1606(TBT)
1607
1608 $ds = new Win32::GuiTest::DibSect;
1609 $ds->CopyWindow($w);
1610 $ds->ToGrayScale();
1611 $ds->SaveAs("bla.bmp");
1612 $ds->ToClipboard();
1613
1614=over 8
1615
1616=item bool DibSect::CopyClient(hwnd,[rect])
1617
1618=begin original
1619
1620Copy a client area of given window (or possibly its subset) into a given DibSect.
1621The rectangle may be optionally passed as a reference to 4-element array.
1622To get the right result make sure the window you want to copy is not obscured by
1623others.
1624
1625=end original
1626
1627Copy a client area of given window (or possibly its subset) into a given DibSect.
1628The rectangle may be optionally passed as a reference to 4-element array.
1629To get the right result make sure the window you want to copy is not obscured by
1630others.
1631(TBT)
1632
1633=item bool DibSect::CopyWindow(hwnd)
1634
1635=begin original
1636
1637Copy the window rectangle. Equivalent to
1638
1639=end original
1640
1641Copy the window rectangle. Equivalent to
1642(TBT)
1643
1644 $ds->CopyClient(GetDesktopWindow(), \@{[GetWindowRect($w)]});
1645
1646=item bool DibSect::SaveAs(szFile)
1647
1648=begin original
1649
1650Save the current contents of the DIB section in a given file. With 24-bit
1651resolution it can grow quite big, so I immediately convert them to PNG (direct
1652writing of PNG seemed to complicated to implement).
1653
1654=end original
1655
1656Save the current contents of the DIB section in a given file. With 24-bit
1657resolution it can grow quite big, so I immediately convert them to PNG (direct
1658writing of PNG seemed to complicated to implement).
1659(TBT)
1660
1661=item bool DibSect::Invert()
1662
1663=begin original
1664
1665Invert the colors in a current DIB section.
1666
1667=end original
1668
1669Invert the colors in a current DIB section.
1670(TBT)
1671
1672=item bool DibSect::ToGrayScale()
1673
1674=begin original
1675
1676Convert the DibSection to the gray scale. Note that it is still encoded as 24-bit
1677BMP for simplicity.
1678
1679=end original
1680
1681Convert the DibSection to the gray scale. Note that it is still encoded as 24-bit
1682BMP for simplicity.
1683(TBT)
1684
1685=item bool DibSect::ToClipboard()
1686
1687=begin original
1688
1689Copies the DibSect to clipboard (as an old-fashioned metafile), so that it can
1690be further processed with your favourite image processing software, for example
1691automatically using SendKeys.
1692
1693=end original
1694
1695Copies the DibSect to clipboard (as an old-fashioned metafile), so that it can
1696be further processed with your favourite image processing software, for example
1697automatically using SendKeys.
1698(TBT)
1699
1700=item bool DibSect::Destroy()
1701
1702=begin original
1703
1704Destroys the contents of the DIB section.
1705
1706=end original
1707
1708Destroys the contents of the DIB section.
1709(TBT)
1710
1711=back
1712
1713=cut
1714
1715=head1 UNICODE SUPPORT
1716
1717(Unicode 対応)
1718
1719=begin original
1720
1721Currently (2007) there's no consensus about unicode input in Perl, so
1722the module declares function C<UnicodeSemantics> that sets whether
1723information queried from windows should use A or W syscalls. The
1724function that support this differentiation, and produce different
1725results depending on value set to C<UnicodeSemantics> is:
1726
1727=end original
1728
1729(2007 年) 現在、Perl の Unicode 入力に関する合意はないので、
1730このモジュールは、情報を Windows に問い合わせるときに A と W のどちらの
1731システムコールを使うかを設定する C<UnicodeSemantics> 関数を宣言します。
1732この違いに対応し、C<UnicodeSemantics> に設定された値に依存して
1733異なった結果を返す関数は:
1734
1735=begin original
1736
1737C<GetWindowText>, and all its callers, - FindWindowLike, WaitWindow,
1738WaitWindowLike
1739
1740=end original
1741
1742C<GetWindowText> およびその呼び出し元 - FindWindowLike, WaitWindow,
1743WaitWindowLike
1744
1745=begin original
1746
1747C<SendKeys> translated unicode characters into set of ALT+NUMPAD keystrokes.
1748Note that not all applications can understand unicode input.
1749
1750=end original
1751
1752C<SendKeys> translated unicode characters into set of ALT+NUMPAD keystrokes.
1753Note that not all applications can understand unicode input.
1754(TBT)
1755
1756=over
1757
1758=item UnicodeSemantics [BOOL]
1759
1760=begin original
1761
1762If a boolean parameter is set, changes the semantics flag for functions
1763that return results of either A or W syscalls. If the parameter is
1764not set, returns the current value of the flag.
1765
1766=end original
1767
1768真偽値引数が設定されると、A と W のどちらかのシステムコールの結果を
1769関数の意味論フラグを変更します。
1770引数が設定されないと、現在のフラグの値を返します。
1771
1772=back
1773
1774=head1 DEVELOPMENT
1775
1776(開発)
1777
1778=begin original
1779
1780If you would like to participate in the development of this module there are
1781several thing that need to be done. For some of them you only need Perl
1782and the latest source of the module from CVS for others you'll also need to
1783have a C++ compiler.
1784
1785=end original
1786
1787If you would like to participate in the development of this module there are
1788several thing that need to be done. For some of them you only need Perl
1789and the latest source of the module from CVS for others you'll also need to
1790have a C++ compiler.
1791(TBT)
1792
1793=begin original
1794
1795To get the latest source code you need a CVS client and then do the following:
1796
1797=end original
1798
1799To get the latest source code you need a CVS client and then do the following:
1800(TBT)
1801
1802 cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/winguitest login
1803 cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/winguitest co Win32-GuiTest
1804
1805=begin original
1806
1807See more detailed explanations here http://sourceforge.net/projects/winguitest/
1808
1809=end original
1810
1811See more detailed explanations here http://sourceforge.net/projects/winguitest/
1812(TBT)
1813
1814=head2 cygwin
1815
1816=begin original
1817
1818g++ needs to be installed
1819
1820=end original
1821
1822g++ needs to be installed
1823(TBT)
1824
1825 perl Makefile.PL
1826 make
1827 make test
1828 make install
1829
1830=head2 MSVC environment
1831
1832=begin original
1833
1834To setup a development environment for compiling the C++ code you can either buy
1835Visual Studio with Visual C++ or you can download a few things free of charge from
1836Microsoft. There might be other ways too we have not explored.
1837
1838=end original
1839
1840To setup a development environment for compiling the C++ code you can either buy
1841Visual Studio with Visual C++ or you can download a few things free of charge from
1842Microsoft. There might be other ways too we have not explored.
1843(TBT)
1844
1845=begin original
1846
1847The instructions to get the free environment are here:
1848
1849=end original
1850
1851The instructions to get the free environment are here:
1852(TBT)
1853
1854=begin original
1855
1856From http://www.microsoft.com/ download and install:
1857
1858=end original
1859
1860From http://www.microsoft.com/ download and install:
1861(TBT)
1862
1863 1) Microsoft .NET Framework Version 1.1 Redistributable Package
1864 2) .NET Framework SDK Version 1.1
1865
1866=begin original
1867
1868This is not enough as there are a number of header files and libraries that are
1869not included in these distributions. You can get them from Microsoft in two additional
1870downloads. For these you will have to be using Internet Explorer.
1871Visit
1872
1873=end original
1874
1875This is not enough as there are a number of header files and libraries that are
1876not included in these distributions. You can get them from Microsoft in two additional
1877downloads. For these you will have to be using Internet Explorer.
1878Visit
1879(TBT)
1880
1881 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
1882
1883=begin original
1884
1885and install
1886
1887=end original
1888
1889and install
1890(TBT)
1891
1892 1) Core SDK
1893 2) Microsoft Data Access Components 2.7
1894
1895=begin original
1896
1897Before you can compile you'll have to open a command prompt and execute the
1898C<sdkvars.bat> script from the.NET SDK that will set a number of environment
1899variables. In addition you'll have to run the C<setenv.bat> you got with the
1900Core SDK (and located in C:\Program Files\Microsoft SDK) with the appropriate
1901parameters. For me this was /XP32 /RETAIL
1902
1903=end original
1904
1905Before you can compile you'll have to open a command prompt and execute the
1906C<sdkvars.bat> script from the.NET SDK that will set a number of environment
1907variables. In addition you'll have to run the C<setenv.bat> you got with the
1908Core SDK (and located in C:\Program Files\Microsoft SDK) with the appropriate
1909parameters. For me this was /XP32 /RETAIL
1910(TBT)
1911
1912=begin original
1913
1914In order to finish the packaging you'll also need the tar, gzip and zip utilities from
1915
1916=end original
1917
1918In order to finish the packaging you'll also need the tar, gzip and zip utilities from
1919(TBT)
1920
1921 http://gnuwin32.sourceforge.net/packages.html
1922
1923=begin original
1924
1925I have not tried it yet.
1926
1927=end original
1928
1929I have not tried it yet.
1930(TBT)
1931
1932=begin original
1933
1934After this you will probably be able to do the normal cycle:
1935
1936=end original
1937
1938After this you will probably be able to do the normal cycle:
1939(TBT)
1940
1941 perl makefile.pl
1942 nmake
1943 nmake test
1944
1945 or run
1946
1947 perl makedist.pl
1948
1949=head1 SEE ALSO
1950
1951=begin original
1952
1953Module's documentation is available at L<http://www.piotrkaluski.com/files/winguitest/docs/index.html>.
1954
1955=end original
1956
1957Module's documentation is available at L<http://www.piotrkaluski.com/files/winguitest/docs/index.html>.
1958(TBT)
1959
1960=head1 TODO
1961
1962=begin original
1963
1964Here are a few items where help would be welcome.
1965
1966=end original
1967
1968Here are a few items where help would be welcome.
1969(TBT)
1970
1971=head2 Perl only
1972
1973 Improve Tests
1974 Improve documentation
1975 Add more examples and explain them
1976
1977=head2 C++ compiler needed
1978
1979 Add more calls to the C++ backend
1980 Fix current calls
1981
1982 32bit custom controls (some already implemented)
1983 Possibly Java interfaces
1984 Retreive the list of the menu of a given window.
1985
1986=cut
1987
1988=head1 COPYRIGHT
1989
4031990The SendKeys function is based on the Delphi sourcecode
4041991published by Al Williams E<lt>http://www.al-williams.com/awc/E<gt>
405in Dr.Dobbs E<lt>http://www.ddj.com/ddj/1997/careers1/wil2.htmE<gt>.
1992in Dr.Dobbs E<lt>http://www.drdobbs.com/keys-to-the-kingdom/184410429E<gt>.
4061993
407Copyright (c) 1998-2001 Ernesto Guisado. All rights reserved. This program
1994Copyright (c) 1998-2002 Ernesto Guisado, (c) 2004 Dennis K. Paulsen. All rights
408is free software; You may distribute it and/or modify it under the
1995reserved. This program is free software; You may distribute it and/or modify it
409same terms as Perl itself.
1996under the same terms as Perl itself.
4101997
411=head1 作者(AUTHOR)
1998=head1 AUTHORS
4121999
413Ernesto Guisado E<lt>erngui@acm.orgE<gt>, E<lt>http://triumvir.orgE<gt>
2000Ernesto Guisado (erngui@acm.org), http://triumvir.org
4142001
415=head1 翻訳者
2002=begin original
4162003
417川合孝典(GCD00051@nifty.ne.jp)
2004Jarek Jurasz (jurasz@imb.uni-karlsruhe.de), http://www.uni-karlsruhe.de/~gm07 wrote
2005DibSect and some other pieces (see C<Changes> for details).
2006
2007=end original
2008
2009Jarek Jurasz (jurasz@imb.uni-karlsruhe.de), http://www.uni-karlsruhe.de/~gm07 は
2010DibSect とその他の一部分を書きました (詳しくは C<Changes> 参照)。
2011
2012=begin original
2013
2014Dennis K. Paulsen (ctrondlp@cpan.org) wrote various pieces (See C<Changes> for
2015details).
2016
2017=end original
2018
2019Dennis K. Paulsen (ctrondlp@cpan.org) はさまざまな部分を書きました
2020(詳しくは C<Changes> 参照)。
2021
2022=begin original
2023
2024Dmitry Karasik (dmitry@karasik.eu.org) added support for unicode and cygwin/mingw.
2025
2026=end original
2027
2028Dmitry Karasik (dmitry@karasik.eu.org) は Unicode と
2029cygwin/mingw 対応を追加しました。
2030
2031=head1 CREDITS
2032
2033=begin original
2034
2035Thanks very much to:
2036
2037=end original
2038
2039次の方々に感謝します:
2040
2041=over 4
2042
2043=item Johannes Maehner
2044
2045=item Ben Shern
2046
2047=item Phill Wolf
2048
2049=item Mauro
2050
2051=item Sohrab Niramwalla
2052
2053=item Frank van Dijk
2054
2055=item Jarek Jurasz
2056
2057=item Wilson P. Snyder II
2058
2059=item Rudi Farkas
2060
2061=item Paul Covington
2062
2063=item Piotr Kaluski
2064
2065=item ...and more...
2066
2067=begin original
2068
2069for code, suggestions and bug fixes.
2070
2071=end original
2072
2073コード、提案、バグ修正を行ってくださいました。
2074
2075=back
2076
2077=begin meta
2078
2079Translate: 川合孝典 <GCD00051@nifty.ne.jp> (1.3)
2080Update: Kentaro Shirakata <argrath@ub32.org> (1.64-)
2081Status: in progress
2082
2083=end meta
2084
2085=cut