Adds the ability to set the window position and other attributes.
BOOL
SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags)
HWND hWnd;
HWND hWndInsertAfter;
int X;
int Y;
int cx;
int cy;
UINT uFlags;
CODE:
RETVAL = SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy,
uFlags);
OUTPUT:
RETVAL
Hi Paul,
--- In perlguitest@y..., "paulbt2000" <pcovington@a...> wrote:
> I have looked for this magazine at 3 different Barnes & Nobles, 2
> Book Stops, and Comp USA. I haven't seen it anywhere. Where were
you
> guys able to find it? Thanks.
My fault. It probably isn't available yet in bookstores, etc. It will
already be available to suscriptors though. You'll probably have to
wait until beginning of February...
Regards,
Ernesto.
I figured out what was wrong, simple user error. I was trying to get
the text from a ListView box rather than a simple List box. I am in
the process of writing the routine to pull info from ListView boxes.
Paul
--- In perlguitest@y..., "paulbt2000" <pcovington@a...> wrote:
> Has anyone got the GetListContents function to work? I am on a Win
> 2000 box. I have tried it serval times and come up empty handed
> everytime. Thanks everyone.
>
> Paul
I have looked for this magazine at 3 different Barnes & Nobles, 2
Book Stops, and Comp USA. I haven't seen it anywhere. Where were you
guys able to find it? Thanks.
Paul
--- In perlguitest@y..., "erngui" <erngui@y...> wrote:
> Hi all,
>
> thought you might be interested in knowing that the current issue
(Feb 2002) of the Windows Developer Magazine (http://www.wd-mag.com/)
includes the following article:
>
> *Testing Win32 GUIs with Perl and C*
>
> Ernesto Guisado
> Testing GUI-based apps manually can be challenging and expensive.
Ernesto has written the Win32::GuiTest Perl module in a combination
of Perl and C to help automate the GUI testing process. It bundles
together the facilities for GUI testing offered by the Win32 API with
some powerful general-purpose Perl functionality.
>
> Regards,
> Ernesto.
> --
> Ernesto Guisado
> mailto:erngui@a...
> http://triumvir.org
Hi,
--- In perlguitest@y..., "paulbt2000" <pcovington@a...> wrote:
> Here is some stuff I added to be able to mess with tab controls, i am
> a rookie at all of this, so if I didn't do something correctly let me
> know.
Looks good to me.
Thanks Paul, I'll try to get it into the next release.
Regards,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org
Hi all,
thought you might be interested in knowing that the current issue (Feb 2002) of
the Windows Developer Magazine (http://www.wd-mag.com/) includes the following
article:
*Testing Win32 GUIs with Perl and C*
Ernesto Guisado
Testing GUI-based apps manually can be challenging and expensive. Ernesto has
written the Win32::GuiTest Perl module in a combination of Perl and C to help
automate the GUI testing process. It bundles together the facilities for GUI
testing offered by the Win32 API with some powerful general-purpose Perl
functionality.
Regards,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org
Here is some stuff I added to be able to mess with tab controls, i am
a rookie at all of this, so if I didn't do something correctly let me
know.
in guitest.xs
#include <commctrl.h>
void
TabCtrl_SetCurFocus(hWnd, item)
HWND hWnd
int item
CODE:
TabCtrl_SetCurFocus(hWnd, item);
int
TabCtrl_GetCurFocus(hWnd)
HWND hWnd
CODE:
RETVAL = TabCtrl_GetCurFocus(hWnd);
OUTPUT:
RETVAL
int
TabCtrl_SetCurSel(hWnd, item)
HWND hWnd
int item
CODE:
RETVAL = TabCtrl_SetCurSel(hWnd, item);
OUTPUT:
RETVAL
int
TabCtrl_GetItemCount(hWnd)
HWND hWnd
CODE:
RETVAL = TabCtrl_GetItemCount(hWnd);
OUTPUT:
RETVAL
i then added the appropriate lines to guitest.pm
@EXPORT_OK = qw(
$debug
...
...
TabCtrl_SetCurFocus
TabCtrl_GetCurFocus
TabCtrl_SetCurSel
TabCtrl_GetItemCount
);
Hope this helps some people.
paul
--- In perlguitest@y..., "paulbt2000" <pcovington@a...> wrote:
> If I add functionality to GuiTest how do I share that with everyone?
> Thanks.
>
Hi,
if you send them to me (mailto:erngui@...), there is a fair chance that your
changes make it into the main distribution. I also give credit to the person who
send in the changes in the README file.
Another way is to post them to this list.
Regards,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org
--- In perlguitest@y..., "aslpyee" <aslpyee@n...> wrote:
> Hi there,
>
> how to use GetComboText and GetComboContents? Where can I find the
> help file for this?
>
Sorry for the delay, just came back from holidays.
The documentation is definitively something I have to improve...
Did you take a look at the samples in the 'eg' directory?
In particular 'eg\fonts.pl':
use Win32::GuiTest qw/SendKeys FindWindowLike GetComboContents/;
# Let's see notepad
system("start notepad.exe");
sleep 1;
# Open the Font dialog (change for you language)
SendKeys("%ef");
# Find the Font dialog using the title and window class
# The Font dialog isn't a child of the notepad window
my ($fontdlg) = FindWindowLike(0, "Font", "#32770");
die "Where is the Font dialog?\n" unless $fontdlg;
# Find the right combo using it's control id
my ($combo) = FindWindowLike($fontdlg, "", "ComboBox", 0x470);
die "Where is the combo with the font names?" unless $combo;
# Print all the font names
for (GetComboContents($combo)) {
print "'$_'" . "\n";
}
# Close the dialog and notepad
SendKeys("{ESC}%{F4}");
Regards,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org
Has anyone got the GetListContents function to work? I am on a Win
2000 box. I have tried it serval times and come up empty handed
everytime. Thanks everyone.
Paul
Hi,
--- In perlguitest@y..., "aslpyee" <aslpyee@n...> wrote:
[...]
> I am a new user. May I know where can I find the description of a
> command within the Win32::GuiTest? Eg, FindWindowLike
(0," ", " ").
> What does 0 represent? Between " ", what will it accept?
The documentation is not as comprehensive as I'd like. Some functions
are documented in the readme file that comes with the distribution:
http://search.cpan.org/doc/ERNGUI/Win32-GuiTest-1.3/README.html
About FindWindowLike it says:
FindWindowLike WINDOW, TITLEPATTERN, CLASSPATTERN, CHILDID
Finds the window handles of the windows matching the specified
parameters and returns them as a list.
You may specify the handle of the window to search under. The routine
searches through all of this windows children and their children
recursively. If 'undef' then the routine searches through all
windows. There is also a regexp used to match against the text in the
window caption and another regexp used to match against the text in
the window class. If you pass a child ID number, the functions will
only match windows with this id. In each case undef matches
everything.
Regards,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org
Hi there,
May I know where can I find the description of a command within the
Win32::GuiTest? Eg, FindWindowLike(0," ", " "). What does 0 represent?
In between " ", what will it accept?
That's all, thank u.
Regards,
Yee
Hi there,
I am a new user. May I know where can I find the description of a
command within the Win32::GuiTest? Eg, FindWindowLike(0," ", " ").
What does 0 represent? Between " ", what will it accept?
That's all, thank u.
Regards,
Yee
Hi,
> In other words: unless somebody contributes some code that does
this,
> I'd say the chances are small.
>
> Sorry I can't be of more help,
> Ernesto.
I changed my view about this question. I used Win32::Clipboard +
Win32::Guitest to type Japanese strings to target application.
That is, copy Jp string into Clipboard, and then focus by
Win32::GuiTest and then copy it. That's fine.
Thanks a lot.
--Tatsuya Kimura
Hi,
--- In perlguitest@y..., "pc210018" <pc210018@n...> wrote:
[...]
> I installed via PPM this module today. It looks like what is in
the
> repository is version .9 not the latest 1.3.
Sounds strange. The ppm installer uses the local .tar.gz file that
comes with the distribution. I just downloaded from cpan and the .pm
file inside the .tar.gz file says 1.3, so I'd say the distribution
looks ok. Any chance your problem is caused by something else?
> I tried adding the line
> ShowWindow($window,1);
> to the code below to see if this would bring the destination window
> to the top. But it does not.
> Is the any documentation for these extra functions?
No. I'm working on it, but mostly the "documentation" is the sample
programs in the "eg" directory.
> $title='Remedy User.*';
> $window = FindWindowLike (0,$title)
> SetForegroundWindow($window);
> SendKeys("Starting Order");
My guess is you're working on Windows 2000.
MS changed the way SetForegroundWindow works: in previous versions of
the OS, if you had a menu open and a program/window comes to the
foreground, the menu closes, which a lot of people found anoying. In
W2000 the window doens't actually become the foreground window,
instead the icon in the taskbar starts to flash...
This is bad for SendKeys and at the moment, the only way I've found
around it is to use SendKeys to send ALT+TAB get 2000 to switch
windows this way...
Regards,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org
I am trying to use the sendkeys function from within a perl TK
program. If the window that I am sending the keystokes to is not the
active window, the keystrokes are not received. If it is the active
window, it works fine.
I installed via PPM this module today. It looks like what is in the
repository is version .9 not the latest 1.3.
I tried adding the line
ShowWindow($window,1);
to the code below to see if this would bring the destination window
to the top. But it does not.
Is the any documentation for these extra functions?
use Win32::GuiTest qw(FindWindowLike GetWindowText
SetForegroundWindow SendKeys ShowWindow);
$title='Remedy User.*';
$window = FindWindowLike (0,$title)
SetForegroundWindow($window);
SendKeys("Starting Order");
Thanks
Phil
pc210018@...
Hi,
--- In perlguitest@y..., tatsuya_kimura_jp@y... wrote:
[snip]
> Is this module planing to implement this feature, that is IME ON /
> IME OFF?
I have not experience at all with IME and even if I somehow managed
to implement what you're asking for, I could imagine that I would
have a hard time verifying that it works (not having a japanese
machine, that is).
In other words: unless somebody contributes some code that does this,
I'd say the chances are small.
Sorry I can't be of more help,
Ernesto.
Hi,
I'm using Perl on Japanese environment and also using this module on
it. In order to type Japanese strings, I'm trying to turn IME on and
then type jp string like nihon and then push space key, enter key,
and then turn IME off with Win32::API and some Win32 imm function
such as ImmGetContext... (However, it don't work out.)
Is this module planing to implement this feature, that is IME ON /
IME OFF?
Below is sample code. (It doesn't work...)
$hIMC = $ImmGetContext->Call($wHnd);
my $fOpen = $ImmGetOpenStatus->Call($hIMC);
$nRes = $ImmSetOpenStatus->Call($hIMC, not $fOpen);
Win32::GuiTest::SendKeys("nihon{SPACE}{ENTER}");
$nRes = $ImmReleaseContext->Call($xcwHnd, $hIMC);
--Tatsuya Kimura
Hi,
GuiTest version 1.3 is out.
From the README:
1.30 Sat Dec 1 20:50:02 2001
- Fixed bad POD formating. Added podchecker and html pod generation
to makedist.bat.
- Added PushButton and PushChildButton. Based on code from an
anonymous contributor. Thanks! See 'eg\pushbutton.pl' for an example.
- Fixed a problem when building with Active State, build 526.
As always available from:
http://www.cpan.org/authors/id/E/ER/ERNGUI/http://search.cpan.org/search?dist=Win32-GuiTest
Regards,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org
Hi,
--- In perlguitest@y..., erngui@y... wrote:
> --- In perlguitest@y..., Jonathan Epstein <Jonathan_Epstein@n...>
> wrote:
> > Positioning the mouse can be readily achieved using Win32::API,
but
> clicking the mouse is much harder. Any chance of adding this to
> Win32::GuiTest and calling it ButtonClick?
Re-reading my post, I just realized that I had misunderstood your
question/query.
You're right, what you are asking for isn't included in GuiTest and
it would be useful.
The next version of GuiTest will include something similar.
Regards,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org
Hi,
--- In perlguitest@y..., Jonathan Epstein <Jonathan_Epstein@n...>
wrote:
> Positioning the mouse can be readily achieved using Win32::API, but
clicking the mouse is much harder. Any chance of adding this to
Win32::GuiTest and calling it ButtonClick?
General mouse input us already part of GuiTest. The following snippet
opens a paint program and draws a tiangle in it using the mouse:
use Win32::GuiTest qw(MouseMoveAbsPix
SendLButtonDown SendLButtonUp);
system("start /max pbrush.exe");
sleep 2;
MouseMoveAbsPix(100,100);
SendLButtonDown();
MouseMoveAbsPix(500,500);
MouseMoveAbsPix(100,500);
MouseMoveAbsPix(100,100);
SendLButtonUp();
Also test.pl and the 'eg/paint*' samples that come with the
distribution show how to use them.
Hope this helps,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org
Positioning the mouse can be readily achieved using Win32::API, but clicking the
mouse is much harder. Any chance of adding this to Win32::GuiTest and calling
it ButtonClick?
Here's some code which doesn't work ;-) ... maybe this will provide the
necessary hints to produce a working version?
-Jonathan
#my($PostMessage) = new Win32::API("user32","PostMessage","PIIN","I");
#$PostMessage->call($explorer,$WM_LBUTTONDOWN,$MK_LBUTTON, $x + ($y << 16));
#$PostMessage->call($explorer,$WM_LBUTTONUP,$MK_LBUTTON, $x + ($y << 16));
my($mouse_event) = new Win32::API("user32","mouse_event","NNNNP","");
$mouse_event->call($MOUSEEVENTF_LEFTDOWN,$x,$y,0,0);
$mouse_event->call($MOUSEEVENTF_LEFTUP,$x,$y,0,0);
Thanks, Ernesto. Other packages install fine using the same technique. I was using an older version of Perl, however, and after upgrading to 5.6, it's working fine now. Thanks for your quick reply.
-- John
-----Original Message----- From: erngui@... [mailto:erngui@...] Sent: Wednesday, November 14, 2001 4:43 PM To: perlguitest@yahoogroups.com Subject: [perlguitest] Re: Problems installing using PPM
Hi,
At 20.54 14/11/01 +0000, you wrote: "Error installing package 'win32-guitest.ppd': Read of ./ failed"
* Are you able to install other perl modules on that machine using ppm? * Are the TMP and TEMP environment variables set? * What version of perl are you using (perl -v).
I normally use ActiveState 5.6.0 (build 616).
Hope this helps, Ernesto. -- Ernesto Guisado mailto:erngui@... http://triumvir.org
To unsubscribe from this group, send an email to: perlguitest-unsubscribe@yahoogroups.com
Hi,
At 20.54 14/11/01 +0000, you wrote:
"Error installing package 'win32-guitest.ppd': Read of ./ failed"
* Are you able to install other perl modules on that machine using
ppm?
* Are the TMP and TEMP environment variables set?
* What version of perl are you using (perl -v).
I normally use ActiveState 5.6.0 (build 616).
Hope this helps,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org
Hello,
I am new to this so any help will be much appreciated.
When attempting to install, I get the following error:
"Error installing package 'win32-guitest.ppd': Read of ./ failed"
The syntax I am using (windows 98 command prompt) is:
"C:\WINDOWS\Desktop\fred>ppm install win32-guitest.ppd"
The zip file has been extracted in the following manner:
Directory of C:\WINDOWS\Desktop\fred
. <DIR> 11-14-01 8:08a .
.. <DIR> 11-14-01 8:08a ..
WIN32-~1 GZ 21,909 11-04-01 8:28p Win32-GuiTest.tar.gz
GUITEST PM 18,967 11-04-01 8:27p GuiTest.pm
GUITEST XS 19,775 11-04-01 8:27p GuiTest.xs
MAKEDIST BAT 241 12-23-00 11:34p makedist.bat
MAKEFILE PL 473 11-01-99 11:38a Makefile.PL
MANIFEST 294 11-04-01 8:25p MANIFEST
README 13,845 11-04-01 8:28p README
TEST PL 6,218 06-17-01 7:24p test.pl
TYPEMAP 474 06-16-01 10:49p typemap
WIN32-~1 PPD 297 11-04-01 8:28p Win32-GuiTest.ppd
EG <DIR> 11-14-01 12:55p eg
DIR TXT 0 11-14-01 12:56p dir.txt
11 file(s) 82,493 bytes
3 dir(s) 4,855.80 MB free
Any ideas as to what's wrong?
Thanks,
-- John Huber
Hi,
version 1.2 is out.
From the README:
- Added GetComboText, GetComboContents, GetListText and
GetListContents to allow easy extraction of data from list and combo
boxes.
- Added 'eg\fonts.pl' to show the new functionality. This script
opens the Notepad "Font" dialog and prints to stdout the contents of
the Font combobox.
- Fixed bug in SendMessage (and others), where the return value was
lost. Caused by a missing OUTPUT tag.
- Added IsKeyPressed function. Suggested by Rudi Farkas.
See 'eg\keypress.pl' for a demo. Works even if the script is running
in the background.
It will be available from:
http://www.cpan.org/authors/id/E/ER/ERNGUI/http://search.cpan.org/search?dist=Win32-GuiTest
Regards,
Ernesto.
--
Ernesto Guisado
mailto:erngui@...http://triumvir.org