Ok I Wrote a little prog that writes to the decktop DC I Want to know how to make the desktop refresh between writes and when I'm done. that way I'm not writeing on top of myself. and it dosen't leave a mess. i have tried update window but that just refreshes from the DC evidentally lol. I tried InvalidateRect also but that didnt work either.

The only way I could think of would be to emulate the f5 key being pressed but that dosent work for me I know it should so It's something to do with my implimentation

INVOKE GetDesktopWindow
mov hDesktop,eax
INVOKE SendMessage,hDesktop,100h,74h,0000h


100h==WM_KEYDOWN 74h==VK_F5 I changed to the actual values trying to make it work lol. oh yea and the 0000h just to make absolute certain that the lparam was NULL for sure.

:confused:
Thanks Dio.
Posted on 2002-04-28 11:20:42 by dionysus
Maybe loop through all of the visible windows on the desktop and UpdateWindow() on them.
Posted on 2002-04-28 11:34:06 by iblis
Oh yeah and try using keybd_event () instead of sending a WM_KEYDOWN message to the Desktop window. ;)
Posted on 2002-04-28 11:41:32 by iblis
If you refresh the desktop, isn't your window going to get a paint request?
Posted on 2002-04-28 11:50:36 by bitRAKE
If you refresh the desktop, isn't your window going to get a paint request?

I think he dosen't have a window and he is painting directly onto the desktops dc.

dionysus:
If you want to display something on the desktop maybe you should create a window?
Posted on 2002-04-28 12:18:19 by Kudos
Convert it to ASM and try this:



'
' Refresh the desktop
'
Call SHGetSpecialFolderLocationD(Me.hwnd, CSIDL_DESKTOP, lpil)
Call SHChangeNotify(SHCNE_ALLEVENTS, SHCNF_IDLIST, lpil, 0)


Too busy to do it now for ya.
Posted on 2002-04-28 13:01:46 by bazik
Bakiz. yea I considered useing those but they require that I include a DLL that i have neither the DLL or the LIB for.

also the ketbd_event is just used to send a WM_KEYDOWN and WM_KEYUP message to the apropriate place (foreground window) so I wanted to send the message myself because I didn't wan't to shift focus to the desktop. But since my way isn't working I tried yours (how nice of me) rofl, no joy.

From now on I will just Create a window. But now I want to know why something thats assimple as hiting F5 is so dificult to do from a program. (I really still think my way OUGHT to work.)

lol if I dont get it soon I think ill just CreateCompatibleDC TempDesktop and keep a copy of the origional there to use whenever I want :P

any way, thanks for your help.

Dio :alright:
Posted on 2002-04-28 21:34:54 by dionysus
Well I just got into work this morning to look this up and the only thing I found was the API RedrawWindow. This should work for what you are trying to do if I understand correctly.

invoke RedrawWindow hWnd, lprcUpdate, hrgnUpdate, afuRedraw

hwnd

Identifies the window to be redrawn. If this parameter is NULL, the desktop window is updated.

lprcUpdate

Points to a RECT structure containing the coordinates of the update rectangle. This parameter is ignored if the hrgnUpdate parameter identifies a region.

hrgnUpdate

Identifies the update region. If both the hrgnUpdate and lprcUpdate parameters are NULL, the entire client area is added to the update region.

afuRedraw

Specifies one or more redraw flags. This parameter can be a combination of flags that invalidate or validate a window, control repainting, and control which windows are affected by RedrawWindow.
Posted on 2002-04-29 08:33:14 by Graebel