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
In reply to Re: Win32: Can I interact with windows I didn't create?
by CountZero
in thread Win32: Can I interact with windows I didn't create?
by BobFishel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |