Re: [perl-win32-gui-users] communication between GUI scripts

2002-07-09 Thread Kevin . ADM-Gibbs
Peter,

Win32::Pipe allows you to use named pipes for interprocess communication.
One process has to act as a server, any others as clients.  You might want
to have a look at the PerlIPC doc as well.

Here's a very simple Win32::Pipe server:

  use Win32::Pipe;

  $p = new Win32::Pipe("MyPipe"); # create pipe
  $res = $p->Connect();   # wait for a process to connect

  while ($data = $p->Read() ) {
print "RECEIVED: $data\n";
  }

  $p->Disconnect();  # disconnect
  $p->Close();# close pipe

and a client

  use Win32::Pipe;

  my $p = new Win32::Pipe(".\\pipe\\MyPipe"); # client must yous
\\server\pipe\pipename syntax

  for ( my $i = 0; $i <=10 ; $i++) {
$p->Write("\$i = $i\n");  # could read from the pipe as well
sleep 1;  # without a delay all the
writes go across at once
  }

  $p->Close();

The problem with this is that while waiting for a connection your server
script won't be able to
respond to user input.  This is going to be a problem you hit with most IPC
methods.

Win32::GUI does give you access to SendMessage in the Win32 api so it may
be possible
to use that.  I have a vague recollection that some of the messages were
user definable but
wouldn't swear to this.  You could look on MSDN to find out.

SendMessage details are at

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesfunctions/sendmessage.asp

Good luck.

Kev.



|-+>
| |   "Straub, Peter (Peter)"  |
| |   <[EMAIL PROTECTED]>|
| |   Sent by: |
| |   [EMAIL PROTECTED]|
| |   ceforge.net  |
| ||
| ||
| |   08/07/2002 17:08 |
| ||
|-+>
  
>--|
  | 
 |
  |   To:   perl-win32-gui-users@lists.sourceforge.net  
 |
  |   cc:   
 |
  |   Subject:  [perl-win32-gui-users] communication between GUI scripts
 |
  
>--|




Hi all,

does anyone know of a reliable way for two Win32::GUI
scripts to communicate with each other? They run as
separated processes.

My idea was to simply write data to a file and send a
notification of some kind to the other process
(concurrent accesses not being an issue here).

What came to my mind in the first place was to use
'PostMessage'. Using Win32::GuiTest I am able to retrieve
the adressee's window handle, but what message should
I post?
As far as I know there is no support for user defined
messages (at least I have no idea how to retrieve one).

I also tried Win32::GuiTest's SendKeys function to notify
a dummy window in the other application by simulating
keystrokes. This gradually turned out to be a real horror
because the receiving control must be the foreground
window in order for SendKeys to succeed and every box
popping up at the wrong time spoils the whole thing...

Could you please help with better ideas how to
accomplish this?

TIA and Cheers,
  Peter


---
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users






[perl-win32-gui-users] Win32::GUI::Class() ??

2002-07-09 Thread Steven Swenson

Hi all,
	I was curious if anyone has any examples of how to use the 
Win32::GUI::Class function to create new class of windows?

Would this allow the use of new events?  or combination of existing classes?

--Steve




RE: [perl-win32-gui-users] Win32::GUI::Class() ??

2002-07-09 Thread Piske, Harald
I use it to get some more mouse-related events. The most useful class for
that is the RichEdit class.

new Win32::GUI::Class
(
-name => 'PoorEdit',
-widget => 'RichEdit',
-extends => 'RichEdit',
);
$Main->AddRichEdit(
  -name => "Rich",
-class => "PoorEdit",
...
that gives you Rich_LButtonDown, Rich_LButtonUp, Rich_RButtonDown,
Rich_RButtonUp, and Rich_KeyPress. Maybe even Rich_MouseMove, I'm not sure.

You can safely say 
-widget => 'Button',
-extends => 'RichEdit',
to use this class on a button - however, I think that will kill the
3D-behavior (the button looking like being pushed inwards by a mouse-click
and popping back upon release)

Sometimes you will get _Anonymous events for a widget with the message ID as
first parameter - that may be exploited, but you won't get all the "missing"
events on all the widgets. I also don't remember what other classes are
there - I got this wisdom from reading the GUI.xs source code (look for
"MsgLoop", especially "RichEditMsgLoop" and go from there).

Note, this applies to Win32-GUI Version 0.0.558 - from V.665, there is a
totally new event model (conveniently called "new event model", NEM) which
renders the classes inoperative. With this NEM, you can get any widget to
invoke subs for a lot of events, so in fact that's a lot better - I hear.
Didn't play around with it myself yet.

Have fun,
Harald

> -Original Message-
> From: Steven Swenson [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 09, 2002 15:20
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] Win32::GUI::Class() ??
> 
> 
> Hi all,
>   I was curious if anyone has any examples of how to use the 
> Win32::GUI::Class function to create new class of windows?
> Would this allow the use of new events?  or combination of 
> existing classes?
> 
>  --Steve
> 
> 
> 
> ---
> This sf.net email is sponsored by:ThinkGeek
> Stuff, things, and much much more.
> http://thinkgeek.com/sf
> ___
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> 



RE: [perl-win32-gui-users] Win32::GUI::Class() ??

2002-07-09 Thread Rogers, John
Howdy,
Ive used Class to set Icons and cursers.
EG.

$I = new Win32::GUI::Icon("icon.ico");
$C=new Win32::GUI::Bitmap("no.cur", 2);
$WinClass = new Win32::GUI::Class(
-name => "johns-windows", 
-cursor => $C,
-icon => $I,);


Windows created with -class => $WinClass  will Have the same Icon and curser

> -Original Message-
> From: Steven Swenson [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 10 July 2002 8:20 AM
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] Win32::GUI::Class() ??
> 
> 
> Hi all,
>   I was curious if anyone has any examples of how to use the 
> Win32::GUI::Class function to create new class of windows?
> Would this allow the use of new events?  or combination of 
> existing classes?
> 
>  --Steve
> 
> 
> 
> ---
> This sf.net email is sponsored by:ThinkGeek
> Stuff, things, and much much more.
> http://thinkgeek.com/sf
> ___
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> 


## 
Disclaimer 

If this e-mail has been sent to you in error, please notify 
Océ-Australia Limited immediately and delete this e-mail from 
your system. 

Any views expressed in this e-mail are those of the individual 
sender and may not necessarily reflect the views of 
Océ-Australia Limited. 
##