in reply to Win32: Can I interact with windows I didn't create?
Non-owned windowsEvery window, even windows not created by your Perl script, can be referenced by Win32::GUI; all you need to know is its "handle", a numerical value that identifies that window. Many functions in the Win32::GUI package return such handles, as for example:
This value can then be passed to any function that requires a window object; but of course, not being an object, you can't call it as a method:$First = Win32::GUI::GetForegroundWindow();Should you need to know the numerical handle of a window created by Win32::GUI, it is stored in its -handle key (this is the value that almost all function really use):Win32::GUI::Hide($First); # correct $First->Hide(); # wrongprint "Window handle is $Window->{-handle} \n";
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32: Can I interact with windows I didn't create?
by BobFishel (Acolyte) on Jan 16, 2009 at 20:58 UTC | |
by Corion (Patriarch) on Jan 16, 2009 at 21:03 UTC | |
by BobFishel (Acolyte) on Jan 17, 2009 at 18:39 UTC | |
by Corion (Patriarch) on Jan 18, 2009 at 08:57 UTC |