Re: GTK2 Accessibility on Win32, Alternative GUi Libs?
ActiveState recently released the Tkx module on CPAN; Tkx works in a similar fashion to Python's Tkinter or the existing Tcl::Tk module. Tkx provides a clean interface into scripting Tk from Perl, and should support MSAA version 1 at least. Tkx also allows you to use themed Tk widgets; an example of this could be seen in the Gui interfaces of our own PDK product. http://search.cpan.org/~gaas/Tkx-1.02/Tkx.pm cheers, JeffG Veli-Pekka Tätilä wrote: Hi list, The recent post about GTK on Win32 got me thinking of using that library in Perl applications intended for Win32. I'd like to do a GUI in perl but such that it is accessible to WIndows screen reader programs. That's because I have to use one myself. While the Win32::GUI package does work, it's still a bit early and experimental. In particular, I haven't found out a way to load dialog resources and have found that some window metrics appear to be mising. TK, on the other hand, is well documented but many of their "standard" controls are not accessible out of the box. Neither using NArrator nor with any of the big three readers as far as I know. I've only tried TK sample apps with Dolphin Supernova 6.x betas, though. Something as fundamental as a push button doesn't look like a button to the screen reader and keybord usage is slightly different, too. So if someone is using GTK2 on WIn32, does that mean the accessibility support inherent in GTK2 will migrate to Windows via Microsoft Active accessibility (MSAA)? I suppose not. Most of my experiences about Win32 ported GTK2 apps have been rather negative. I'm not sure if it's just the Win32 port or the use of custom controls in graphically intensive apps like Dia. By the way, even if GTK2 uses MSAA on Windows I reckon the support could still vary widely. Most readers seem to rely on screen interception and WIn32 hooks as the primary means of "data mining" with only limited MSAA support. So, how Windows like the non-native GTK2 widgets appear is down to the MSAA implementation in a particular reader. If the widgets were native, however, they would have a familiar MSAA representation in addition to supporting system-wide Win32 hooks well. As a case study, the latest Visual Studio betas use MSAA to expose most of the info on screen. However, current readers, at least on default settings, cannot make too much sense of the form designer, which I find a bit ironic considering that it's an MS app and an MS standard. But that is an OT:ish quibble, anyway. Any thoughts appreciated. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Win32::OLE(0.1701) error 0x80005000 when adding a computer to AD using Perl
The line "This code works fine when I run it as a stand alone program" leads me to believe it is a permission issue. Integrated Windows Authentication does not work well when your script needs to access a third system (in this case the domain controller). Try switching to basic authentication and see if you have better luck. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Zeltov Alex Sent: Tuesday, September 20, 2005 1:06 PM To: perl-win32-users@listserv.ActiveState.com Subject: Win32::OLE(0.1701) error 0x80005000 when adding a computer to AD using Perl I am running into a problem, when I execute a simple script to add a computer to an AD when I do it through a cgi script. This is the code that I am running: my $strBase = "OU=iLab - iLab Gatekeeper,OU=InfrApps - Infrastructure Managed Apps,OU=Applications,OU=US-DC1,DC=resdm50,DC=ilab,DC=siemensmedasp,DC=com"; my $strComp = "alex"; # e.g. joe-xp my $strDescr = "none"; # e.g. Joe's Windows XP workstation use Win32::OLE; $Win32::OLE::Warn = 3; # $ADS_USER_FLAG_ENUM my $ADS_UF_WORKSTATION_TRUST_ACCOUNT = 0x1000; my $objCont = Win32::OLE->GetObject("LDAP://" . $strBase); my $objComp = $objCont->Create("computer", "cn=" . $strComp); $objComp->Put("sAMAccountName", $strComp . "\$"); #$objComp->Put("description", $strDesc); $objComp->Put("userAccountControl", $ADS_UF_WORKSTATION_TRUST_ACCOUNT); $objComp->SetInfo; This code works fine when I run it as a stand alone program. When it runs under IIS, as cgi I am running into this error: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: Win32::OLE(0.1701) error 0x80005000 after character 0 in "LDAP://OU=US-DC1,DC=resdm50,DC=ilab,DC=siemensmedasp,DC=com" at F:\ttx218\dev\joincomputer.pl line 22 eval {...} called at F:\ttx218\dev\joincomputer.pl line 22 I have integrated windows authentication enabled, so the script runs under the same security permissions when i run it as IIS or as stand alone. Has anyone encountered this issue? I have googled this error and found a couple of threads having similar issue http://lists.ee.ethz.ch/realmen/msg00035.html Unfortunately no resolution but they are getting the same OLE error. --- This message and any included attachments are from Siemens Medical Solutions USA, Inc. and are intended only for the addressee(s). The information contained herein may include trade secrets or privileged or otherwise confidential information. Unauthorized review, forwarding, printing, copying, distributing, or using such information is strictly prohibited and may be unlawful. If you received this message in error, or have reason to believe you are not authorized to receive it, please promptly delete this message and notify the sender by e-mail with a copy to [EMAIL PROTECTED] Thank you ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Win32::OLE(0.1701) error 0x80005000 when adding a computer to AD using Perl
I am running into a problem, when I execute a simple script to add a computer to an AD when I do it through a cgi script.This is the code that I am running:my $strBase = "OU=iLab - iLab Gatekeeper,OU=InfrApps - Infrastructure Managed Apps,OU=Applications,OU=US-DC1,DC=resdm50,DC=ilab,DC=siemensmedasp,DC=com";my $strComp = "alex"; # e.g. joe-xpmy $strDescr = "none"; # e.g. Joe’s Windows XP workstationuse Win32::OLE;$Win32::OLE::Warn = 3;# $ADS_USER_FLAG_ENUMmy $ADS_UF_WORKSTATION_TRUST_ACCOUNT = 0x1000;my $objCont = Win32::OLE->GetObject("LDAP://" . $strBase);my $objComp = $objCont->Create("computer", "cn=" . $strComp);$objComp->Put("sAMAccountName", $strComp . "\$");#$objComp->Put("description", $strDesc);$objComp->Put("userAccountControl", $ADS_UF_WORKSTATION_TRUST_ACCOUNT);$objComp->SetInfo;This code works fine when I run it as a stand alone program. When it runs under IIS, as cgi I am running into this error:The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:Win32::OLE(0.1701) error 0x80005000 after character 0 in"LDAP://OU=US-DC1,DC=resdm50,DC=ilab,DC=siemensmedasp,DC=com" at F:\ttx218\dev\joincomputer.pl line 22 eval {...} called at F:\ttx218\dev\joincomputer.pl line 22I have integrated windows authentication enabled, so the script runs under the same security permissions when i run it as IIS or as stand alone.Has anyone encountered this issue? I have googled this error and found a couple of threads having similar issuehttp://lists.ee.ethz.ch/realmen/msg00035.htmlUnfortunately no resolution but they are getting the same OLE error. --- This message and any included attachments are from Siemens Medical Solutions USA, Inc. and are intended only for the addressee(s). The information contained herein may include trade secrets or privileged or otherwise confidential information. Unauthorized review, forwarding, printing, copying, distributing, or using such information is strictly prohibited and may be unlawful. If you received this message in error, or have reason to believe you are not authorized to receive it, please promptly delete this message and notify the sender by e-mail with a copy to [EMAIL PROTECTED] Thank you ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
GTK2 Accessibility on Win32, Alternative GUi Libs?
Hi list, The recent post about GTK on Win32 got me thinking of using that library in Perl applications intended for Win32. I'd like to do a GUI in perl but such that it is accessible to WIndows screen reader programs. That's because I have to use one myself. While the Win32::GUI package does work, it's still a bit early and experimental. In particular, I haven't found out a way to load dialog resources and have found that some window metrics appear to be mising. TK, on the other hand, is well documented but many of their "standard" controls are not accessible out of the box. Neither using NArrator nor with any of the big three readers as far as I know. I've only tried TK sample apps with Dolphin Supernova 6.x betas, though. Something as fundamental as a push button doesn't look like a button to the screen reader and keybord usage is slightly different, too. So if someone is using GTK2 on WIn32, does that mean the accessibility support inherent in GTK2 will migrate to Windows via Microsoft Active accessibility (MSAA)? I suppose not. Most of my experiences about Win32 ported GTK2 apps have been rather negative. I'm not sure if it's just the Win32 port or the use of custom controls in graphically intensive apps like Dia. By the way, even if GTK2 uses MSAA on Windows I reckon the support could still vary widely. Most readers seem to rely on screen interception and WIn32 hooks as the primary means of "data mining" with only limited MSAA support. So, how Windows like the non-native GTK2 widgets appear is down to the MSAA implementation in a particular reader. If the widgets were native, however, they would have a familiar MSAA representation in addition to supporting system-wide Win32 hooks well. As a case study, the latest Visual Studio betas use MSAA to expose most of the info on screen. However, current readers, at least on default settings, cannot make too much sense of the form designer, which I find a bit ironic considering that it's an MS app and an MS standard. But that is an OT:ish quibble, anyway. Any thoughts appreciated. -- With kind regards Veli-Pekka Tätilä ([EMAIL PROTECTED]) Accessibility, game music, synthesizers and programming: http://www.student.oulu.fi/~vtatila/ ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Regex
David wrote: >I thought this was working, but my logs just showed a case where it seems >not to do what I want. >Why does: >$OK_body=($body=~/library\s*?card\D*?(\d{7})\D/i) ; >Not become true when $body contains: >Library Card: 0240742 >Just possibly there's some dodgy html or something in the original that >doen't make it through to my logs, but right now I'm perplexed Is there a chance that 'Library Card: 0240742' comes at the end of the file? Or that you used chomp on the variable $body? The \D at the end of the regular expression would not work if there wasn't a nondigit at the end of the line. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Regex
[EMAIL PROTECTED] wrote: > I thought this was working, but my logs just showed a case where it > seems not to do what I want. > Why does: > $OK_body=($body=~/library\s*?card\D*?(\d{7})\D/i) ; > Not become true when $body contains: > Library Card: 0240742 > > Just possibly there's some dodgy html or something in the original > that doen't make it through to my logs, but right now I'm perplexed You state that there must be a NON numeric at end of line. I would have \D* or \D*$. Wags ;) *** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. *** ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
gtk2
Title: gtk2 I'm new to gtk and (not too experienced at Perl either!). I'm taking a stab at porting NagiosWatch so it will run under Windows. The big problem was I couldn't find gtk1 .dlls so I switched it to gtk2. It went well and I have a working version. What I'm trying to solve at the moment was the application's inability to do two things at once. That is, if the app is refreshing (it has a large table of buttons) it will not respond to a menu choice. So my question is, is there an equivalent to VB's old DoEvents() function that would allow GTK2 to "breathe' during lengthy processing? (I haven't been on this list in about 3 years. Good to see $Bill is still around) \\Greg ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Regex
David Budd wrote: > I thought this was working, but my logs just showed a case where it seems not > to do what I want. > Why does: > $OK_body=($body=~/library\s*?card\D*?(\d{7})\D/i) ; What's the last \D for ? '\s*?' should just be '\s*' - same with \D*?. > Not become true when $body contains: > Library Card: 0240742 > > Just possibly there's some dodgy html or something in the original that > doen't make it through to my logs, but right now I'm perplexed use strict; use warnings; my $body = 'Library Card: 0240742'; my $OK_body = ($body =~ /library\s*card\D*(\d{7})/i); print "OK_body = ", $OK_body ? 'true' : 'false', "\n"; __END__ -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Regex
Perhaps you need to change the final \D to \D* since it is possible that there is nothing after the 7 digits. Or perhaps omit the last \D completely. Your code works with; $body='Library Card: 0240742 '; # has a character after the 7 digits but fails with; $body='Library Card: 0240742';# no character after the 7 digits jim David Budd wrote: I thought this was working, but my logs just showed a case where it seems not to do what I want. Why does: $OK_body=($body=~/library\s*?card\D*?(\d{7})\D/i) ; Not become true when $body contains: Library Card: 0240742 Just possibly there's some dodgy html or something in the original that doen't make it through to my logs, but right now I'm perplexed ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Regex
The string $body ("Library Card: 0240740") does not end in \D ("not a number"). You might want to add a * to that if you want to make sure it matches strings that _do_ end in \D (ie. \n or \r\n or whatever stuff comes behind the "ID") and those that end in the ID itself. - Original Message - From: "David Budd" <[EMAIL PROTECTED]> To: Sent: Tuesday, September 20, 2005 4:57 PM Subject: Regex I thought this was working, but my logs just showed a case where it seems not to do what I want. Why does: $OK_body=($body=~/library\s*?card\D*?(\d{7})\D/i) ; Not become true when $body contains: Library Card: 0240742 Just possibly there's some dodgy html or something in the original that doen't make it through to my logs, but right now I'm perplexed -- David Budd, Applications section, IT Services Kilburn Building, University of Manchester Tel 56033 Email [EMAIL PROTECTED] http://www.its.man.ac.uk/applications ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Regex
Title: Regex David Budd wrote, on Tue 9/20/2005 10:57: : I thought this was working, but my logs just showed a case where it seems not to do what I want.: Why does:: $OK_body=($body=~/library\s*?card\D*?(\d{7})\D/i) ;: Not become true when $body contains:: Library Card: 0240742 Probably because your regex explicitly requires a non-digit (\D) at the end, and your example line doesn't have it. Perhaps you want \D*$ so it finds no more than 7 digits, or if more digits are allowed as long as a non-digit intervenes, you might want (\D|$). Good luck, Joe == Joseph P. Discenza, Sr. Programmer/Analyst mailto:[EMAIL PROTECTED] Carleton Inc. http://www.carletoninc.com 574.243.6040 ext. 300 fax: 574.243.6060 Providing Financial Solutions and Compliance for over 30 Years ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Check for running process
Here is another example by searching for the actual program-name in the process-list: use Win32::OLE qw(in); use Win32::OLE::Variant; # Find all PIDs, program-names, and executable paths for all running processes. for my $Process (sort{lc($a->{Name}) cmp lc($b->{Name})} in ($WMI->InstancesOf("Win32_Process"))) { $Name = $Process->{Name}; # Process program-name. $Path = $Process->{ExecutablePath}; # Process executable path. $PID = $Process->{ProcessID}; # PID. $Path = '' unless (defined($Path)); # Search for the PIDs for specific program-names. if ($Name =~ /acrobat\.exe/i) {$Acrobat = $PID} if ($Name =~ /acrotray/i) {$Tray= $PID} if ($Name =~ /monitor\.exe/i) {$Monitor = $PID} } # Kill Acrobat if it is running. if ($Acrobat) {kill('STOP',$Acrobat)} # Kill Acrotray if it is running. if ($Tray) {kill('STOP',$Tray)} Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO - USA Central Time Zone 636-755-2652 fax 636-755-2503 [EMAIL PROTECTED] www.nisc.coop From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darrell Snedecor Sent: Tuesday, September 20, 2005 08:47 To: perl-win32-users@listserv.ActiveState.com Subject: Check for running process How do I use Perl to check for the existence of a running program in Windows? Best Regards Darrell Snedecor Director Harrisburg Project 800-635-5274 618-253-8504 ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Regex
I thought this was working, but my logs just showed a case where it seems not to do what I want. Why does: $OK_body=($body=~/library\s*?card\D*?(\d{7})\D/i) ; Not become true when $body contains: Library Card: 0240742 Just possibly there's some dodgy html or something in the original that doen't make it through to my logs, but right now I'm perplexed -- David Budd, Applications section, IT Services Kilburn Building, University of Manchester Tel 56033 Email [EMAIL PROTECTED] http://www.its.man.ac.uk/applications ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Check for running process
Title: Message my @jim=`tasklist`; now parse jim and find with you're looking for. ALternatively: my @jim=`tasklist|find "whatyou'relookingfor"`; Jim will likely contain only one entry now, the thing you're looking for. :) John -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darrell SnedecorSent: Tuesday, September 20, 2005 9:47 PMTo: perl-win32-users@listserv.ActiveState.comSubject: Check for running process How do I use Perl to check for the existence of a running program in Windows? Best Regards Darrell Snedecor Director Harrisburg Project 800-635-5274 618-253-8504 ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Check for running process
Darrell Snedecor wrote: > How do I use Perl to check for the existence of a running program in > Windows? You could use WMI or Win32::PerfLib or Win32::Process::Info depending on what you really need. The latter is probably your easiest choice. -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Check for running process
Here is one way by searching for a window-name in the variable $Program: # Check for another instance of this program. use Win32::GUI; my $Desktop = GUI::GetDesktopWindow(); my $Window = GUI::GetWindow($Desktop, GW_CHILD); my $Nbr = 0; # $Program= ($HostName eq 'mailcd3') ? 'SchedulePDF' : 'ArchivePDF'; $Program= 'ArchivePDF'; while ($Window) { my $Title = GUI::Text($Window); if (length($Title) > 1 and $Title !~ /command prompt/i) {$Nbr++ if ($Title =~ /^$Program/i)} $Window = GUI::GetWindow($Window, GW_HWNDNEXT); } if ($Nbr > 1) { print(STDERR "Another instance of this program exists, exiting program\n"); print(STDERR "Ending $0\n"); exit(1); } In this example, if an instance of this program is already running, we will exit the program to prevent multiple occurences of the program. Note that in this example, we are searching against the window's actual title. Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO - USA Central Time Zone 636-755-2652 fax 636-755-2503 [EMAIL PROTECTED] www.nisc.coop From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darrell Snedecor Sent: Tuesday, September 20, 2005 08:47 To: perl-win32-users@listserv.ActiveState.com Subject: Check for running process How do I use Perl to check for the existence of a running program in Windows? Best Regards Darrell Snedecor Director Harrisburg Project 800-635-5274 618-253-8504 ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Check for running process
How do I use Perl to check for the existence of a running program in Windows? Best Regards Darrell Snedecor Director Harrisburg Project 800-635-5274 618-253-8504 ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs