Win32-GuiTest-1.64 >
1.3
との差分
Win32::GuiTest 1.3 と 1.64 の差分
| 1 | 1 | |
| 2 | =encoding | |
| 2 | =encoding utf8 | |
| 3 | 3 | |
| 4 | =head1 | |
| 4 | =head1 NAME | |
| 5 | 5 | |
| 6 | ||
| 6 | =begin original | |
| 7 | 7 | |
| 8 | ||
| 8 | Win32::GuiTest - Perl GUI Test Utilities. | |
| 9 | 9 | |
| 10 | =end original | |
| 11 | ||
| 12 | Win32::GuiTest - Perl GUI テストユーティリティ | |
| 13 | ||
| 14 | =head1 SYNOPSIS | |
| 15 | ||
| 10 | 16 | use Win32::GuiTest qw(FindWindowLike GetWindowText |
| 11 | 17 | SetForegroundWindow SendKeys); |
| 12 | 18 | |
| 13 | $Win32::GuiTest::debug = 0; # | |
| 19 | $Win32::GuiTest::debug = 0; # Set to "1" to enable verbose mode | |
| 14 | 20 | |
| 15 | 21 | my @windows = FindWindowLike(0, "^Microsoft Excel", "^XLMAIN\$"); |
| 16 | 22 | for (@windows) { |
| 17 | 23 | print "$_>\t'", GetWindowText($_), "'\n"; |
| 18 | 24 | SetForegroundWindow($_); |
| 19 | 25 | SendKeys("%fn~a{TAB}b{TAB}{BS}{DOWN}"); |
| 20 | 26 | } |
| 21 | 27 | |
| 22 | =head1 | |
| 28 | =head1 INSTALLATION | |
| 23 | 29 | |
| 30 | // This batch file comes with MS Visual Studio. Running | |
| 31 | // it first might help with various compilation problems. | |
| 32 | vcvars32.bat | |
| 33 | ||
| 24 | 34 | perl makefile.pl |
| 25 | 35 | nmake |
| 26 | 36 | nmake test |
| 27 | 37 | nmake install |
| 28 | 38 | |
| 29 | ||
| 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 | 私が送ったファイルを解凍し、あなたのマシンのディレクトリに入れた後、 | |
| 34 | PPMと入力し以下のようにしてください: | |
| 35 | 40 | |
| 41 | =begin original | |
| 42 | ||
| 43 | You can get the most recent release from | |
| 44 | L<http://www.sourceforge.net/projects/winguitest>. The package will | |
| 45 | contain Win32-GuiTest.ppd file and Win32-GuiTest.tar.gz file, | |
| 46 | which is all that you need to use | |
| 47 | ppm. If you put those 2 files in C:\TEMP directory, the installation | |
| 48 | should look as follows. Enter PPM (Perl Package Manager) from the | |
| 49 | command-line and type commands as below | |
| 50 | ||
| 51 | =end original | |
| 52 | ||
| 53 | You can get the most recent release from | |
| 54 | L<http://www.sourceforge.net/projects/winguitest>. The package will | |
| 55 | contain Win32-GuiTest.ppd file and Win32-GuiTest.tar.gz file, | |
| 56 | which is all that you need to use | |
| 57 | ppm. If you put those 2 files in C:\TEMP directory, the installation | |
| 58 | should look as follows. Enter PPM (Perl Package Manager) from the | |
| 59 | command-line and type commands as below | |
| 60 | (TBT) | |
| 61 | ||
| 36 | 62 | C:\TEMP>ppm |
| 37 | 63 | PPM interactive shell (2.0) - type 'help' for available commands. |
| 38 | 64 | PPM> install C:\temp\win32-guitest.ppd |
| 39 | 65 | Install package 'C:\temp\win32-guitest.ppd?' (y/N): Y |
| 40 | 66 | Retrieving package 'C:\temp\win32-guitest.ppd'... |
| 41 | 67 | Writing C:\Perl\site\lib\auto\Win32\GuiTest\.packlist |
| 42 | 68 | PPM> |
| 43 | 69 | |
| 44 | ||
| 70 | =begin original | |
| 45 | 使ってください。 | |
| 46 | 71 | |
| 72 | I extracted them to 'c:\temp', please use the directory where you extracted | |
| 73 | the files instead. | |
| 47 | 74 | |
| 48 | = | |
| 75 | =end original | |
| 49 | 76 | |
| 50 | 私 | |
| 77 | 私は'c:\temp'に展開しました; | |
| 51 | ||
| 78 | あなたが展開したディレクトリを代わりに使ってください。 | |
| 52 | 使っていました。その主な理由はSendKeys関数が使えるということです。 | |
| 53 | 79 | |
| 54 | ||
| 80 | =head1 DESCRIPTION | |
| 55 | (ActiveXスクリプティング)です。しかし全てのWin32プログラムがこのインターフェースを | |
| 56 | サポートしているわけではありません。それこどSendkeysが役に立つのです。 | |
| 57 | 81 | |
| 58 | ||
| 82 | =begin original | |
| 59 | (http://www.ddj.com/ddj/1997/careers1/wil2.htm)。私はそれをCに移植し、 | |
| 60 | h2xsを使ってパッケージ化しました... | |
| 61 | 83 | |
| 62 | ||
| 84 | Most GUI test scripts I have seen/written for Win32 use some variant of Visual | |
| 63 | ||
| 85 | Basic (e.g. MS-VB or MS-Visual Test). The main reason is the availability of | |
| 86 | the SendKeys function. | |
| 64 | 87 | |
| 65 | ||
| 88 | =end original | |
| 66 | ||
| 90 | 私がこれまで見てきた/書いてきた、ほとんどの Win32 用の GUI テストスクリプトは | |
| 91 | なんらかの Visual Basic の一種(例えば MS-VB あるいは MS-Visual Test など)を | |
| 92 | 使っていました。 | |
| 93 | その主な理由は SendKeys 関数が使えるということです。 | |
| 94 | ||
| 95 | =begin original | |
| 96 | ||
| 97 | A 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 | |
| 99 | where SendKeys comes handy. | |
| 100 | ||
| 101 | =end original | |
| 102 | ||
| 103 | テストスクリプトから Win32 プログラムを動かす素晴らしい方法は、 | |
| 104 | OLE オートメーション (ActiveX スクリプティング)です。 | |
| 105 | しかし全ての Win32 プログラムがこのインターフェースを | |
| 106 | サポートしているわけではありません。 | |
| 107 | それこど Sendkeys が役に立つのです。 | |
| 108 | ||
| 109 | =begin original | |
| 110 | ||
| 111 | Some 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 | |
| 113 | packaged 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 | ||
| 123 | The tentative name for this module is Win32::GuiTest (mostly because I plan to | |
| 124 | include more GUI testing functions). | |
| 125 | ||
| 126 | =end original | |
| 127 | ||
| 128 | 私は迷いながらもこのモジュールの名前を Win32::GuiTest としました | |
| 129 | (私がより多くの GUI テスト機能を入れることを考えているのが主な理由です)。 | |
| 130 | ||
| 131 | =begin original | |
| 132 | ||
| 133 | I've created a Yahoo Group for the module that you can join at | |
| 67 | 134 | http://groups.yahoo.com/group/perlguitest/join |
| 68 | 135 | |
| 69 | = | |
| 136 | =end original | |
| 70 | 137 | |
| 71 | | |
| 138 | みなさんが参加することができる、このモジュールのための Yahoo グループを作成 | |
| 139 | しています: | |
| 140 | http://groups.yahoo.com/group/perlguitest/join | |
| 72 | 141 | |
| 73 | = | |
| 142 | =begin original | |
| 74 | 143 | |
| 75 | ||
| 144 | Also, an initial version of a script recording application has been written to use with this | |
| 145 | module. A copy of it may be found with this distribution (Recorder\Win32GuiTest.exe) | |
| 146 | or can be obtained at http://sourceforge.net/projects/winguitest | |
| 76 | 147 | |
| 77 | | |
| 148 | =end original | |
| 78 | 149 | |
| 79 | ||
| 150 | Also, an initial version of a script recording application has been written to use with this | |
| 151 | module. A copy of it may be found with this distribution (Recorder\Win32GuiTest.exe) | |
| 152 | or can be obtained at http://sourceforge.net/projects/winguitest | |
| 153 | (TBT) | |
| 80 | 154 | |
| 81 | ||
| 155 | =begin original | |
| 82 | of Win32::APIRegistry): | |
| 83 | SetForegroundWindow | |
| 84 | GetDesktopWindow | |
| 85 | GetWindow | |
| 86 | GetWindowText | |
| 87 | GetClassName | |
| 88 | GetParent | |
| 89 | GetWindowLong | |
| 90 | SetFocus | |
| 91 | 156 | |
| 92 | | |
| 157 | If the documentation of these functions is not satisfactory, you can | |
| 93 | | |
| 158 | try running a search on http://msdn.microsoft.com/ using the name of the function. | |
| 94 | ||
| 159 | Some of these functions are described there. | |
| 95 | 0.03 Sun Oct 31 18:31:52 1999 | |
| 96 | 160 | |
| 97 | ||
| 161 | =end original | |
| 98 | 162 | |
| 99 | | |
| 163 | If the documentation of these functions is not satisfactory, you can | |
| 164 | try running a search on http://msdn.microsoft.com/ using the name of the function. | |
| 165 | Some of these functions are described there. | |
| 166 | (TBT) | |
| 100 | 167 | |
| 101 | ||
| 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'. | |
| 105 | 169 | |
| 106 | ||
| 170 | This distribution of the module - the one you are looking at now - has | |
| 171 | its own CVS repository at http://sourceforge.net/projects/winguitest | |
| 172 | Patches to both the code and the documentation are welcome. | |
| 107 | 173 | |
| 108 | ||
| 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). | |
| 119 | 175 | |
| 120 | ||
| 176 | This distribution of the module - the one you are looking at now - has | |
| 121 | | |
| 177 | its own CVS repository at http://sourceforge.net/projects/winguitest | |
| 178 | Patches to both the code and the documentation are welcome. | |
| 179 | (TBT) | |
| 122 | 180 | |
| 123 | ||
| 181 | =cut | |
| 124 | 182 | |
| 125 | ||
| 183 | =head2 Functions | |
| 126 | script is added to the distribution (eg\notepad.pl) to test | |
| 127 | this functionality. | |
| 128 | 184 | |
| 129 | ||
| 185 | (関数) | |
| 130 | 186 | |
| 131 | ||
| 187 | =over 4 | |
| 132 | 188 | |
| 133 | ||
| 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. | |
| 137 | 190 | |
| 138 | ||
| 191 | =begin original | |
| 139 | 192 | |
| 193 | When set enables the verbose mode. | |
| 140 | 194 | |
| 141 | ||
| 195 | =end original | |
| 142 | 196 | |
| 143 | ||
| 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. | |
| 149 | 198 | |
| 150 | ||
| 199 | =item SendKeys($keys[,$delay]) | |
| 151 | 200 | |
| 152 | ||
| 201 | =begin original | |
| 153 | 202 | |
| 154 | ||
| 203 | Sends keystrokes to the active window as if typed at the keyboard using the | |
| 155 | | |
| 204 | optional delay between key-up and key-down messages (default is 25 ms and | |
| 156 | ||
| 205 | should be OK for most uses). | |
| 157 | 206 | |
| 158 | ||
| 207 | =end original | |
| 159 | 208 | |
| 160 | ||
| 209 | オプションでキーストロークの間に遅延を入れながら、アクティブな | |
| 161 | ||
| 210 | ウィンドウにまるでキボードから打ち込んだようにキーアップと | |
| 162 | ||
| 211 | キーダウンのメッセージを送信します | |
| 212 | (デフォルトは25msでほとんどの利用では大丈夫でしょう)。 | |
| 163 | 213 | |
| 164 | ||
| 214 | =begin original | |
| 165 | 215 | |
| 166 | ||
| 216 | The keystrokes to send are specified in KEYS. There are several | |
| 167 | | |
| 217 | characters that have special meaning. This allows sending control codes | |
| 218 | and modifiers: | |
| 168 | 219 | |
| 169 | ||
| 220 | =end original | |
| 170 | 221 | |
| 171 | | |
| 222 | 送信されるキーストロークは KEYS で指定します。 | |
| 223 | いくつかの特別な意味を持つ文字があります。 | |
| 224 | これにより制御コードや修飾子も送信できます: | |
| 172 | 225 | |
| 173 | ||
| 226 | =begin original | |
| 174 | 227 | |
| 175 | | |
| 228 | ~ means ENTER | |
| 229 | + means SHIFT | |
| 230 | ^ means CTRL | |
| 231 | % means ALT | |
| 176 | 232 | |
| 177 | ||
| 233 | =end original | |
| 178 | 234 | |
| 179 | | |
| 235 | ~ は ENTER | |
| 180 | | |
| 236 | + は SHIFT | |
| 237 | ^ は CTRL | |
| 238 | % は ALT | |
| 181 | 239 | |
| 182 | ||
| 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). | |
| 187 | 241 | |
| 188 | ||
| 242 | The parens allow character grouping. You may group several characters, so | |
| 243 | that a specific keyboard modifier applies to all of them. Groups can | |
| 244 | be enclosed in groups. | |
| 189 | 245 | |
| 190 | ||
| 246 | =end original | |
| 191 | I found showwin very interesting (if somewhat dangerous!). | |
| 192 | 247 | |
| 193 | ||
| 248 | かっこにより文字をグループ化することができます。 | |
| 194 | ||
| 249 | 複数の文字をグループにすることができ、 | |
| 195 | ||
| 250 | 特定のキーボードの修飾子をそれらの全てに適用することができます。 | |
| 251 | グループはグループで囲むことができます。 | |
| 196 | 252 | |
| 197 | ||
| 253 | =begin original | |
| 198 | 254 | |
| 199 | | |
| 255 | E.g. SendKeys("ABC") is equivalent to SendKeys("+(abc)") | |
| 200 | IsGrayedButton. | |
| 201 | 256 | |
| 202 | ||
| 257 | =end original | |
| 203 | delay between keystrokes. Suggested by Wilson P. Snyder II | |
| 204 | <wsnyder@world.std.com>. | |
| 205 | 258 | |
| 206 | ||
| 259 | 例: SendKeys("ABC") は SendKeys("+(abc)") でも同じです | |
| 207 | 260 | |
| 208 | ||
| 261 | =begin original | |
| 209 | to allow easy extraction of data from list and combo boxes. | |
| 210 | 262 | |
| 211 | | |
| 263 | The curly braces are used to quote special characters (SendKeys("{+}{{}") | |
| 212 | | |
| 264 | sends a '+' and a '{'). You can also use them to specify certain named actions: | |
| 213 | combobox. | |
| 214 | 265 | |
| 215 | ||
| 266 | =end original | |
| 216 | Caused by a missing OUTPUT tag. | |
| 217 | 267 | |
| 218 | ||
| 268 | 中かっこは特殊文字をクォートするために使われます(SendKeys("{+}{{}") は | |
| 219 | | |
| 269 | は '+' と '{' を送信します)。 | |
| 220 | ||
| 270 | またそれらを使って名前が付けられたアクションを使うことができます: | |
| 221 | 271 | |
| 222 | ||
| 272 | =begin original | |
| 223 | 273 | |
| 224 | | |
| 274 | Name Action | |
| 225 | 275 | |
| 226 | ||
| 276 | =end original | |
| 227 | See 'eg\pushbutton.pl' for an example. | |
| 228 | 277 | |
| 229 | | |
| 278 | 名前 アクション | |
| 230 | 279 | |
| 231 | = | |
| 280 | =begin original | |
| 232 | 281 | |
| 233 | ||
| 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 | |
| 234 | 314 | |
| 315 | =end original | |
| 235 | 316 | |
| 236 | ||
| 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} コンテキストメニューキー | |
| 237 | 349 | |
| 238 | ||
| 350 | =begin original | |
| 239 | 351 | |
| 352 | or supply a number that will be treated as a VK code. Note that a single-digit | |
| 353 | number will be treated as a character, so prepend these with '0'. | |
| 240 | 354 | |
| 241 | = | |
| 355 | =end original | |
| 242 | 356 | |
| 243 | ||
| 357 | または、VK コードとして扱われる数値を指定します。 | |
| 244 | ||
| 358 | 一桁の数字は文字として扱われるので、その前に '0' を付けてください。 | |
| 245 | (デフォルトは50msでほとんどの利用では大丈夫でしょう) | |
| 246 | 359 | |
| 247 | ||
| 360 | =begin original | |
| 248 | 文字があります。これにより制御コードや修飾子も送信することができます: | |
| 249 | ||
| 250 | ~ は ENTER を | |
| 251 | + は SHIFT を | |
| 252 | ^ は CTRL を | |
| 253 | % は ALT を、それぞれ意味します | |
| 254 | 361 | |
| 255 | ||
| 362 | All these named actions take an optional integer argument, like in {RIGHT 5}. | |
| 256 | ||
| 363 | For all of them, except PAUSE, the argument means a repeat count. For PAUSE | |
| 257 | ||
| 364 | it means the number of milliseconds SendKeys should pause before proceding. | |
| 258 | 365 | |
| 259 | ||
| 366 | =end original | |
| 260 | 367 | |
| 261 | ||
| 368 | これらの全ての名前付きのアクションは、{RIGHT 5} のようにオプションで整数の | |
| 262 | ||
| 369 | 引数を取ります。 | |
| 263 | ||
| 370 | PAUSE を除いた全てにとっては、引数は繰り返しの回数を意味します。 | |
| 371 | PAUSE にとっては、先に進む前に SendKeys が中断するミリ秒数を意味します。 | |
| 264 | 372 | |
| 265 | | |
| 373 | =begin original | |
| 266 | 374 | |
| 267 | | |
| 375 | In this implementation, SendKeys always returns after sending the keystrokes. | |
| 268 | | |
| 376 | There is no way to tell if an application has processed those keys when the | |
| 269 | ||
| 377 | function 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} オープン・コンテキスト・メニュー・キー | |
| 299 | 378 | |
| 300 | ||
| 379 | =end original | |
| 301 | 引数を取ります。PAUSEの除くこれらは全てにとって、引数は繰り返しの回数を | |
| 302 | 意味します。PAUSEにとっては先に進む前に中断するミリ秒数を意味します。 | |
| 303 | 380 | |
| 304 | この実装では、SendKeys | |
| 381 | この実装では、SendKeys は、キーストロークを送信した後、常に戻ります。 | |
| 305 | この関数が戻ってき | |
| 382 | この関数が戻ってきたとき、アプリケーションがそれらのキーを | |
| 306 | 知る方法はありません。 | |
| 383 | 処理し終えているかを知る方法はありません。 | |
| 307 | 384 | |
| 308 | =ba | |
| 385 | =begin original | |
| 309 | 386 | |
| 310 | ||
| 387 | Unicode characters in C<$keys> are translated into set of ALT+NUMPAD keystrokes. | |
| 388 | Note that not all applications can understand unicode input. | |
| 311 | 389 | |
| 312 | = | |
| 390 | =end original | |
| 313 | 391 | |
| 314 | ||
| 392 | C<$keys> の中の Unicode 文字は、ALT+NUMPAD キーストロークに変換されます。 | |
| 315 | ||
| 393 | 全てのアプリケーションが Unicode 入力を理解できるわけではないことに | |
| 394 | 注意してください。 | |
| 316 | 395 | |
| 396 | =cut | |
| 397 | ||
| 398 | =item SendMouse($command) | |
| 399 | ||
| 400 | =begin original | |
| 401 | ||
| 402 | This function emulates mouse input. The COMMAND parameter is a string | |
| 403 | containing one or more of the following substrings: | |
| 404 | ||
| 405 | =end original | |
| 406 | ||
| 407 | この関数はマウス入力をエミュレートします。 | |
| 408 | COMMAND パラメータは一つあるいはそれ以上の文字列が入った文字列です: | |
| 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 | ||
| 317 | 426 | {LEFTDOWN} 左ボタンのダウン |
| 318 | 427 | {LEFTUP} 左ボタンのアップ |
| 319 | 428 | {MIDDLEDOWN} 中ボタンのダウン |
| 320 | 429 | {MIDDLEUP} 中ボタンのアップ |
| 321 | 430 | {RIGHTDOWN} 右ボタンのダウン |
| 322 | 431 | {RIGHTUP} 右ボタンのアップ |
| 323 | 432 | {LEFTCLICK} 左ボタンのシングルクリック |
| 324 | 433 | {MIDDLECLICK} 中ボタンのシングルクリック |
| 325 | 434 | {RIGHTCLICK} 右ボタンのシングルクリック |
| 326 | 435 | {ABSx,y} 絶対座標( x, y )に移動 |
| 327 | 436 | {RELx,y} 相対座標( x, y )に移動 |
| 328 | 437 | |
| 329 | ||
| 438 | =begin original | |
| 330 | 相対座標は正にも負にもすることができます。 | |
| 331 | ピクセル座標が必要であれば、MouseMoveAbsPixを使うことが出来ます。 | |
| 332 | 439 | |
| 440 | Note: 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 | ||
| 452 | Also equivalent low-level functions are available: | |
| 453 | ||
| 454 | =end original | |
| 455 | ||
| 333 | 456 | 同等の低レベルの関数を利用することもできます: |
| 334 | 457 | |
| 335 | | |
| 458 | SendLButtonUp() | |
| 336 | | |
| 459 | SendLButtonDown() | |
| 337 | | |
| 460 | SendMButtonUp() | |
| 338 | | |
| 461 | SendMButtonDown() | |
| 339 | | |
| 462 | SendRButtonUp() | |
| 340 | | |
| 463 | SendRButtonDown() | |
| 341 | | |
| 464 | SendMouseMoveRel(x,y) | |
| 342 | | |
| 465 | SendMouseMoveAbs(x,y) | |
| 343 | 466 | |
| 344 | = | |
| 467 | =cut | |
| 345 | 468 | |
| 346 | =ove | |
| 469 | =item MouseMoveAbsPix($x,$y) | |
| 347 | 470 | |
| 348 | = | |
| 471 | =begin original | |
| 349 | 472 | |
| 473 | Move the mouse cursor to the screen pixel indicated as parameter. | |
| 474 | ||
| 475 | =end original | |
| 476 | ||
| 350 | 477 | パラメータとして指定された画面上のピクセルにマウスカーソルを |
| 351 | 478 | 移動します。 |
| 352 | 479 | |
| 480 | =begin original | |
| 353 | 481 | |
| 354 | | |
| 482 | # Moves to x=200, y=100 in pixel coordinates. | |
| 355 | | |
| 483 | MouseMoveAbsPix(200, 100); | |
| 356 | ||
| 357 | 484 | |
| 485 | =end original | |
| 358 | 486 | |
| 359 | ||
| 487 | # ピクセル座標での x=200, y=100 に移動します。 | |
| 488 | MouseMoveAbsPix(200, 100); | |
| 360 | 489 | |
| 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 | ||
| 508 | Finds the window handles of the windows matching the specified parameters and | |
| 509 | returns them as a list. | |
| 510 | ||
| 511 | =end original | |
| 512 | ||
| 513 | 指定されたパラメータにマッチするウィンドウのウィンドウハンドルを探し、 | |
| 362 | 514 | それをリストで返します。 |
| 363 | 515 | |
| 364 | ||
| 516 | =begin original | |
| 365 | このウィンドウの全ての子供とさらにその子供を再帰的に検索していきます。 | |
| 366 | もし'undef'であれば、このルーチンは全てのウィンドウを探していきます。 | |
| 367 | Windowのキャプションの文字列にマッチさせるために使われる正規表現もあります。 | |
| 368 | 子供ID番号を渡すと、この関数はそのIDを追ったウィンドウにのみマッチします。 | |
| 369 | いずれもundefは全てにマッチします。 | |
| 370 | 517 | |
| 371 | ||
| 518 | You may specify the handle of the window to search under. The routine | |
| 519 | searches through all of this windows children and their children recursively. | |
| 520 | If 'undef' then the routine searches through all windows. There is also a | |
| 521 | regexp used to match against the text in the window caption and another regexp | |
| 522 | used to match against the text in the window class. If you pass a child ID | |
| 523 | number, the functions will only match windows with this id. In each case | |
| 524 | undef matches everything. | |
| 372 | 525 | |
| 373 | = | |
| 526 | =end original | |
| 374 | 527 | |
| 375 | ||
| 528 | 検索対象のウィンドウハンドルを指定できます。 | |
| 529 | このルーチンはこのウィンドウの全ての子供とさらにその子供を | |
| 530 | 再帰的に検索していきます。 | |
| 531 | もし 'undef' であれば、このルーチンは全てのウィンドウを探していきます。 | |
| 532 | ウィンドウのキャプションの文字列にマッチングさせるために使われるものと | |
| 533 | ウィンドウクラスのテキストにマッチングさせるために | |
| 534 | 使われるものの二つの正規表現もあります。 | |
| 535 | 子 ID 番号を渡すと、この関数はその ID を持つウィンドウにのみマッチングします。 | |
| 536 | どちらの場合も undef は全てにマッチングします。 | |
| 376 | 537 | |
| 538 | =cut | |
| 377 | 539 | |
| 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 | ||
| 556 | Equivalent to | |
| 557 | ||
| 558 | =end original | |
| 559 | ||
| 560 | 次のものと同じです: | |
| 561 | ||
| 378 | 562 | PushChildButton(GetForegroundWindow, BUTTON, DELAY) |
| 379 | 563 | |
| 380 | ||
| 564 | =cut | |
| 381 | 565 | |
| 382 | =ba | |
| 566 | =item PushChildButton($parent,$button[,$delay]) | |
| 383 | 567 | |
| 384 | = | |
| 568 | =begin original | |
| 385 | 569 | |
| 386 | ||
| 570 | Allows generating a mouse click on a particular button. | |
| 387 | 571 | |
| 388 | ||
| 572 | =end original | |
| 389 | 573 | |
| 574 | 特定のボタンへのマウスクリックを生成できるようにします。 | |
| 575 | ||
| 576 | =begin original | |
| 577 | ||
| 578 | parent - the parent window of the button | |
| 579 | ||
| 580 | =end original | |
| 581 | ||
| 390 | 582 | parent - そのボタンの親ウィンドウ |
| 391 | 583 | |
| 584 | =begin original | |
| 585 | ||
| 586 | button - either the text in a button (e.g. "Yes") or the control ID | |
| 587 | of a button. | |
| 588 | ||
| 589 | =end original | |
| 590 | ||
| 392 | 591 | button - ボタンのテキスト(例えば "Yes")あるいは、ボタンの |
| 393 | ||
| 592 | 制御 ID のどちらかです。 | |
| 394 | 593 | |
| 594 | =begin original | |
| 595 | ||
| 596 | delay - the time (0.25 means 250 ms) to wait between the mouse down | |
| 597 | and the mouse up event. This is useful for debugging. | |
| 598 | ||
| 599 | =end original | |
| 600 | ||
| 395 | 601 | delay - マウスダウンとマウスアップイベントの間の時間 |
| 396 | (0.25 は 250 ms を意味します)を意味します。 | |
| 602 | (0.25 は 250 ms を意味します)を意味します。 | |
| 397 | 便利です。 | |
| 603 | これはデバッグのときに便利です。 | |
| 398 | 604 | |
| 605 | =cut | |
| 606 | ||
| 607 | =item PushChildById( $parent, $button, $level, $delay ) | |
| 608 | ||
| 609 | =begin original | |
| 610 | ||
| 611 | Allows pushing a button, which control id is eqaul to a given parameter. | |
| 612 | C<PushChildButton> tries to match parameter against control id or | |
| 613 | caption. | |
| 614 | PushChildById matches only against control id. Secondly, PushChildById | |
| 615 | allows specifying search depth in the windows hierarchy tree. | |
| 616 | The default is 2, which means that only direct children will be | |
| 617 | pushed. | |
| 618 | ||
| 619 | =end original | |
| 620 | ||
| 621 | Allows pushing a button, which control id is eqaul to a given parameter. | |
| 622 | C<PushChildButton> tries to match parameter against control id or | |
| 623 | caption. | |
| 624 | PushChildById matches only against control id. Secondly, PushChildById | |
| 625 | allows specifying search depth in the windows hierarchy tree. | |
| 626 | The default is 2, which means that only direct children will be | |
| 627 | pushed. | |
| 628 | (TBT) | |
| 629 | ||
| 630 | =cut | |
| 631 | ||
| 632 | =item WaitWindowLike($parent,$wndtitle,$wndclass,$wndid,$depth,$wait) | |
| 633 | ||
| 634 | =begin original | |
| 635 | ||
| 636 | Function which allows one to wait for a window to appear | |
| 637 | vs. using hard waits (e.g. sleep 2). | |
| 638 | ||
| 639 | =end original | |
| 640 | ||
| 641 | Function which allows one to wait for a window to appear | |
| 642 | vs. using hard waits (e.g. sleep 2). | |
| 643 | (TBT) | |
| 644 | ||
| 645 | =begin original | |
| 646 | ||
| 647 | parent - Where to start (parent window) | |
| 648 | ||
| 649 | =end original | |
| 650 | ||
| 651 | parent - 開始位置 (親ウィンドウ) | |
| 652 | ||
| 653 | =begin original | |
| 654 | ||
| 655 | wndtitle - Regexp for the window title | |
| 656 | ||
| 657 | =end original | |
| 658 | ||
| 659 | wndtitle - ウィンドウタイトルのための正規表現 | |
| 660 | ||
| 661 | =begin original | |
| 662 | ||
| 663 | wndclass - Regexp for the window class name | |
| 664 | ||
| 665 | =end original | |
| 666 | ||
| 667 | wndclass - ウィンドウクラス名のための正規表現 | |
| 668 | ||
| 669 | =begin original | |
| 670 | ||
| 671 | wndid - Numeric Window or Control ID | |
| 672 | ||
| 673 | =end original | |
| 674 | ||
| 675 | wndid - ウィンドウ ID か 制御 ID の数値 | |
| 676 | ||
| 677 | =begin original | |
| 678 | ||
| 679 | depth - How deep should we search before we stop | |
| 680 | ||
| 681 | =end original | |
| 682 | ||
| 683 | depth - How deep should we search before we stop | |
| 684 | (TBT) | |
| 685 | ||
| 686 | =begin original | |
| 687 | ||
| 688 | wait - How many seconds should we wait before giving up | |
| 689 | ||
| 690 | =end original | |
| 691 | ||
| 692 | wait - 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 | ||
| 701 | Minimal version of WaitWindowLike. Only requires the window title | |
| 702 | regexp. You can also specify the wait timeout in seconds. | |
| 703 | ||
| 704 | =end original | |
| 705 | ||
| 706 | Minimal version of WaitWindowLike. Only requires the window title | |
| 707 | regexp. You can also specify the wait timeout in seconds. | |
| 708 | (TBT) | |
| 709 | ||
| 710 | =begin original | |
| 711 | ||
| 712 | wndtitle - Regexp for the window title | |
| 713 | ||
| 714 | =end original | |
| 715 | ||
| 716 | wndclass - ウィンドウクラス名のための正規表現 | |
| 717 | ||
| 718 | =begin original | |
| 719 | ||
| 720 | wait - How many seconds should we wait before giving up | |
| 721 | ||
| 722 | =end original | |
| 723 | ||
| 724 | wait - 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 | ||
| 761 | Using 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 | |
| 772 | key: "Rep&eate" | |
| 773 | Returns 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 | ||
| 785 | Returns 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 | ||
| 795 | Allows selecting a menu programmatically. | |
| 796 | ||
| 797 | =end original | |
| 798 | ||
| 799 | メニューをプログラムで選択できるようにします。 | |
| 800 | ||
| 801 | =begin original | |
| 802 | ||
| 803 | Simple 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 | ||
| 821 | Receives a menu handler (one we got from GetMenu or GetSubMenu) and | |
| 822 | a number (which is the location of the item within the given menu). | |
| 823 | ||
| 824 | =end original | |
| 825 | ||
| 826 | Receives a menu handler (one we got from GetMenu or GetSubMenu) and | |
| 827 | a number (which is the location of the item within the given menu). | |
| 828 | (TBT) | |
| 829 | ||
| 830 | =begin original | |
| 831 | ||
| 832 | Returns a hash of which there are currently 2 keys: | |
| 833 | type can be either "string" or "separator" - this is the type of the menu item | |
| 834 | text is the visible text of the menu item (provided only for "string" type) | |
| 835 | ||
| 836 | =end original | |
| 837 | ||
| 838 | Returns a hash of which there are currently 2 keys: | |
| 839 | type can be either "string" or "separator" - this is the type of the menu item | |
| 840 | text is the visible text of the menu item (provided only for "string" type) | |
| 841 | (TBT) | |
| 842 | ||
| 843 | =begin original | |
| 844 | ||
| 845 | WARNING: This is an experimental function. Its behavior might change. | |
| 846 | ||
| 847 | =end original | |
| 848 | ||
| 849 | WARNING: 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 | ||
| 858 | Allows one to easily interact with an application through mouse emulation. | |
| 859 | ||
| 860 | =end original | |
| 861 | ||
| 862 | Allows one to easily interact with an application through mouse emulation. | |
| 863 | (TBT) | |
| 864 | ||
| 865 | =begin original | |
| 866 | ||
| 867 | window = Regexp for a Window caption / Child caption, or just a Child ID. | |
| 868 | ||
| 869 | =end original | |
| 870 | ||
| 871 | window = Regexp for a Window caption / Child caption, or just a Child ID. | |
| 872 | (TBT) | |
| 873 | ||
| 874 | =begin original | |
| 875 | ||
| 876 | parent = Handle to parent window. Default is foreground window. Use | |
| 877 | GetDesktopWindow() return value for this if clicking on an application | |
| 878 | title bar. | |
| 879 | ||
| 880 | =end original | |
| 881 | ||
| 882 | parent = Handle to parent window. Default is foreground window. Use | |
| 883 | GetDesktopWindow() return value for this if clicking on an application | |
| 884 | title bar. | |
| 885 | (TBT) | |
| 886 | ||
| 887 | =begin original | |
| 888 | ||
| 889 | x_offset = Offset for X axis. Default is 0. | |
| 890 | ||
| 891 | =end original | |
| 892 | ||
| 893 | x_offset = Offset for X axis. Default is 0. | |
| 894 | (TBT) | |
| 895 | ||
| 896 | =begin original | |
| 897 | ||
| 898 | y_offset = Offset for Y axis. Default is 0. | |
| 899 | ||
| 900 | =end original | |
| 901 | ||
| 902 | y_offset = Offset for Y axis. Default is 0. | |
| 903 | (TBT) | |
| 904 | ||
| 905 | =begin original | |
| 906 | ||
| 907 | button = {LEFT}, {MIDDLE}, {RIGHT}. Default is {LEFT} | |
| 908 | ||
| 909 | =end original | |
| 910 | ||
| 911 | button = {LEFT}, {MIDDLE}, {RIGHT}. Default is {LEFT} | |
| 912 | (TBT) | |
| 913 | ||
| 914 | =begin original | |
| 915 | ||
| 916 | delay = Default is 0. 0.50 = 500 ms. Delay between button down and | |
| 917 | button up. | |
| 918 | ||
| 919 | =end original | |
| 920 | ||
| 921 | delay = Default is 0. 0.50 = 500 ms. Delay between button down and | |
| 922 | button up. | |
| 923 | (TBT) | |
| 924 | ||
| 925 | =begin original | |
| 926 | ||
| 927 | Simple 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 | ||
| 952 | Allocates memory in the address space of the process, which is an owner of | |
| 953 | a window identified by $hwnd. Returns a reference to a hash, which has 2 elements: | |
| 954 | ||
| 955 | =end original | |
| 956 | ||
| 957 | Allocates memory in the address space of the process, which is an owner of | |
| 958 | a 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 | |
| 966 | API function | |
| 967 | ||
| 399 | 968 | =back |
| 400 | 969 | |
| 401 | = | |
| 970 | =cut | |
| 402 | 971 | |
| 972 | =item $value = ReadFromVirtualBuffer( $buf_str, $size ) | |
| 973 | ||
| 974 | =begin original | |
| 975 | ||
| 976 | Read from a memory in the address space of the other process. | |
| 977 | C<$buf_str> is a reference to a hash returned by AllocateVirtualBuffer. | |
| 978 | ||
| 979 | =end original | |
| 980 | ||
| 981 | Read from a memory in the address space of the other process. | |
| 982 | C<$buf_str> is a reference to a hash returned by AllocateVirtualBuffer. | |
| 983 | (TBT) | |
| 984 | ||
| 985 | =begin original | |
| 986 | ||
| 987 | Returns read value. | |
| 988 | ||
| 989 | =end original | |
| 990 | ||
| 991 | Returns read value. | |
| 992 | (TBT) | |
| 993 | ||
| 994 | =cut | |
| 995 | ||
| 996 | =item WriteToVirtualBuffer( $buf_str, $value ) | |
| 997 | ||
| 998 | =begin original | |
| 999 | ||
| 1000 | Write to a memory in the address space of the other process. | |
| 1001 | C<$buf_str> is a reference to a hash returned by AllocateVirtualBuffer. | |
| 1002 | C<$value> is a value to be copied. | |
| 1003 | ||
| 1004 | =end original | |
| 1005 | ||
| 1006 | Write to a memory in the address space of the other process. | |
| 1007 | C<$buf_str> is a reference to a hash returned by AllocateVirtualBuffer. | |
| 1008 | C<$value> is a value to be copied. | |
| 1009 | (TBT) | |
| 1010 | ||
| 1011 | =cut | |
| 1012 | ||
| 1013 | =item FreeVirtualBuffer( $buf_str ) | |
| 1014 | ||
| 1015 | =begin original | |
| 1016 | ||
| 1017 | Frees memory allocated by AllocateVirtualBuffer | |
| 1018 | ||
| 1019 | =end original | |
| 1020 | ||
| 1021 | Frees memory allocated by AllocateVirtualBuffer | |
| 1022 | (TBT) | |
| 1023 | ||
| 1024 | =cut | |
| 1025 | ||
| 1026 | =item $text = WMGetText($hwnd) * | |
| 1027 | ||
| 1028 | =begin original | |
| 1029 | ||
| 1030 | Sends a WM_GETTEXT to a window and returns its contents | |
| 1031 | ||
| 1032 | =end original | |
| 1033 | ||
| 1034 | Sends a WM_GETTEXT to a window and returns its contents | |
| 1035 | (TBT) | |
| 1036 | ||
| 1037 | =item $set = WMSetText(hwnd,text) * | |
| 1038 | ||
| 1039 | =begin original | |
| 1040 | ||
| 1041 | Sends a WM_SETTEXT to a window setting its contents | |
| 1042 | ||
| 1043 | =end original | |
| 1044 | ||
| 1045 | Sends a WM_SETTEXT to a window setting its contents | |
| 1046 | (TBT) | |
| 1047 | ||
| 1048 | =item ($x,$y) = GetCursorPos() * | |
| 1049 | ||
| 1050 | =begin original | |
| 1051 | ||
| 1052 | Retrieves the cursor's position,in screen coordinates as (x,y) array. | |
| 1053 | ||
| 1054 | =end original | |
| 1055 | ||
| 1056 | Retrieves the cursor's position,in screen coordinates as (x,y) array. | |
| 1057 | (TBT) | |
| 1058 | ||
| 1059 | =item GetCaretPos() | |
| 1060 | ||
| 1061 | =begin original | |
| 1062 | ||
| 1063 | Retrieves the caret's position, in client coordinates as (x,y) array. (Like Windows function) | |
| 1064 | ||
| 1065 | =end original | |
| 1066 | ||
| 1067 | Retrieves 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 | ||
| 1074 | Sets the keyboard focus to the specified window | |
| 1075 | ||
| 1076 | =end original | |
| 1077 | ||
| 1078 | Sets the keyboard focus to the specified window | |
| 1079 | (TBT) | |
| 1080 | ||
| 1081 | =item HWND GetDesktopWindow() * | |
| 1082 | ||
| 1083 | =begin original | |
| 1084 | ||
| 1085 | Returns a handle to the desktop window | |
| 1086 | ||
| 1087 | =end original | |
| 1088 | ||
| 1089 | Returns 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 | ||
| 1098 | Get the text name of the window as shown on the top of it. | |
| 1099 | Beware, this is text depends on localization. | |
| 1100 | ||
| 1101 | =end original | |
| 1102 | ||
| 1103 | Get the text name of the window as shown on the top of it. | |
| 1104 | Beware, this is text depends on localization. | |
| 1105 | (TBT) | |
| 1106 | ||
| 1107 | =item $class = GetClassName(hwnd) * | |
| 1108 | ||
| 1109 | =begin original | |
| 1110 | ||
| 1111 | Using the same Windows library function returns the name | |
| 1112 | of the class wo which the specified window belongs. | |
| 1113 | ||
| 1114 | =end original | |
| 1115 | ||
| 1116 | Using the same Windows library function returns the name | |
| 1117 | of the class wo which the specified window belongs. | |
| 1118 | (TBT) | |
| 1119 | ||
| 1120 | =begin original | |
| 1121 | ||
| 1122 | See MSDN for more details. | |
| 1123 | ||
| 1124 | =end original | |
| 1125 | ||
| 1126 | See MSDN for more details. | |
| 1127 | (TBT) | |
| 1128 | ||
| 1129 | =begin original | |
| 1130 | ||
| 1131 | You can also check out MSDN to see an overview of the Window Classes. | |
| 1132 | ||
| 1133 | =end original | |
| 1134 | ||
| 1135 | You 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 | ||
| 1142 | A library function (see MSDN) to return the WindowID of the parent window. | |
| 1143 | See MSDN for the special cases. | |
| 1144 | ||
| 1145 | =end original | |
| 1146 | ||
| 1147 | A library function (see MSDN) to return the WindowID of the parent window. | |
| 1148 | See 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 | ||
| 1157 | See corresponding Windows functions. | |
| 1158 | ||
| 1159 | =end original | |
| 1160 | ||
| 1161 | See corresponding Windows functions. | |
| 1162 | (TBT) | |
| 1163 | ||
| 1164 | =item @wnds = GetChildWindows(hWnd) | |
| 1165 | ||
| 1166 | =begin original | |
| 1167 | ||
| 1168 | Using EnumChildWindows library function (see MSDN) it returns the WindowID | |
| 1169 | of each child window. If the children have their own children the function | |
| 1170 | returns them too until the tree ends. | |
| 1171 | ||
| 1172 | =end original | |
| 1173 | ||
| 1174 | Using EnumChildWindows library function (see MSDN) it returns the WindowID | |
| 1175 | of each child window. If the children have their own children the function | |
| 1176 | returns them too until the tree ends. | |
| 1177 | (TBT) | |
| 1178 | ||
| 1179 | =item BOOL IsChild(hWndParent,hWnd) * | |
| 1180 | ||
| 1181 | =begin original | |
| 1182 | ||
| 1183 | Using the corresponding library function (see MSDN) it returns true | |
| 1184 | if the second window is an immediate child or a descendant window of | |
| 1185 | the first window. | |
| 1186 | ||
| 1187 | =end original | |
| 1188 | ||
| 1189 | Using the corresponding library function (see MSDN) it returns true | |
| 1190 | if the second window is an immediate child or a descendant window of | |
| 1191 | the first window. | |
| 1192 | (TBT) | |
| 1193 | ||
| 1194 | =item $depth = GetChildDepth(hAncestor,hChild) | |
| 1195 | ||
| 1196 | =begin original | |
| 1197 | ||
| 1198 | Using the GetParent library function in a loop, returns the distance | |
| 1199 | between an ancestor window and a child (descendant) window. | |
| 1200 | ||
| 1201 | =end original | |
| 1202 | ||
| 1203 | Using the GetParent library function in a loop, returns the distance | |
| 1204 | between an ancestor window and a child (descendant) window. | |
| 1205 | (TBT) | |
| 1206 | ||
| 1207 | =begin original | |
| 1208 | ||
| 1209 | Features/bugs: | |
| 1210 | If the given "ancsetor" is not really an ancestor, the return value is the distance of child from the root window (0) | |
| 1211 | If you supply the same id for both the ancestor and the child you get 1. | |
| 1212 | If the ancestor you are checking is not 0 then the distance given is 1 larger than it should be. | |
| 1213 | ||
| 1214 | =end original | |
| 1215 | ||
| 1216 | Features/bugs: | |
| 1217 | If the given "ancsetor" is not really an ancestor, the return value is the distance of child from the root window (0) | |
| 1218 | If you supply the same id for both the ancestor and the child you get 1. | |
| 1219 | If 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 | ||
| 1224 | see eg\get_child_depth.pl | |
| 1225 | ||
| 1226 | =end original | |
| 1227 | ||
| 1228 | see eg\get_child_depth.pl | |
| 1229 | (TBT) | |
| 1230 | ||
| 1231 | =item $res = SendMessage(hWnd,Msg,wParam,lParam) * | |
| 1232 | ||
| 1233 | =begin original | |
| 1234 | ||
| 1235 | This is a library function (see MSDN) used by a number of the functions provided by | |
| 1236 | Win32::GuiTest. It sends the specified message to a window or windows. | |
| 1237 | HWnd 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). | |
| 1240 | Msg the message | |
| 1241 | wParam additional parameter | |
| 1242 | lParam additioanl parameter | |
| 1243 | ||
| 1244 | =end original | |
| 1245 | ||
| 1246 | This is a library function (see MSDN) used by a number of the functions provided by | |
| 1247 | Win32::GuiTest. It sends the specified message to a window or windows. | |
| 1248 | HWnd 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). | |
| 1251 | Msg the message | |
| 1252 | wParam additional parameter | |
| 1253 | lParam additioanl parameter | |
| 1254 | (TBT) | |
| 1255 | ||
| 1256 | =begin original | |
| 1257 | ||
| 1258 | It is most likely you won't use this directly but through one of the functions | |
| 1259 | implemented already in Win32::GuiTest. | |
| 1260 | ||
| 1261 | =end original | |
| 1262 | ||
| 1263 | It is most likely you won't use this directly but through one of the functions | |
| 1264 | implemented already in Win32::GuiTest. | |
| 1265 | (TBT) | |
| 1266 | ||
| 1267 | =begin original | |
| 1268 | ||
| 1269 | See the guitest.xs for some examples. | |
| 1270 | ||
| 1271 | =end original | |
| 1272 | ||
| 1273 | See the guitest.xs for some examples. | |
| 1274 | (TBT) | |
| 1275 | ||
| 1276 | =item $res = PostMessage(hwnd,msg,wParam,lParam) * | |
| 1277 | ||
| 1278 | =begin original | |
| 1279 | ||
| 1280 | See corresponding Windows library function in MSDN. | |
| 1281 | ||
| 1282 | =end original | |
| 1283 | ||
| 1284 | See 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 | ||
| 1299 | The names say it. Works on radio buttons and | |
| 1300 | checkboxes. For regular buttons, use IsWindowEnabled. | |
| 1301 | ||
| 1302 | =end original | |
| 1303 | ||
| 1304 | The names say it. Works on radio buttons and | |
| 1305 | checkboxes. 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 | ||
| 1336 | See corresponding Windows functions. | |
| 1337 | ||
| 1338 | =end original | |
| 1339 | ||
| 1340 | 対応する Windows 関数を参照してください。 | |
| 1341 | ||
| 1342 | =item ($x,$y) = ScreenToNorm(x,y) | |
| 1343 | ||
| 1344 | =begin original | |
| 1345 | ||
| 1346 | Returns normalised coordinates of given point (0-FFFF as a fraction of screen | |
| 1347 | resolution) | |
| 1348 | ||
| 1349 | =end original | |
| 1350 | ||
| 1351 | Returns normalised coordinates of given point (0-FFFF as a fraction of screen | |
| 1352 | resolution) | |
| 1353 | (TBT) | |
| 1354 | ||
| 1355 | =item ($x,$y) = NormToScreen(x,y) | |
| 1356 | ||
| 1357 | =begin original | |
| 1358 | ||
| 1359 | The opposite transformation | |
| 1360 | ||
| 1361 | =end original | |
| 1362 | ||
| 1363 | The opposite transformation | |
| 1364 | (TBT) | |
| 1365 | ||
| 1366 | =item ($x,$y) = GetScreenRes() | |
| 1367 | ||
| 1368 | =begin original | |
| 1369 | ||
| 1370 | Returns screen resolution | |
| 1371 | ||
| 1372 | =end original | |
| 1373 | ||
| 1374 | Returns 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 | ||
| 1385 | See corresponding Windows functions. | |
| 1386 | ||
| 1387 | =end original | |
| 1388 | ||
| 1389 | See corresponding Windows functions. | |
| 1390 | (TBT) | |
| 1391 | ||
| 1392 | =cut | |
| 1393 | ||
| 1394 | =item SelComboItem($window, $index) | |
| 1395 | ||
| 1396 | =begin original | |
| 1397 | ||
| 1398 | Selects an item in the combo box based off an index (zero-based). | |
| 1399 | ||
| 1400 | =end original | |
| 1401 | ||
| 1402 | Selects 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 | ||
| 1409 | Selects an item in the combo box based off text (case insensitive). | |
| 1410 | ||
| 1411 | =end original | |
| 1412 | ||
| 1413 | Selects 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 | ||
| 1426 | Fetch the contents of the list and combo boxes. | |
| 1427 | ||
| 1428 | =end original | |
| 1429 | ||
| 1430 | Fetch 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 | ||
| 1439 | Wrapper around the GetAsyncKeyState API function. Returns TRUE if the user presses the | |
| 1440 | specified key. | |
| 1441 | ||
| 1442 | =end original | |
| 1443 | ||
| 1444 | Wrapper around the GetAsyncKeyState API function. Returns TRUE if the user presses the | |
| 1445 | specified 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 | ||
| 1461 | Wrapper 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 | ||
| 1465 | Wrapper 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 | ||
| 1577 | A class to manage a Windows DIB section. Currently limited in functionality to | |
| 1578 | 24-bit images. Pulled from old code into GuiTest when I (jurasz@imb.uni-karlsruhe.de) | |
| 1579 | needed to create several grayscale screen dumps. | |
| 1580 | ||
| 1581 | =end original | |
| 1582 | ||
| 1583 | A class to manage a Windows DIB section. Currently limited in functionality to | |
| 1584 | 24-bit images. Pulled from old code into GuiTest when I (jurasz@imb.uni-karlsruhe.de) | |
| 1585 | needed to create several grayscale screen dumps. | |
| 1586 | (TBT) | |
| 1587 | ||
| 1588 | =begin original | |
| 1589 | ||
| 1590 | Possible future extenstions: other color resolutions, loading, comparison of bitmaps, | |
| 1591 | getting from clipboard. | |
| 1592 | ||
| 1593 | =end original | |
| 1594 | ||
| 1595 | Possible future extenstions: other color resolutions, loading, comparison of bitmaps, | |
| 1596 | getting from clipboard. | |
| 1597 | (TBT) | |
| 1598 | ||
| 1599 | =begin original | |
| 1600 | ||
| 1601 | Synopsis: | |
| 1602 | ||
| 1603 | =end original | |
| 1604 | ||
| 1605 | Synopsis: | |
| 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 | ||
| 1620 | Copy a client area of given window (or possibly its subset) into a given DibSect. | |
| 1621 | The rectangle may be optionally passed as a reference to 4-element array. | |
| 1622 | To get the right result make sure the window you want to copy is not obscured by | |
| 1623 | others. | |
| 1624 | ||
| 1625 | =end original | |
| 1626 | ||
| 1627 | Copy a client area of given window (or possibly its subset) into a given DibSect. | |
| 1628 | The rectangle may be optionally passed as a reference to 4-element array. | |
| 1629 | To get the right result make sure the window you want to copy is not obscured by | |
| 1630 | others. | |
| 1631 | (TBT) | |
| 1632 | ||
| 1633 | =item bool DibSect::CopyWindow(hwnd) | |
| 1634 | ||
| 1635 | =begin original | |
| 1636 | ||
| 1637 | Copy the window rectangle. Equivalent to | |
| 1638 | ||
| 1639 | =end original | |
| 1640 | ||
| 1641 | Copy 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 | ||
| 1650 | Save the current contents of the DIB section in a given file. With 24-bit | |
| 1651 | resolution it can grow quite big, so I immediately convert them to PNG (direct | |
| 1652 | writing of PNG seemed to complicated to implement). | |
| 1653 | ||
| 1654 | =end original | |
| 1655 | ||
| 1656 | Save the current contents of the DIB section in a given file. With 24-bit | |
| 1657 | resolution it can grow quite big, so I immediately convert them to PNG (direct | |
| 1658 | writing of PNG seemed to complicated to implement). | |
| 1659 | (TBT) | |
| 1660 | ||
| 1661 | =item bool DibSect::Invert() | |
| 1662 | ||
| 1663 | =begin original | |
| 1664 | ||
| 1665 | Invert the colors in a current DIB section. | |
| 1666 | ||
| 1667 | =end original | |
| 1668 | ||
| 1669 | Invert the colors in a current DIB section. | |
| 1670 | (TBT) | |
| 1671 | ||
| 1672 | =item bool DibSect::ToGrayScale() | |
| 1673 | ||
| 1674 | =begin original | |
| 1675 | ||
| 1676 | Convert the DibSection to the gray scale. Note that it is still encoded as 24-bit | |
| 1677 | BMP for simplicity. | |
| 1678 | ||
| 1679 | =end original | |
| 1680 | ||
| 1681 | Convert the DibSection to the gray scale. Note that it is still encoded as 24-bit | |
| 1682 | BMP for simplicity. | |
| 1683 | (TBT) | |
| 1684 | ||
| 1685 | =item bool DibSect::ToClipboard() | |
| 1686 | ||
| 1687 | =begin original | |
| 1688 | ||
| 1689 | Copies the DibSect to clipboard (as an old-fashioned metafile), so that it can | |
| 1690 | be further processed with your favourite image processing software, for example | |
| 1691 | automatically using SendKeys. | |
| 1692 | ||
| 1693 | =end original | |
| 1694 | ||
| 1695 | Copies the DibSect to clipboard (as an old-fashioned metafile), so that it can | |
| 1696 | be further processed with your favourite image processing software, for example | |
| 1697 | automatically using SendKeys. | |
| 1698 | (TBT) | |
| 1699 | ||
| 1700 | =item bool DibSect::Destroy() | |
| 1701 | ||
| 1702 | =begin original | |
| 1703 | ||
| 1704 | Destroys the contents of the DIB section. | |
| 1705 | ||
| 1706 | =end original | |
| 1707 | ||
| 1708 | Destroys 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 | ||
| 1721 | Currently (2007) there's no consensus about unicode input in Perl, so | |
| 1722 | the module declares function C<UnicodeSemantics> that sets whether | |
| 1723 | information queried from windows should use A or W syscalls. The | |
| 1724 | function that support this differentiation, and produce different | |
| 1725 | results 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 | ||
| 1737 | C<GetWindowText>, and all its callers, - FindWindowLike, WaitWindow, | |
| 1738 | WaitWindowLike | |
| 1739 | ||
| 1740 | =end original | |
| 1741 | ||
| 1742 | C<GetWindowText> およびその呼び出し元 - FindWindowLike, WaitWindow, | |
| 1743 | WaitWindowLike | |
| 1744 | ||
| 1745 | =begin original | |
| 1746 | ||
| 1747 | C<SendKeys> translated unicode characters into set of ALT+NUMPAD keystrokes. | |
| 1748 | Note that not all applications can understand unicode input. | |
| 1749 | ||
| 1750 | =end original | |
| 1751 | ||
| 1752 | C<SendKeys> translated unicode characters into set of ALT+NUMPAD keystrokes. | |
| 1753 | Note that not all applications can understand unicode input. | |
| 1754 | (TBT) | |
| 1755 | ||
| 1756 | =over | |
| 1757 | ||
| 1758 | =item UnicodeSemantics [BOOL] | |
| 1759 | ||
| 1760 | =begin original | |
| 1761 | ||
| 1762 | If a boolean parameter is set, changes the semantics flag for functions | |
| 1763 | that return results of either A or W syscalls. If the parameter is | |
| 1764 | not 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 | ||
| 1780 | If you would like to participate in the development of this module there are | |
| 1781 | several thing that need to be done. For some of them you only need Perl | |
| 1782 | and the latest source of the module from CVS for others you'll also need to | |
| 1783 | have a C++ compiler. | |
| 1784 | ||
| 1785 | =end original | |
| 1786 | ||
| 1787 | If you would like to participate in the development of this module there are | |
| 1788 | several thing that need to be done. For some of them you only need Perl | |
| 1789 | and the latest source of the module from CVS for others you'll also need to | |
| 1790 | have a C++ compiler. | |
| 1791 | (TBT) | |
| 1792 | ||
| 1793 | =begin original | |
| 1794 | ||
| 1795 | To get the latest source code you need a CVS client and then do the following: | |
| 1796 | ||
| 1797 | =end original | |
| 1798 | ||
| 1799 | To 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 | ||
| 1807 | See more detailed explanations here http://sourceforge.net/projects/winguitest/ | |
| 1808 | ||
| 1809 | =end original | |
| 1810 | ||
| 1811 | See more detailed explanations here http://sourceforge.net/projects/winguitest/ | |
| 1812 | (TBT) | |
| 1813 | ||
| 1814 | =head2 cygwin | |
| 1815 | ||
| 1816 | =begin original | |
| 1817 | ||
| 1818 | g++ needs to be installed | |
| 1819 | ||
| 1820 | =end original | |
| 1821 | ||
| 1822 | g++ 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 | ||
| 1834 | To setup a development environment for compiling the C++ code you can either buy | |
| 1835 | Visual Studio with Visual C++ or you can download a few things free of charge from | |
| 1836 | Microsoft. There might be other ways too we have not explored. | |
| 1837 | ||
| 1838 | =end original | |
| 1839 | ||
| 1840 | To setup a development environment for compiling the C++ code you can either buy | |
| 1841 | Visual Studio with Visual C++ or you can download a few things free of charge from | |
| 1842 | Microsoft. There might be other ways too we have not explored. | |
| 1843 | (TBT) | |
| 1844 | ||
| 1845 | =begin original | |
| 1846 | ||
| 1847 | The instructions to get the free environment are here: | |
| 1848 | ||
| 1849 | =end original | |
| 1850 | ||
| 1851 | The instructions to get the free environment are here: | |
| 1852 | (TBT) | |
| 1853 | ||
| 1854 | =begin original | |
| 1855 | ||
| 1856 | From http://www.microsoft.com/ download and install: | |
| 1857 | ||
| 1858 | =end original | |
| 1859 | ||
| 1860 | From 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 | ||
| 1868 | This is not enough as there are a number of header files and libraries that are | |
| 1869 | not included in these distributions. You can get them from Microsoft in two additional | |
| 1870 | downloads. For these you will have to be using Internet Explorer. | |
| 1871 | Visit | |
| 1872 | ||
| 1873 | =end original | |
| 1874 | ||
| 1875 | This is not enough as there are a number of header files and libraries that are | |
| 1876 | not included in these distributions. You can get them from Microsoft in two additional | |
| 1877 | downloads. For these you will have to be using Internet Explorer. | |
| 1878 | Visit | |
| 1879 | (TBT) | |
| 1880 | ||
| 1881 | http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ | |
| 1882 | ||
| 1883 | =begin original | |
| 1884 | ||
| 1885 | and install | |
| 1886 | ||
| 1887 | =end original | |
| 1888 | ||
| 1889 | and install | |
| 1890 | (TBT) | |
| 1891 | ||
| 1892 | 1) Core SDK | |
| 1893 | 2) Microsoft Data Access Components 2.7 | |
| 1894 | ||
| 1895 | =begin original | |
| 1896 | ||
| 1897 | Before you can compile you'll have to open a command prompt and execute the | |
| 1898 | C<sdkvars.bat> script from the.NET SDK that will set a number of environment | |
| 1899 | variables. In addition you'll have to run the C<setenv.bat> you got with the | |
| 1900 | Core SDK (and located in C:\Program Files\Microsoft SDK) with the appropriate | |
| 1901 | parameters. For me this was /XP32 /RETAIL | |
| 1902 | ||
| 1903 | =end original | |
| 1904 | ||
| 1905 | Before you can compile you'll have to open a command prompt and execute the | |
| 1906 | C<sdkvars.bat> script from the.NET SDK that will set a number of environment | |
| 1907 | variables. In addition you'll have to run the C<setenv.bat> you got with the | |
| 1908 | Core SDK (and located in C:\Program Files\Microsoft SDK) with the appropriate | |
| 1909 | parameters. For me this was /XP32 /RETAIL | |
| 1910 | (TBT) | |
| 1911 | ||
| 1912 | =begin original | |
| 1913 | ||
| 1914 | In order to finish the packaging you'll also need the tar, gzip and zip utilities from | |
| 1915 | ||
| 1916 | =end original | |
| 1917 | ||
| 1918 | In 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 | ||
| 1925 | I have not tried it yet. | |
| 1926 | ||
| 1927 | =end original | |
| 1928 | ||
| 1929 | I have not tried it yet. | |
| 1930 | (TBT) | |
| 1931 | ||
| 1932 | =begin original | |
| 1933 | ||
| 1934 | After this you will probably be able to do the normal cycle: | |
| 1935 | ||
| 1936 | =end original | |
| 1937 | ||
| 1938 | After 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 | ||
| 1953 | Module's documentation is available at L<http://www.piotrkaluski.com/files/winguitest/docs/index.html>. | |
| 1954 | ||
| 1955 | =end original | |
| 1956 | ||
| 1957 | Module'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 | ||
| 1964 | Here are a few items where help would be welcome. | |
| 1965 | ||
| 1966 | =end original | |
| 1967 | ||
| 1968 | Here 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 | ||
| 403 | 1990 | The SendKeys function is based on the Delphi sourcecode |
| 404 | 1991 | published by Al Williams E<lt>http://www.al-williams.com/awc/E<gt> |
| 405 | in Dr.Dobbs E<lt>http://www.dd | |
| 1992 | in Dr.Dobbs E<lt>http://www.drdobbs.com/keys-to-the-kingdom/184410429E<gt>. | |
| 406 | 1993 | |
| 407 | Copyright (c) 1998-200 | |
| 1994 | Copyright (c) 1998-2002 Ernesto Guisado, (c) 2004 Dennis K. Paulsen. All rights | |
| 408 | is free software; You may distribute it and/or modify it | |
| 1995 | reserved. This program is free software; You may distribute it and/or modify it | |
| 409 | same terms as Perl itself. | |
| 1996 | under the same terms as Perl itself. | |
| 410 | 1997 | |
| 411 | =head1 | |
| 1998 | =head1 AUTHORS | |
| 412 | 1999 | |
| 413 | Ernesto Guisado | |
| 2000 | Ernesto Guisado (erngui@acm.org), http://triumvir.org | |
| 414 | 2001 | |
| 415 | = | |
| 2002 | =begin original | |
| 416 | 2003 | |
| 417 | ||
| 2004 | Jarek Jurasz (jurasz@imb.uni-karlsruhe.de), http://www.uni-karlsruhe.de/~gm07 wrote | |
| 2005 | DibSect and some other pieces (see C<Changes> for details). | |
| 2006 | ||
| 2007 | =end original | |
| 2008 | ||
| 2009 | Jarek Jurasz (jurasz@imb.uni-karlsruhe.de), http://www.uni-karlsruhe.de/~gm07 は | |
| 2010 | DibSect とその他の一部分を書きました (詳しくは C<Changes> 参照)。 | |
| 2011 | ||
| 2012 | =begin original | |
| 2013 | ||
| 2014 | Dennis K. Paulsen (ctrondlp@cpan.org) wrote various pieces (See C<Changes> for | |
| 2015 | details). | |
| 2016 | ||
| 2017 | =end original | |
| 2018 | ||
| 2019 | Dennis K. Paulsen (ctrondlp@cpan.org) はさまざまな部分を書きました | |
| 2020 | (詳しくは C<Changes> 参照)。 | |
| 2021 | ||
| 2022 | =begin original | |
| 2023 | ||
| 2024 | Dmitry Karasik (dmitry@karasik.eu.org) added support for unicode and cygwin/mingw. | |
| 2025 | ||
| 2026 | =end original | |
| 2027 | ||
| 2028 | Dmitry Karasik (dmitry@karasik.eu.org) は Unicode と | |
| 2029 | cygwin/mingw 対応を追加しました。 | |
| 2030 | ||
| 2031 | =head1 CREDITS | |
| 2032 | ||
| 2033 | =begin original | |
| 2034 | ||
| 2035 | Thanks 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 | ||
| 2069 | for code, suggestions and bug fixes. | |
| 2070 | ||
| 2071 | =end original | |
| 2072 | ||
| 2073 | コード、提案、バグ修正を行ってくださいました。 | |
| 2074 | ||
| 2075 | =back | |
| 2076 | ||
| 2077 | =begin meta | |
| 2078 | ||
| 2079 | Translate: 川合孝典 <GCD00051@nifty.ne.jp> (1.3) | |
| 2080 | Update: Kentaro Shirakata <argrath@ub32.org> (1.64-) | |
| 2081 | Status: in progress | |
| 2082 | ||
| 2083 | =end meta | |
| 2084 | ||
| 2085 | =cut |