SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Plugin development, plugin requests, support for third party plugins, ...
CircleDock
Plugin Developer
Posts: 77
Joined: 13.06.2010 11:52:02
Contact:

SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby CircleDock » 08.10.2010 02:36:20

Patrick,

I'm happy to report that our new Dexpot-aware screen background (aka Wallpaper) changer is working flawlessly (I'll provide a little more detail at the end of this post). However, I have two questions for you.

Is there any way I can pass the full path name of an image file, together with its relevant virtual desktop number so that the (Dexpot) Previews, including SevenDex, show the correct backgrounds for each defined Desktop BEFORE a switch is made to another Desktop and Dexpot updates itself? This is desirable for several reasons - though admittedly mostly cosmetic.

And secondly, does DEX_SWITCHREQUEST have the same wParam and lParam as DEX_SWITCHING?

The program is, as I say, fully Dexpot-aware and compatible although it will run quite happily if Dexpot is not installed or running. It permits users to define one or more images for each Desktop which can be shown in either a random or sequential sequence. It is, if you like, a set of Vista/Windows 7 Slideshows but with the added advantage that it also works under Windows XP. The images for each background automatically change at 30 minute intervals (though I may allow users to specify the interval) - provided, of course, that there is more than one image for any given Desktop. Images can be either user-provided or the program can search XP/Vista/Win7 Theme files and allow those images to be added also - or a mixture of both. For user-friendliness, images are picked using their thumbnails rather than by file name. The user can also set the image order (useful if images are to be used sequentially). It will be released as part of the new Circle Dock package.



Mark

selden
Beta Tester
Posts: 177
Joined: 26.09.2010 18:59:42
Location: usa

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby selden » 08.10.2010 04:29:43

Mark,

As a potential user of your plugin, I would greatly appreciate a settable update interval. Sometimes I like to run through the slideshow quickly, and other times I'd prefer that the backgrounds change very slowly. It might be reasonable to provide the same intervals as are available for Win7's Themes.
Selden

CircleDock
Plugin Developer
Posts: 77
Joined: 13.06.2010 11:52:02
Contact:

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby CircleDock » 08.10.2010 10:59:59

selden wrote:Mark,

As a potential user of your plugin, I would greatly appreciate a settable update interval. Sometimes I like to run through the slideshow quickly, and other times I'd prefer that the backgrounds change very slowly. It might be reasonable to provide the same intervals as are available for Win7's Themes.

All the Themes I've looked at - albeit a by no means exhaustive investigation - suggests that the Microsoft "standard" is 30 minutes per image. In fact, it's a bit more precise than that: images change on exactly the half-hour and full hour and my plug-in currently emulates that behaviour. I am minded to add one change per hour and four changes per hour - would that meet your requirements?




Mark

selden
Beta Tester
Posts: 177
Joined: 26.09.2010 18:59:42
Location: usa

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby selden » 08.10.2010 16:57:28

Mark,

The change rate I select depends on what I'm trying to accomplish.

Sometimes I want to flip through them as fast as possible -- which is 10 seconds per image in the Personalize/ Desktop Background menu (I wish it were a little faster) -- to verify that backgrounds are properly aligned with one another.

Some of my backgrounds are animated -- parts of them seem to appear and disappear -- using a simple form of "page flipping." 1-10 minutes usually are appropriate intervals for them.

p.s.
I just realized that what I wrote was ambiguous.
My "animations" are static background pictures. They aren't realtime animations. The animation is provided by the change from one background image to the next. In other words, each frame is viewed for 1-10 minutes; the movement seems to happen when (and because) the background image is changed.
Last edited by selden on 09.10.2010 18:23:40, edited 1 time in total.
Selden

User avatar
sgtevmckay
Moderator
Posts: 192
Joined: 30.04.2010 23:17:17
Location: Santa Fe, NM
Contact:

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby sgtevmckay » 08.10.2010 21:31:51

An additional thought here would be to have a VD switch trigger a Background Image Change.
This way, any time you switch to VD screen "X" the image will not be the same twice when you land on VD screen "X"

I would only suggest this as an "Option" as this particular element would not be appreciated by everyone, but for someone like myself...hmm
It would create for an even more challenging customization with Circle Dock -TNG and Rainmeter (nod)
Image

User avatar
Patrick
Developer
Posts: 7380
Joined: 04.03.2003 14:51:26

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby Patrick » 09.10.2010 17:48:26

:dex:

CircleDock wrote:I'm happy to report that our new Dexpot-aware screen background (aka Wallpaper) changer is working flawlessly.

That is great news. :D

Is there any way I can pass the full path name of an image file, together with its relevant virtual desktop number so that the (Dexpot) Previews, including SevenDex, show the correct backgrounds for each defined Desktop BEFORE a switch is made to another Desktop and Dexpot updates itself?

No.

And secondly, does DEX_SWITCHREQUEST have the same wParam and lParam as DEX_SWITCHING?

Yes.

CircleDock
Plugin Developer
Posts: 77
Joined: 13.06.2010 11:52:02
Contact:

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby CircleDock » 09.10.2010 19:24:29

Patrick wrote:
Is there any way I can pass the full path name of an image file, together with its relevant virtual desktop number so that the (Dexpot) Previews, including SevenDex, show the correct backgrounds for each defined Desktop BEFORE a switch is made to another Desktop and Dexpot updates itself?

No.

Oh ... that's annoying. Can I make that a request for inclusion in the API please? Ok, I know I can request this, but is there any chance of it being included? :D

And secondly, does DEX_SWITCHREQUEST have the same wParam and lParam as DEX_SWITCHING?

Yes.

Ok, great!



Mark

User avatar
Patrick
Developer
Posts: 7380
Joined: 04.03.2003 14:51:26

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby Patrick » 09.10.2010 22:19:40

CircleDock wrote:Oh ... that's annoying. Can I make that a request for inclusion in the API please?

Hm. The preview images used in SevenDex and other places (at least for desktops already visited) are static screenshots. So you're asking me to swap out the wallpaper in a screenshot programmatically or find a way to generate the previews dynamically. Let me think about it.

Another way around this problem would be to only change the wallpaper on the active desktop: either change the wallpaper every thirty minutes on the desktop which happens to be active at that time and leave all other desktops untouched, or keep track of how much time the user has spent on each desktop and then change the wallpaper when thirty minutes have accumulated for the active desktop.

While we're at it, throwing around feature requests... I agree with selden, offering the same update intervals as Windows seems like a reasonable idea. Also, it would be really cool if we could have a blending transition when changing from one wallpaper to the next.

CircleDock
Plugin Developer
Posts: 77
Joined: 13.06.2010 11:52:02
Contact:

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby CircleDock » 12.10.2010 09:04:52

Patrick wrote:
CircleDock wrote:Oh ... that's annoying. Can I make that a request for inclusion in the API please?

Hm. The preview images used in SevenDex and other places (at least for desktops already visited) are static screenshots. So you're asking me to swap out the wallpaper in a screenshot programmatically or find a way to generate the previews dynamically. Let me think about it.

I just knew you'd like that challenge! :D

Another way around this problem would be to only change the wallpaper on the active desktop: either change the wallpaper every thirty minutes on the desktop which happens to be active at that time and leave all other desktops untouched, or keep track of how much time the user has spent on each desktop and then change the wallpaper when thirty minutes have accumulated for the active desktop.

That - in bold text - is basically how it's done. But the (cosmetic) problem is that all the previews will show the same background as the active desktop unless and until there is a switch of desktops. So it would be nice if I could somehow tell you what the images will be for the other desktops.

While we're at it, throwing around feature requests... I agree with selden, offering the same update intervals as Windows seems like a reasonable idea. Also, it would be really cool if we could have a blending transition when changing from one wallpaper to the next.

There are variable time intervals now but not as many as Windows 7 offers. I really don't see the point of offering an interval of less than (say) 5 minutes: in practice, such intervals would rarely ever be used and simply increase the amount of time both my plug-in and Dexpot would be busy.

As for a blend transition, yes it would be nice for the timed interval changes but you certainly would not want that when you switch desktops. Right now, the background changes immediately the desktop is switched and is seemless; having that done by a blend transition would look out of place I feel.

But implementing a blend transition for timed intervals is something I plan (for a future release) once I figure out exactly how Microsoft does it - it certainly isn't by the method they (kind of) document using SystemParametersInfo. I suspect they're using a low-level - and probably undocumented - method call to DirectX to manipulate hDC(0) which is the Desktop Background.

As Dexpot itself can change Desktop Background images, I think it's rather necessary to create a new Windows message:

DEX_BACKGROUNDSWITCHER where LParam = 0 to instruct Dexpot not to change backgrounds and non-zero to allow it to change backgrounds.

Otherwise there will be a conflict!



Mark

User avatar
Patrick
Developer
Posts: 7380
Joined: 04.03.2003 14:51:26

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby Patrick » 12.10.2010 22:33:46

CircleDock wrote:But the (cosmetic) problem is that all the previews will show the same background as the active desktop unless and until there is a switch of desktops.

Oh, so you're talking about the preview shown for a desktop before that desktop is visited for the first time?

There are variable time intervals now but not as many as Windows 7 offers. I really don't see the point of offering an interval of less than (say) 5 minutes: in practice, such intervals would rarely ever be used and simply increase the amount of time both my plug-in and Dexpot would be busy.

Personally, I agree. The 10 seconds option is just crazy. But then again, users are known to do crazy things. We recently had this guy with over 500 icons on his desktop...

As for a blend transition, yes it would be nice for the timed interval changes but you certainly would not want that when you switch desktops.

Agreed.

But implementing a blend transition for timed intervals is something I plan (for a future release) once I figure out exactly how Microsoft does it - it certainly isn't by the method they (kind of) document using SystemParametersInfo. I suspect they're using a low-level - and probably undocumented - method call to DirectX to manipulate hDC(0) which is the Desktop Background.

Yeah, it's more than SystemParametersInfo. Their method actually caused various strange bugs in Dexpot where some things stopped working after the first wallpaper change. As far as I know, it works something like this:

  • Create a new top-level window (Explorer uses window class "WorkerW")
  • Put the window on top of the "Program Manager" (usually at the bottom of the Z-order).
  • Find the window with class "SHELLDLL_DefView" containing the desktop listview, which starts out as a child of the "Program Manager" window, and set your new window as its parent.
  • Draw the alpha blending animation on your window's background (may involve additional magic).
  • (If you're Explorer, do not return the desktop listview back to the "Program Manager", in order to confuse other applications.)

As Dexpot itself can change Desktop Background images, I think it's rather necessary to create a new Windows message

How about a new flag DEX_SWITCH_NOBACKGROUNDCHANGE that you would return when handling DEX_SWITCHREQUEST?

CircleDock
Plugin Developer
Posts: 77
Joined: 13.06.2010 11:52:02
Contact:

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby CircleDock » 13.10.2010 07:01:05

Patrick wrote:
CircleDock wrote:But the (cosmetic) problem is that all the previews will show the same background as the active desktop unless and until there is a switch of desktops.

Oh, so you're talking about the preview shown for a desktop before that desktop is visited for the first time?

Yes!!

There are variable time intervals now but not as many as Windows 7 offers. I really don't see the point of offering an interval of less than (say) 5 minutes: in practice, such intervals would rarely ever be used and simply increase the amount of time both my plug-in and Dexpot would be busy.

Personally, I agree. The 10 seconds option is just crazy. But then again, users are known to do crazy things. We recently had this guy with over 500 icons on his desktop...

Obviously he isn't a Circle Dock user .... :D

  • Draw the alpha blending animation on your window's background (may involve additional magic).
  • (If you're Explorer, do not return the desktop listview back to the "Program Manager", in order to confuse other applications.)

The "additional magic" could well involve creating a WMV file of the transition - even though DreamScene is supposed to be disabled on Windows 7; that might account for why the quickest time between background changes is 10 seconds: anything shorter than that might impact performance too much. And as for the second point above, well that's just typical Microsoft arrogance :D.

As Dexpot itself can change Desktop Background images, I think it's rather necessary to create a new Windows message

How about a new flag DEX_SWITCH_NOBACKGROUNDCHANGE that you would return when handling DEX_SWITCHREQUEST?

That will do very nicely, thank you! I take it the mask will be 0x0008?



Mark

selden
Beta Tester
Posts: 177
Joined: 26.09.2010 18:59:42
Location: usa

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby selden » 13.10.2010 14:34:09

I don't know if it helps, but there's a page on msdn.microsoft.com which discusses image transitions using MFC with DirectX.
http://msdn.microsoft.com/en-us/magazine/cc163698.aspx
Selden

User avatar
Patrick
Developer
Posts: 7380
Joined: 04.03.2003 14:51:26

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby Patrick » 13.10.2010 20:41:10

CircleDock wrote:
Patrick wrote:Oh, so you're talking about the preview shown for a desktop before that desktop is visited for the first time?

Yes!!

Well, that makes the problem a lot simpler. :cool:

The "additional magic" could well involve creating a WMV file of the transition - even though DreamScene is supposed to be disabled on Windows 7; that might account for why the quickest time between background changes is 10 seconds: anything shorter than that might impact performance too much.

I took a look with the debugger. Apparently, the transition is a series of calls to UpdateLayeredWindow - no WMV or explicit DirectX involved. That also makes it very similar to the animation used by Dexpot when opening the "Window Catalog". Getting it as seamless and flicker-free as the original might still need some magic though.

How about a new flag DEX_SWITCH_NOBACKGROUNDCHANGE that you would return when handling DEX_SWITCHREQUEST?

That will do very nicely, thank you! I take it the mask will be 0x0008?

Yup.

CircleDock
Plugin Developer
Posts: 77
Joined: 13.06.2010 11:52:02
Contact:

Re: SDK Question: Updating SevenDex and DEX_SWITCHREQUEST

Postby CircleDock » 14.10.2010 01:41:22

Patrick wrote:
CircleDock wrote:
Patrick wrote:Oh, so you're talking about the preview shown for a desktop before that desktop is visited for the first time?

Yes!!

Well, that makes the problem a lot simpler. :cool:

I don't know whether this would help but I could pass you a Bitmap object, so my call would be something like:

Code: Select all

SendNotifyMessage(DexpotHandle, DEX_NEWSCREENSHOT, (IntPtr)ForDesktopNumber, (IntPtr) BitmapObject);

if that'd work, then you could have the Bitmap either full-size or I could resize it for you and pass you one of a size that you specify. That might save you some work as I have to create the bitmaps in any event.

The "additional magic" could well involve creating a WMV file of the transition - even though DreamScene is supposed to be disabled on Windows 7; that might account for why the quickest time between background changes is 10 seconds: anything shorter than that might impact performance too much.

I took a look with the debugger. Apparently, the transition is a series of calls to UpdateLayeredWindow - no WMV or explicit DirectX involved. That also makes it very similar to the animation used by Dexpot when opening the "Window Catalog". Getting it as seamless and flicker-free as the original might still need some magic though.

Yes, I found an article about that - after much searching. The problem that article's author found was that he could not set the Explorer SysList window's parent to his layered window and thus the icons were obscured.

With the beta version I'm currently running, build 1391, I don't notice an animation when the Window Catalog opens. But I do get a brief flash as the new monochrome background is painted :?.

How about a new flag DEX_SWITCH_NOBACKGROUNDCHANGE that you would return when handling DEX_SWITCHREQUEST?

That will do very nicely, thank you! I take it the mask will be 0x0008?

Yup.
[/quote]
Ok, it's in and ready :)


Mark


Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 2 guests