1

I came across an application a few days ago which I find immensely useful - http://www.ntwind.com/software/sticky-previews.html

Basically what it does is - you can mark a section of the screen and it creates a preview window for that section and keeps it on top of all other windows. I want to make a similar thing, for 3 reasons: 1. I can't use third party software in my office PC, 2. I can't afford it, 3. It will be an immense pleasure to create something useful, which I can share with the community.

So, I was wondering, what would be the way to go about it. Use dot net (probably VB.net) make a frameless window set it to stay on top create a context menu to exit

this is child's play.. the main thing is how do I get the preview of the screen. Any help is appreciated.

Thank you

inquizitive
  • 622
  • 4
  • 21

1 Answers1

0

What this application (probably) does is capture a part of the selected window and copy that to its own window at regular intervals. There are two ways to capture such an image. One is from the screen and one is from a window. .NET supports copying from the screen, but you probably want the second. See How can I save a screenshot directly to a file in Windows? for information on how to accomplish this.

Community
  • 1
  • 1
Pieter van Ginkel
  • 29,160
  • 8
  • 71
  • 111
  • I think the screen method should work fine. I don't need the ability to move the window and keep previewing. So, I guess Graphics.copyFromScreen() method can be used. But http://stackoverflow.com/questions/875563/graphics-copyfromscreen-returns-black-screen thread says it won't work for videos? – inquizitive Dec 29 '11 at 06:41
  • The problem with `CopyFromScreen` is that the window needs to be visible and on top, because the visible portion of the screen is copied. This also gives... interesting... effects when you are copying the application itself. If that works for you, you should be fine. And concerning videos: if I'm correct, it would work for video in Vista and Windows 7, but you could experiment with this. – Pieter van Ginkel Dec 29 '11 at 06:46
  • I get it, so in effect, it is useless for me, as keeping the window in foreground defeats the entire purpose. Now then, I'll need to use the other method, i.e. capture a window. Also, the link you mentioned contains resources on taking screenshots, which again need the window to be on top! Is there a way so that the application just shows from the window where it was bound, regardless of what is in the foreground. Effectively creating a window (literally) through the current app. – inquizitive Dec 29 '11 at 06:54
  • Yep. That's why I included the link with how to capture a window directly. I am interested though whether it works for minimized applications because I guess they may not be repainted. If in Windows 7 you watch the thumb preview on the taskbar, you see that the thumbnail doesn't get updated. Maybe a `SendMessage(handle, WM_PAINT, ..., ...)` solves that, but I'm not sure. – Pieter van Ginkel Dec 29 '11 at 06:56
  • We can do without minimizing the window, right? Almost like creating the windows 7 taskbar thumbnail itself. So when the window is in background (but not minimized) we can preview what's happening with the window. Actually exactly like the Windows 7 taskbar thumbnail. – inquizitive Dec 29 '11 at 07:00
  • Hi, I found a resource for windows 7 taskbar thingy, I don't know whether it is useful or not, but If someone can decode something from this http://msdn.microsoft.com/en-us/magazine/dd942846.aspx – inquizitive Dec 29 '11 at 07:09