how to draw a persistent image?

Hi,

I have a PDA running under Windows Mobile 5 and I'm working with Visual Studio 2005.

I want to draw an image anywhere on the screen, ie. even outside of the application's window, in a way that makes it 'persistent' (unless I want otherwise).

Let me explain.
Normally when a window pops up (presumably external to my application) at the position of the image, the window covers the image so that it disappears. But I want to prevent that from happening and make sure that the image will always stay on top whatever happens.

Can someone tell me how to do that
Thanks.


Answer this question

how to draw a persistent image?

  • Geoff Dean

    It does not work like that. I suggest that you reead up on the Windows programming mode (event-driven) and Window Manager (books like Programming Windows come to mind). Only windows (window objects) are capable of being notified that they need repainting and processing such notifications. The desktop window is also a window. On the PC platform it is possible to subclass desktop window and perform custom painting. You might be able to do the same on a device, but it is much easier to create your own fullscreen window (hence SHFullScreen advice) and paint whatever you need.

  • Jim D.

    You can do something similar with kiosk mode:

    http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/search group=microsoft.public.dotnet.framework.compactframework&q=kiosk+mode&qt_g=1&searchnow=Search+this+group



  • BillRP

    Thanks.
    The only alternative for me is using the SHFullScreen function that I already found earlier. I'll look further into this although I noticed nothing that really suits.
    Maybe there is a way of detecting a pixel that just changed state(or rather that is going to change)
    that would be notified by an interrupt.
    Or else have a full screen invisible window that would send a message like WM_PAINT.

  • JL3

    The problem with SHFullScreen is that I want the window to be invisible: the only thing I want to be displayed is the image. I also want mouse events to get through the window, i.e. to affect the system as if the application window were not present. I don't see a way of doing that with SHFullScreen.

  • ChrisD

    I found nothing about SHFullscreen that would help me.

    Actually I already know how to draw on the screen : I draw in the device context of the screen that I get by GetDC(NULL). The problem comes with erasing the image. The only solution I found is to find all the windows that overlap the rectangle containing the image to erase and add the rectangle to their dirty section. This method is not satisfying because it produces flickering and
    takes too much cpu time (using WindowFromPoint).

    Is there another lighter and neater way to deal with this

  • how to draw a persistent image?