Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1531 Posts in 287 Topics- by 2163 Members - Latest Member: fujianvnewyorkbEnglishs

May 20, 2012, 02:43:18 am
WinFlip BoardGeneralGeneralhow do you capture hidden/minimized windows
Pages: [1]   Go Down
Print
Author Topic: how do you capture hidden/minimized windows  (Read 4457 times)
0 Members and 2 Guests are viewing this topic.
CaptainChaos
Newbie
*
Offline Offline

Gender: Male
Posts: 5



View Profile
« on: June 12, 2008, 07:59:06 am »

I really tried everything, but i cant capture hidden/minimized windows with PrintWindow. Could you please tell me how you do it?
Logged
amos
Global Moderator
Full Member
*****
Offline Offline

Gender: Male
Posts: 223


- Amos


View Profile
« Reply #1 on: June 12, 2008, 13:06:23 pm »

Welcome to the board, CaptainChaos!

I've flagged this question for Koji, the developer, to look at, so hopefully you'll get some help soon Smiley

- Amos
Logged

The best things in life are free: Pidgin | Firefox | GIMP | OpenOffice | PortableApps | MediaMonkey
Roman
Global Moderator
Sr. Member
*****
Offline Offline

Gender: Male
Posts: 303


Roman


View Profile
« Reply #2 on: June 12, 2008, 13:33:20 pm »

Hi,

Amos, let's move this post to here.

CaptainChaos, for now, feel free to go to MSDN and maybe ask your question there as well.
Logged

CaptainChaos
Newbie
*
Offline Offline

Gender: Male
Posts: 5



View Profile
« Reply #3 on: June 12, 2008, 13:53:43 pm »

Thanks for reply, but the "trick" with WM_PRINT and PrintWindow i already know. Wink
What i dont know is how to capture the minimized windows. If a window is minimized and i capture it with PrintWindow i only get the window caption. i hoped you guys could tell me what calls i have to do.
do i have to set up a hook to intercept minimize events or something like that?
Logged
koji
Developer
Administrator
Full Member
*****
Offline Offline

Gender: Male
Posts: 216


WinFlip Developer


View Profile WWW
« Reply #4 on: June 12, 2008, 14:17:39 pm »

Hi CaptainChaos Smiley

Welcome to WinFlip Messageboard.

Quote
What i dont know is how to capture the minimized windows. If a window is minimized and i capture it with PrintWindow i only get the window caption. i hoped you guys could tell me what calls i have to do.
do i have to set up a hook to intercept minimize events or something like that?

It's not so big problem.
What you have to do is,

ShowWindow(hWndTarget, SW_RESTORE);

Then capture window as you mentioned,

ShowWindow(hWndTarget, SW_MINIMIZE);

That's it.

But the window resize animation obstructs the quick action.
Therefore, you should disable it.

ANIMATIONINFO AnimationDisable={sizeof(ANIMATIONINFO), 0};
SystemParametersInfo(SPI_SETANIMATION, sizeof(ANIMATIONINFO), &AnimationDisable, 0);

and enable it after capturing a window.

ANIMATIONINFO AnimationEnable={sizeof(ANIMATIONINFO), 1};
SystemParametersInfo(SPI_SETANIMATION, sizeof(ANIMATIONINFO), &AnimationEnable, 0);

You have to check the resize animation is enabled or disabled before proceed the code above. Somecases the resize animation is already disabled. At that case you should not change the setting.
use SPI_GETANIMATION to check it.

Good luck. Smiley
Koji
Logged

Roman
Global Moderator
Sr. Member
*****
Offline Offline

Gender: Male
Posts: 303


Roman


View Profile
« Reply #5 on: June 12, 2008, 14:21:36 pm »

The window caption is all you can get of a minimized window. If you want a min. win. image, save its image to memory when the window is still max. Then retrieve it from the memory.
Logged

CaptainChaos
Newbie
*
Offline Offline

Gender: Male
Posts: 5



View Profile
« Reply #6 on: June 12, 2008, 14:25:09 pm »

wow! thanks koji!! Cheesy
Logged
koji
Developer
Administrator
Full Member
*****
Offline Offline

Gender: Male
Posts: 216


WinFlip Developer


View Profile WWW
« Reply #7 on: June 12, 2008, 14:27:36 pm »

Hi Roman

Quote
The window caption is all you can get of a minimized window. If you want a min. win. image, save its image to memory when the window is still max. Then retrieve it from the memory.

Yeah, It's one of way to solve this problem.
Just I replied my way. There are more than one way to do it.

Cheers,
Koji

@amos
Thank you for your quick follow-up comment.
Logged

CaptainChaos
Newbie
*
Offline Offline

Gender: Male
Posts: 5



View Profile
« Reply #8 on: June 12, 2008, 17:02:50 pm »

hmmm... i tried it but it doesn't seem to be as fast as yours...

//before enumeration
manager->ensureAnimationDisabled();

//in enumeration
bool minimize = manager->showWindow(hwnd);
PrintWindow(hwnd, hdcMem, 0);
if(minimize)
   manager->minimizeWindow(hwnd);

//after enumeration
manager->ensureAnimationEnabled();

i shortly see every minimized window flicker...
is there any other trick?

PS: If you're interested for what i need it, you know beryl, i want to do the desktop-cube with window-drag support.
Logged
koji
Developer
Administrator
Full Member
*****
Offline Offline

Gender: Male
Posts: 216


WinFlip Developer


View Profile WWW
« Reply #9 on: June 13, 2008, 04:05:12 am »

Hi Captain Smiley

Quote
hmmm... i tried it but it doesn't seem to be as fast as yours...

Could you check which part is slow please?
I just wanna make sure what is the problem.

and only if you may, Send me the source code via the email. I'll check it for you. (but may be not today. I'm bit busy at moment)

Quote
i want to do the desktop-cube with window-drag support.
You mean beryl + window drag support?

Cheers,
Koji
Logged

CaptainChaos
Newbie
*
Offline Offline

Gender: Male
Posts: 5



View Profile
« Reply #10 on: June 13, 2008, 09:42:06 am »

ok. the part which is slow is the capturing part itself.
i made a small example. its fliping like yours Wink
the other code is too complicated.

i now set the window which shall be captured full transparent before showing and hiding, so any flickering can be seen.

Cheers CC

* screenflip.zip (7.38 KB - downloaded 224 times.)
Logged
koji
Developer
Administrator
Full Member
*****
Offline Offline

Gender: Male
Posts: 216


WinFlip Developer


View Profile WWW
« Reply #11 on: June 14, 2008, 11:31:14 am »

Hi Captain Smiley

How's it going?

I downloaded and checked your source code.
The attached is missing some of files to compile it.
So, just I read the main source code "screenflip.cpp" only.

I think "void ScreenFlip::initProcList()" is not bad.
How many seconds does it require to capture 10 of minimized windows?(@XGA env)
WinFlip v.0.50 takes almost one second at my note PC env.(Core2 Duo U7500 @1.06GHz, 2GB RAM, Mobile Intel(R) 965 Express Chipset Family)
Therefore, If your logic takes more than one second, I can say It's slow. but I can't compile your source code. so, I don't know how to evaluate yours.
If you want me check it, send me the source code again with missing files.

note:
WinFlip takes all open windows screenshot at startup. but doesn't take screenshot at the beginning of flip action. Therefore If you are thinking about the beginning of flip action, the problem is not that logic.

Cheers,
Koji
Logged

Pages: [1]   Go Up
Print
Jump to:  

Theme orange-lt created by panic
web tracker