voxel
asked on
Refreshing the desktop
I have an application that set the work area of the desktop (Windows API). So I would like to redraw all opened windows.
Did anybody know how to do that ?
Thanks
Gustavo
Did anybody know how to do that ?
Thanks
Gustavo
I'm not sure what you want. Can you please say it again a bit more detailed?
ASKER
Edited text of question.
Redraw or resize?
To enumerate all windows use "EnumWindows". To resize the windows use "SetWindowPos". To refresh them use "InvalidateRect".
To enumerate all windows use "EnumWindows". To resize the windows use "SetWindowPos". To refresh them use "InvalidateRect".
ASKER
and how I use the EnumWindows function ?
hi,
here a cpuple of waus to refresh desktop:
SendMessage(FindWindow('Pr ogman', 'Program Manager'), WM_COMMAND, 106597,
0);
or:
procedure RefreshDesktop;
var
c : cardinal;
begin
c:=FindWindowEx(FindWindow Ex(FindWin dow('Progm an','Progr am Manager'),0,'SHELLDLL_DefV iew',''),0 ,'SysListV iew32','') ;
PostMessage(c,WM_KEYDOWN,V K_F5,0); PostMessage(c,WM_KEYUP,VK_ F5,1 shl 31);
end;
here a cpuple of waus to refresh desktop:
SendMessage(FindWindow('Pr
0);
or:
procedure RefreshDesktop;
var
c : cardinal;
begin
c:=FindWindowEx(FindWindow
PostMessage(c,WM_KEYDOWN,V
end;
ASKER
I think you didn't understand my question.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I still didn't find how to resize windows to fit in the new work area set by my application.
But i'm giving you the points.
thanks
But i'm giving you the points.
thanks
ASKER
Do you know how to resize all windows to fit the new work area (desktop) set by my application ?
Well, for each window do this:
(1) Call "GetWindowRect(window)" to get the window position/size.
(2) See, whether this rectangle fits in your work area. If not, change the rectangle, so that it does fit. Then call "SetWindowPos(window, ...)" to realize the new rectangle.
(1) Call "GetWindowRect(window)" to get the window position/size.
(2) See, whether this rectangle fits in your work area. If not, change the rectangle, so that it does fit. Then call "SetWindowPos(window, ...)" to realize the new rectangle.