Re: how can I programmatically reapply the desktop settings
I am still new to this, but does this look correct?
BOOL WINAPI RedrawWindow( HWND hwnd, const RECT *rect, HRGN hrgn, UINT flags )
{
BOOL ret;
if (!hwnd) hwnd = GetDesktopWindow();
/* check if the window or its parents are visible/not minimized */
if (!WIN_IsWindowDrawable( hwnd, !(flags & RDW_FRAME) )) return TRUE;
/* process pending events and messages before painting */
... if (flags & RDW_UPDATENOW)
MsgWaitForMultipleObjects( 0, NULL, FALSE, 0, QS_ALLINPUT );
if (TRACE_ON(win))
{
if (hrgn)
{
RECT r;
GetRgnBox( hrgn, &r );
TRACE( "%p region %p box %s ", hwnd, hrgn, wine_dbgstr_rect(&r) );
}
else if (rect)
TRACE( "%p rect %s ", hwnd, wine_dbgstr_rect(rect) );
else
TRACE( "%p whole window ", hwnd );
dump_rdw_flags(flags);
}
if (rect && !hrgn)
{
ret = redraw_window_rects( hwnd, flags, rect, 1 );
}
else if (!hrgn)
{
ret = redraw_window_rects( hwnd, flags, NULL, 0 );
}
else /* need to build a list of the region rectangles */
{
DWORD size;
RGNDATA *data = NULL;
if (!(size = GetRegionData( hrgn, 0, NULL ))) return FALSE;
if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE;
GetRegionData( hrgn, size, data );
ret = redraw_window_rects( hwnd, flags, (RECT *)data->Buffer,
data->rdh.nCount );
HeapFree( GetProcessHeap(), 0, data );
}
if (flags & RDW_UPDATENOW) update_now( hwnd, flags );
else if (flags & RDW_ERASENOW) erase_now( hwnd, flags );
return ret;
}
"Tom Serface" wrote:
If I were you I'd try to figure out why your application is affecting the
desktop at all, but you could just do a RedrawWindow() call on the desktop
window GetDesktopWindow(). I don't know if that would reapply the settings,
but it would cause it to redraw the icons and background.
Tom
"To Old To . . ." <ToOldTo@discussions.microsoft.com> wrote in message
news:E3D1B641-23D5-4B6F-BF3F-444C9E447F4F@microsoft.com...
When I exit my application, the desktop background is grayed out. If I go
to
properties > desktop and hit apply the desktop is back. How can I
programmatically reapply the desktop settings when my program exits?