Coincidentally, I've been working on a similar problem and was very interested
to read this. My latest project involves using threads to perform lengthy 
tasks, 
but showing a progress bar with a 'Cancel' button on the main (or child) 
window. 
The problem is that the sharing of blessed variables is not yet supported in 
threads::shared, so you have to share the handle and use the 
Win32::GUI::Show($win) syntax. That's OK for one window, but it gets old and 
ugly when you want to access many controls on the window. Hence, I would also be
interested to hear of a way to convert a handle into a Win32::GUI object. Are 
there any other uses for this? Is it worth adding as a feature request?

Glenn Munroe
------------------- reply ---------------
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED], perl-win32-gui-users@lists.sourceforge.net
> Subject: RE: [perl-win32-gui-users] Attaching to a window created by some 
> other
 application
> Date: 2005-10-06 11:16:59
> ----------------------------------
> Hummm replying to my own post:)
> 
> >>windows it manipulates. Is it possible to attach to a window/control
> >>created by some other application? Say I have a handle of a main window of
> >>Windows calculator. How do I turn it into Win::GUI object?
> >
> >Interesting question. As a quick/dirty answer, yes it could be possible. 
> >The basic problem is that when Win::GUI object's are destroyed the 
> >underlying window handle is also "destroyed".This could be solved by having 
> >some sort of flag to say if Win::GUI actually owns the object or not.
> 
> Ok - the above is true when we're using objects via method calls but most of 
> the internals can also be called as functions. For example:
> 
> $win->Show(); #shows the window
> 
> but we could also call it this way:
> 
> Win32::GUI::Show($win);
> 
> Where $win is a Win32::GUI object OR the handle...So, if you've got a handle 
> for some other app, then it should just work...
> 
> Hope that makes some sense.
> 
> Cheers,
> 
> jez.
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> 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/
> 


Reply via email to