Had another idea; you will have to search for it though.
I have forgotten, but there is a Windows API call to get the handle of each window on the desktop. By doing this, you will be able to refresh each one.
Sorry I misconstrued your requirement - thought you meant the desktop itself.
Cheers,
Alistair
 
 
Have just checked on some info I have here maybe either/or helps:
 
The Windows 95 Desktop is overlayed with a ListView component.
You simply need to get a handle to the ListView. Example:
 function GetDesktopListViewHandle: THandle;
 var
   S: String;
 begin
 Result := FindWindow('ProgMan', nil);
 Result := GetWindow(Result, GW_CHILD);
 Result := GetWindow(Result, GW_CHILD);
 SetLength(S, 40);
 GetClassName(Result, PChar(S), 39);
 if PChar(S) <> 'SysListView32' then Result := 0;
 end;
 
Once you have the handle, you can use the list view-related API
functions in the CommCtrl unit to manipulate the desktop. See
the LVM_xxxx messages in the Win32 online help.
 
For example the following line of code:
 
SendMessage(GetDesktopListViewHandle,LVM_ALIGN,LVA_ALIGNLEFT,0);
 
will align the desktop icons to the left side of the Windows 95 desktop.
 
I would run with the following even though you havent made a WinInI change:
 
SendMessage (the Windows API function) takes a number of parameters. First is the window handle;
HWND_BROADCAST is correct for that. Next comes the message, WM_WININICHANGE. The last two parameters
are the wParam and lParam (word parameter and long parameter) for the message. For this particular message, the
wParam must be 0, and the lParam is the address of a string containing the name of the section that the changes were in. If
lParam is NIL (zero), it means the windows receiving this message shoudl check ALL sections for changes, but that's slow;
don't send 0 unless you've made changes in many sections.
 
SO it might go like this:
 
VAR
  S : ARRAY[0..40] OF Char;
  ...
  StrCopy(S, 'Desktop');
  SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, LongInt(@S));

Reply via email to