Tech Off Thread

18 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Expose in Vista - Winpose

Back to Forum: Tech Off
  • User profile image
    ElucidWeb

    So I have finished my prototype of mimicking Expose in Windows Vista and I must say it looks very nice. 

    It has a TON of work that I need to do still such as maintaining constraints, variable sizing based on window focus, etc. but it at least proves that this is feasible.

    Alot of my work is based on the work from Sven at http://channel9.msdn.com/ShowPost.aspx?PostID=202208

    So I would like to give him credit for his job well done, I have extended his code even further to give me what I needed.

    So yeah right now no hotkey support but if you just create a shortcut on your desktop and assign it a hotkey it will work just fine!

    http://www.elucidweb.com/files/winpose.zip

    Ok anyways, hope you like...It will evolve from here if I get good feedback I assure you!  Keep in mind this is a prototype so most of this code will be redone and refactored for the final product.

    Thanks,
    Eric

  • User profile image
    W3bbo

    We demand screenshots!

  • User profile image
    ElucidWeb

    LOL, its not much to look at right now... I havent done much work on eyecandy.  But I posted this cause I mentioned it a while back and today I woke up and coded it.  So if you like the idea I will keep the progress moving forward and any help on how to get it more visually pleasing would be greatly appreciated.

    Thanks,
    Eric

  • User profile image
    Storm​Chaser46

    So far it's cool, but it needs a few things changed.

    1) Don't minimize every windows and then maximize just the selected window... instead just bring the selected window into focus
    2) Make the window previews much bigger
    3) Make the window previews more opaque; they are fairly difficult to see
    4) Add some kind of rollover effect to the window previews such as making the window grow or make the preview opaque...
    5) Add a preview of the desktop like Flip3D has so you can go straight to the desktop

  • User profile image
    ElucidWeb

    StormChaser46 wrote:
    So far it's cool, but it needs a few things changed.

    1) Don't minimize every windows and then maximize just the selected window... instead just bring the selected window into focus
    2) Make the window previews much bigger
    3) Make the window previews more opaque; they are fairly difficult to see
    4) Add some kind of rollover effect to the window previews such as making the window grow or make the preview opaque...
    5) Add a preview of the desktop like Flip3D has so you can go straight to the desktop


    Yeah I have been looking at how OSX does it and doing it on my IMAC over and over and over til my eyes bleed over and man theres is pretty.  I have a serious problem when it comes to the way I am doing it though.  I am using thumbnails and they have live previews, thats a huge issue for me and I really need to figure out how to manipulate the windows themselves.  I also want this to work in Windows XP so I think I am going to end up manipulating the windows themselves somehow but we will see...

    You want the desktop view?  I actually filtered that out cause I had it in there but wasnt sure if it should be in there or not...

    I am still tossing things up in the air right now, I would really like to have live previews.  Anyone got any code ideas on how I can accomplish live previews (lets put XP to the side right now) in Vista?  Sorta how Flip3D does theirs?  I would love to be able to expose (no pun) the API that Flip3D uses but I think its DirectX since it doesnt work on non Aero desktops...Would love some opinions/help on that.

    Also if anyone would like to aid in development or be available for me to hit you up with questions I have MSN at xaol_suxx@hotmail.com


    Thanks,
    Eric

  • User profile image
    ElucidWeb

    Ok been reading up and it appears that the DWM API is being used incorrectly for live previews and that DWM will display its own Thumbnail container for you by using DwmRegisterThumbnail and DwmUpdateThumbnailProperties

    This API set they have for DWM seems rather lack luster, I really hope they add more for the release.  Would like to see some more control over windows...

  • User profile image
    Sven Groot
  • User profile image
    ElucidWeb

    Well thats interesting because I am using alot of your code and I dont really see how creating the controls dynamically would cause the Live Previews to no longer work...

    Edit: Ok I figured it out, if the window is minimized you dont get live previews.  Even the taskbar previews dont work properly for Video if the window is mimized, this has got to be a bug.

  • User profile image
    Sven Groot

    ElucidWeb wrote:
    Edit: Ok I figured it out, if the window is minimized you dont get live previews.  Even the taskbar previews dont work properly for Video if the window is mimized, this has got to be a bug.

    No it's not. It's the way Windows has worked since forever. Minimised windows do not get repainted. They have an effective size of 0x0 (if the application should query it while the window is minimised), and don't get any WM_PAINT messages. This behaviour isn't going to change.

  • User profile image
    ElucidWeb

    Actually Sven with Composition turned on in Vista windows dont get WM_PAINT messages anymore, they dont need to handle repaint events.  Thats what the DWM is suppose to handle.  But when it comes to Thumbnails being exposed, they should be live whether they are visible or not, it sorta defeats the purpose of exposing it through an API.  While it makes obvious sense to not draw an object if its not visible, the thumbnails should not reflect this behavior, it would give a much richer experience in fact if they were able to preview the contents while minimized.

    BTW you can read about how the Desktop Window Manager in Vista works under the hood here: http://blogs.msdn.com/greg_schechter/archive/2006/03/05/544314.aspx

    But I digress, I cant figure out the way Flip3D is shuffling the windows around.  On the blogs they claim its using DWMThumbnail API but its strange because when you use Flip3D the open windows go invisible and when you select one it animates back into place which may only be some trick of the eye stuff where they animate the thumbnail back into the original location of the window and then they make the window visible again, not sure.  Very confusing, wish Microsoft would provide the code for Flip3D!

    -Eric

  • User profile image
    ElucidWeb

    In case anyone was wondering I answered my own question to why Minimized windows dont have Live Previews and its on Greg Schechter's Blog

    To Quote:

    "Minimized windows present a special issue.  Typically when an application receives a minimization, the surface that it's asked to paint is a nominal size, like 130x30, just enough for shades of the non-client area.  If the application updates the system memory surface at this point, and we continue our copying to the video memory surface, then any surface we may have had available to us for Flip3D or for thumbnail rendering is suddenly gone.  Instead of doing this, we maintain the video memory surface in its last known state, and thus those "secondary window representations" are far more useful when windows are minimized.  "

    It an interesting read, his blog has the most useful information about DWM out of anywhere else I have ever read on the web.

    Eric

  • User profile image
    Sven Groot

    ElucidWeb wrote:
    Actually Sven with Composition turned on in Vista windows dont get WM_PAINT messages anymore, they dont need to handle repaint events.

    Not entirely true. Windows won't get a WM_PAINT message anymore when they become visible from behind another window, but they will still get a WM_PAINT message when the window is first show, when the window is resized and when InvalidateRect is explicitly called.

    Probably I was wrong, and the window does receive a WM_PAINT after it's minimised (because it's a resize operation), but like Greg's post said only for the 130x30 or something size, so the DWM is right not to use the result of that paint operation for the thumbnail (it can happen though that such a small thumbnail is created, for instance when a window was minimised when the DWM was started).

  • User profile image
    mukiex

    Sorry to bother, but all I seem to get from this program is a darkened desktop shot. I'm using Vista RC1 on a FireGL card with Aero support, but I don't seem to be having any luck getting winpose to work. Assuming there's no planned updates for the small app Wink , does anyone know of any alternatives on Vista that handle this functionality? =3

  • User profile image
    littleguru

    I'm getting this error in Vista RC1:

    PInvokeStackImbalance was detected
    Message: A call to PInvoke function 'Winpose!Winpose.Helpers.NativeMethods::DwmRegisterThumbnail' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

    Seems like something has changed from beta 2 to rc 1.

  • User profile image
    Rossj

    littleguru wrote:
    I'm getting this error in Vista RC1:

    PInvokeStackImbalance was detected
    Message: A call to PInvoke function 'Winpose!Winpose.Helpers.NativeMethods::DwmRegisterThumbnail' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

    Seems like something has changed from beta 2 to rc 1.


    Probably the number or type of arguments in one of the 'native' calls.

  • User profile image
    littleguru

    Rossj wrote:
    
    littleguru wrote: I'm getting this error in Vista RC1:

    PInvokeStackImbalance was detected
    Message: A call to PInvoke function 'Winpose!Winpose.Helpers.NativeMethods::DwmRegisterThumbnail' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

    Seems like something has changed from beta 2 to rc 1.


    Probably the number or type of arguments in one of the 'native' calls.


    Yeah. I was looking in the Microsoft documentation - but I couldn't find where any changes... Strange error. I haven't got such an error before. Mostly when trying to do a pinvoke with invalid arguments did not return any error or throw an exception: EntryPointNotFound (something like that).

  • User profile image
    MasterPi

    I don't get that error in RC1.

    All I get is a darkened desktop shot as mentioned before by a poster. Sad


    EDIT: It works in XP, just darkens the background before throwing an error.  Interesting. Expressionless

  • User profile image
    ElucidWeb

    Hey guys just wanted to let you know I have updated this application  and will be releasing a new version of it very soon.  Just a heads up...

    TTYL,
    Eric

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.