I wrote a screen capture program, as you may have seen. It consists of a dialog with a tranparent background. When I capture an image, there will be a window behind my screen capture dialog (the one being captured from).
When I click capture I would like my program to discover the name of the window behind it. This is so I can set focus to it later to capture the Http address. How could I do this.
My thought was screen capture a separate file with the entire screen. But is there a way to get text from a bmp file?
Any idea is welcome.
Thanks in advance.
More thought: I'm thinking I'm a user with several windows open. When I use this capture utility, it needs to be smart enough to know which window it captured from.
Screen Capture Help Needed (NEW)
Moderators: Dorian (MJT support), JRL
Screen Capture Help Needed (NEW)
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
What if you just tell your script to press alt tab which should then go to the window directly behind your current window and then just grab window name?
So something like this
Technically alt tab switches between the two most recent windows so this should bring the window directly behind your transparent window into focus.
It's low tech but hopefully will still achieve what you're looking for.
Josh
So something like this
Code: Select all
//your code here that grabs the screen shot
press alt
press tab
release alt
GetActiveWindow>windowtitle,xvar,yvar,width,height
mdl>The window behind your current window is %windowtitle%
It's low tech but hopefully will still achieve what you're looking for.
Josh
That's a very good idea. Thanks sarver311.
I never or very rarely use shortcut keys. So that didn't even come to mind.
I realized later, after posting earlier, that I didn't explain that FindImage wouldn't work because the main program is a menu of online games(That's the capture). The image is an image of the splash screen, which usually changes or moves. So a match would be unlikely. Or problematic at best. I say this because someone is bound to point it out.
But I really like your idea, sarver311. Thanks.
I never or very rarely use shortcut keys. So that didn't even come to mind.
I realized later, after posting earlier, that I didn't explain that FindImage wouldn't work because the main program is a menu of online games(That's the capture). The image is an image of the splash screen, which usually changes or moves. So a match would be unlikely. Or problematic at best. I say this because someone is bound to point it out.
But I really like your idea, sarver311. Thanks.
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!