Re: [perl-win32-gui-users] DOS Window minimized?

2006-04-06 Thread Roger Mayfield
I know you can test if a Win32::GUI window has been minimized, but can 
you run a sub if a DOS window has been minimized?


Roger Mayfield


ok, I found a method within the Win32::GUI called IsVisible to test 
whether the window is visible or not, but this means whether the window 
is hidden or not, it doesn't mean whether it's minimized or not. Can 
someone tell me how to test if the DOS window is minimized or not?


Another way is if I could -name = the DOS window like you would a 
normal Win32::GUI window, then I could just sub _DOSNAME_minimized like 
you would a normal Win32::GUI window?



Roger Mayfield





[perl-win32-gui-users] Disabling default action for LWIN/RWIN?

2006-04-06 Thread Steve Loughran

Hi all

Is there a way to disable the LWIN/RWIN default action of popping up the 
windows start menu? (and how about enabling them again afterwards?)


Any pointers would be helpful. Many thanks in advance.

Steve



Re: [perl-win32-gui-users] DOS Window minimized?

2006-04-06 Thread Roger Mayfield

Glenn Linderman wrote:

Console is the correct name for what you are calling a DOS window. 
That might help you find relevant documentation.


However, consoles are quite different in behavior than other windows, 
apparently even having their own process to handle them, and the 
message sequence is quite different than for other windows.


Minimized and hidden are, indeed, two different attributes of a 
window.  Seems like if you want to minimize to a tray icon you'd 
want to hide the console whether or not it had already been minimized.


There is Win32::GUI::Hide and Win32::GUI::Show, which, when passed the 
result of Win32::GUI::GetPerlWindow, will hide and show it, 
respectively.  I think it takes as many Shows as Hides to make a 
console reappear.


If IsVisible works on the console, I think you have a sufficient 
solution.  If not, show some code, preferably a complete but not quite 
working test application that can be run on anyone's machine, and 
describe a use case that fails.


I've already got the Win32::GUI::Hide and Win32::GUI::Show methods and 
they work great. That is not what I'm looking for. Okay here is a 
program that uses Hide and Show on a 'console' window:


#!usr/bin/perl

use strict;
use Win32::GUI;

# Get DOS handle
my ($DOS) = Win32::GUI::GetPerlWindow();

# Tray Icon
my $window = new Win32::GUI::Window;
my $systray_icon = $window-AddNotifyIcon( -name = _Systray, -id = 
1, -icon = new Win32::GUI::Icon('mypic.ico'), -tip = Test );


# Main Loop
while (1) {
   $window-DoEvents();
}

# Tray Icon Sub
sub _Systray_Click {
   if(Win32::GUI::IsVisible($DOS)) { Win32::GUI::Hide($DOS); }
   else { Win32::GUI::Show($DOS); }
}

This script uses an icon file, you'll have to provide one to play with 
it. Now, this works fine. When you click the tray icon, the console 
disappears, when you click it again, it reappears. What I want to do 
know is test whether the console window has been minimized so that I can 
then hide the window ie: minimize to tray.


if ($DOS = minimized) { Win32::GUI::Hide($DOS); }

Roger Mayfield



RE: [perl-win32-gui-users] DOS Window minimized?

2006-04-06 Thread Peter Eisengrein
 
 if ($DOS = minimized) { Win32::GUI::Hide($DOS); }
 

Try 

if ($DOS-IsIconic) { Win32::GUI::Hide($DOS); }



RE: [perl-win32-gui-users] DOS Window minimized?

2006-04-06 Thread Jason Brunette
 You are the man! That worked!  Now, can someone further explain what
an 
 Iconic window is? I would have never had thought that Iconic meant 
 minimized and if I did, I could have found this solution by googling 
 Iconic I'm sure.

In Windows 3.1 and earlier, running programs minimized to icons on the
desktop.

* Jason Brunette ([EMAIL PROTECTED])
* Excel.Net,Inc. - http://www.excel.net/
* (920) 452-0455 - Sheboygan/Plymouth area
* (888) 489-9995 - Other areas, toll-free 



[perl-win32-gui-users] Using Threads with Win::32 and Net::IRC

2006-04-06 Thread Roger Mayfield
Okay, I've almost got Win32::GUI working with Net::IRC using threads. 
I'm getting an error though and I have no idea what it means:


thread failed to start: DBD::SQLite::db table_info failed: handle 2 is 
owned by thread 2240bc not current thread 2270a2c (handles can't be 
shared between threads and your driver may need a CLONE method added) at 
D:\test.pl line 1262.


The database handle in question is in fact global and named in the 
beginning of my script. I would like to have access to this database as 
it contains information pertaining to both the GUI and the IRC 
connection. As you can see, my script is well over 1300 lines and it 
would be messy to post it all in an email (Not to mention, my coding is 
very messy since I'm quite new to Perl). Line 1262 is actually:


my $sth=$db-table_info();

In which I'm trying to test if a table in fact does exist and if not 
then create it. I call this sub many times from both threads and I've 
even tried creating two different subs, but the problem isn't with the 
sub, it's with the database handle that I've created globally before the 
sub-thread is created. Any ideas? ANYTHING is appreciated considering I 
have NO idea what the hell I'm doing, lol. Or should I try a different 
Mailing list?



Roger Mayfield



RE: [perl-win32-gui-users] Using Threads with Win::32 and Net::IRC

2006-04-06 Thread Lloyd, Steve
The only way I have got this to work is to open the database connection
in the thread.

Steve Lloyd
http://www.basgetti.com

 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Roger Mayfield
Sent: Thursday, April 06, 2006 2:23 PM
Cc: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] Using Threads with Win::32 and Net::IRC

Okay, I've almost got Win32::GUI working with Net::IRC using threads. 
I'm getting an error though and I have no idea what it means:

thread failed to start: DBD::SQLite::db table_info failed: handle 2 is 
owned by thread 2240bc not current thread 2270a2c (handles can't be 
shared between threads and your driver may need a CLONE method added) at

D:\test.pl line 1262.

The database handle in question is in fact global and named in the 
beginning of my script. I would like to have access to this database as 
it contains information pertaining to both the GUI and the IRC 
connection. As you can see, my script is well over 1300 lines and it 
would be messy to post it all in an email (Not to mention, my coding is 
very messy since I'm quite new to Perl). Line 1262 is actually:

my $sth=$db-table_info();

In which I'm trying to test if a table in fact does exist and if not 
then create it. I call this sub many times from both threads and I've 
even tried creating two different subs, but the problem isn't with the 
sub, it's with the database handle that I've created globally before the

sub-thread is created. Any ideas? ANYTHING is appreciated considering I 
have NO idea what the hell I'm doing, lol. Or should I try a different 
Mailing list?


Roger Mayfield


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

This email, and any files previous email messages included with it, may contain 
confidential and/or privileged material. If you are not the intended recipient 
please contact the sender and delete all copies.





RE: [perl-win32-gui-users] Using Threads with Win::32 and Net::IRC

2006-04-06 Thread Plum, Jason
Roger,

Steve is right. As a user of SQLite, I know that the DB handles are not
thread safe, and you will need to move the opening context into each of
the threads, not globally copying it. Keep in mind that there may be
certain delays in place if the 2 threads access the DB at the same time.
I would also suggest making _very_ sure you are using the latest SQLite
in your DBI/DBD.

I've got a program that runs 3 intercommunicating threads, but only one
of which accesses the DB at any given time, and only for short periods.
But, I know it can be done from multiple threads at once. Just be
careful. And, if possible, refactor code so that it runs only in one
thread.

Jason P.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Lloyd, Steve
Sent: Thursday, April 06, 2006 4:34 PM
To: Roger Mayfield
Cc: perl-win32-gui-users@lists.sourceforge.net
Subject: RE: [perl-win32-gui-users] Using Threads with Win::32 and
Net::IRC

The only way I have got this to work is to open the database connection
in the thread.

Steve Lloyd
http://www.basgetti.com

 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Roger Mayfield
Sent: Thursday, April 06, 2006 2:23 PM
Cc: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] Using Threads with Win::32 and Net::IRC

Okay, I've almost got Win32::GUI working with Net::IRC using threads. 
I'm getting an error though and I have no idea what it means:

thread failed to start: DBD::SQLite::db table_info failed: handle 2 is
owned by thread 2240bc not current thread 2270a2c (handles can't be
shared between threads and your driver may need a CLONE method added) at

D:\test.pl line 1262.

The database handle in question is in fact global and named in the
beginning of my script. I would like to have access to this database as
it contains information pertaining to both the GUI and the IRC
connection. As you can see, my script is well over 1300 lines and it
would be messy to post it all in an email (Not to mention, my coding is
very messy since I'm quite new to Perl). Line 1262 is actually:

my $sth=$db-table_info();

In which I'm trying to test if a table in fact does exist and if not
then create it. I call this sub many times from both threads and I've
even tried creating two different subs, but the problem isn't with the
sub, it's with the database handle that I've created globally before the

sub-thread is created. Any ideas? ANYTHING is appreciated considering I
have NO idea what the hell I'm doing, lol. Or should I try a different
Mailing list?


Roger Mayfield


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language that extends applications into web and mobile media. Attend the
live webcast and join the prime developer group breaking into this new
coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

This email, and any files previous email messages included with it, may
contain confidential and/or privileged material. If you are not the
intended recipient please contact the sender and delete all copies.




---
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language that extends applications into web and mobile media. Attend the
live webcast and join the prime developer group breaking into this new
coding territory!
http://sel.as-us.falkag.net/sel?cmd=kkid0944bid$1720dat1642
___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/



Re: [perl-win32-gui-users] Using Threads with Win::32 and Net::IRC

2006-04-06 Thread Roger Mayfield

Roger,

Steve is right. As a user of SQLite, I know that the DB handles are not
thread safe, and you will need to move the opening context into each of
the threads, not globally copying it. Keep in mind that there may be
certain delays in place if the 2 threads access the DB at the same time.
I would also suggest making _very_ sure you are using the latest SQLite
in your DBI/DBD.

I've got a program that runs 3 intercommunicating threads, but only one
of which accesses the DB at any given time, and only for short periods.
But, I know it can be done from multiple threads at once. Just be
careful. And, if possible, refactor code so that it runs only in one
thread.

Jason P.


-Original Message-

The only way I have got this to work is to open the database connection
in the thread.

Steve Lloyd
http://www.basgetti.com


Since both threads will be accessing the same database, would I need to
connect and then close the database handle every time I query it or can
the handle be left open? add as far as accessing the database, I will
only need to access it for short periods of time also. I do believe the
main thread actually only access one table within the database, whereas
the sub-thread is what requires the other tables, I could seperate the
tables into different databases, although I would rather have just the
one data.db file to transport with my script. I am not sure what the
latest version of SQLite. I am using ActiveState v5.8 Build 816 and I
installed the DBD::SQLite module using ppm and the ppm repository states
it is version 1.11, although I can't find a version any where else.

I have also seen a DBD::SQLite2 within the repository and I am wondering
how it is different from the original, I guess I'll have to research
that, but if anyone knows. Does SQLite2 support threading?

Roger Mayfield




[perl-win32-gui-users] sharing objects

2006-04-06 Thread Octavian Rasnita
Hi,

I am trying to create a program using Win32::GUI that uses more threads. A
few threads should connect to a server and download data permanently, and
other threads should updated some list views with that data

For doing this I need to use threads::shared and share some variables like
$Win and other variables like $ListView, but if I try to share them I get
errors like:

Invalid value for shared scalar at program.pl line 19.

Are there any examples of using threads with objects, references that could
help me learn how to use threads with Win32::GUI?

Thank you.

Teddy