Skip Menu |

This queue is for tickets about the Win32-GuiTest CPAN distribution.

Report information
The Basics
Id: 47815
Status: resolved
Priority: 0/
Queue: Win32-GuiTest

People
Owner: Nobody in particular
Requestors: leclair [...] caoua.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Win32::GuiTest with Win32::Daemon
Date: Sun, 12 Jul 2009 22:59:35 +0200
To: bug-Win32-GuiTest [...] rt.cpan.org
From: Gwenaƫlle Leclair <leclair [...] caoua.org>
Dear maintainers, I noticed that Win32::GuiTest::GetForegroundWindow and Win32::GuiTest::GetCursorPos work fine when the script is run manually from the Windows shell, but they no more work when the script is run as a Windows Service (using Win32::Daemon for that purpose): - GetForegroundWindow returns undef - GetCursorPos returns (-1, -1) Is it a bug? Is there a workaround? Please let me know, Best Regards and thank you for this great module, Gwenaelle
I cannot refer you to any documentation, but from my own experience I can only confirm that not only GetCursorPos and GetForegroundWindow, but practically all GUI-related win32 functions return null results when being run as services, while either configured not to have access to GUI, or when the user is logged out. Also, this is not a perl-related problem, the underlying API calls indeed return same values no matter whether being they are called from perl or C. I know though that it is possible to configure a service to have access to GUI (somewhere in service settings, on my win2k it is on "Control panel/Administrative tools/services/Log on/Allow interaction with desktop"). I'd expect that Win32::Daemon::CreateService provides that option, but I didn't find it in the Win32::Daemon docs. Sources mention though "service_interactive" option, but Win32::Daemon::Simple sources mention "interactive". Possibly it is a good idea to do one's own research here or talk to the Win32::Daemon author to clarify the matters... All in all, the problem area seems to be outside of Win32::GuiTest domain.
Subject: Re: [rt.cpan.org #47815] Win32::GuiTest with Win32::Daemon
Date: Tue, 14 Jul 2009 21:19:01 +0200
To: KARASIK via RT <bug-Win32-GuiTest [...] rt.cpan.org>
From: Gwenaƫlle Leclair <leclair [...] caoua.org>
Dear maintainer, Thank you very much for your answer. I changed the configuration settings according to your advice (Control panel/Administrative tools/services/Log on/Allow interaction with desktop), and my tool now runs perfectly fine! Thank you very much for your fruitful help, Best Regards, Gwenaelle On Mon, Jul 13, 2009 at 04:06:07AM -0400, KARASIK via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=47815 > > > I cannot refer you to any documentation, but from my own experience I > can only confirm that not only GetCursorPos and GetForegroundWindow, but > practically all GUI-related win32 functions return null results when > being run as services, while either configured not to have access to > GUI, or when the user is logged out. Also, this is not a perl-related > problem, the underlying API calls indeed return same values no matter > whether being they are called from perl or C. > > I know though that it is possible to configure a service to have access > to GUI (somewhere in service settings, on my win2k it is on "Control > panel/Administrative tools/services/Log on/Allow interaction with > desktop"). I'd expect that Win32::Daemon::CreateService provides that > option, but I didn't find it in the Win32::Daemon docs. Sources mention > though "service_interactive" option, but Win32::Daemon::Simple sources > mention "interactive". Possibly it is a good idea to do one's own > research here or talk to the Win32::Daemon author to clarify the > matters... All in all, the problem area seems to be outside of > Win32::GuiTest domain.
Excellent! It is good to know that it worked. Sincerely, Dmitry Karasik