Re: [DUG]: Repainting the desktop

1999-02-23 Thread phillipm

Can't do that, I only have a handle to a device context, not a window
(although I tried it anyway and it didn't work - smae with passing 0 as the
handle)



From: "Alex Kouznetsov" [EMAIL PROTECTED] AT tawa on 24/02/99 12:07
  ZE12

To:   Multiple recipients of list delphi [EMAIL PROTECTED] AT
  tawa@kauripo@CCMAIL
cc:(bcc: Phillip Middlemiss/NZ Forest Research Institute/NZ)
Subject:  Re: [DUG]:  Repainting the desktop




You may try to add UpdateWindow after invalidating (just a thought).

Hi all,

I have a routine that grabs the device context of the Screen (I know I
shouldn't really) and draws to it. When I am finished I need to refresh
the whole screen to it's original state. Does anyone know how to do such a
thing? I've tried various combinations of invalidating the whole rectangle
etc with no joy.

Thanks.

Phil Middlemiss
[EMAIL PROTECTED]


--
-
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz



---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz







---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz



Re: [DUG]: Repainting the desktop

1999-02-23 Thread phillipm

Not quite good enough.

That will refresh the desktop background, but any other windows that are
visible do not refresh.

I think I will give up and just use a form's canvas.

Phil.



From: "Alistair George" [EMAIL PROTECTED] AT tawa on 24/02/99 11:34 ZE12

To:   Multiple recipients of list delphi [EMAIL PROTECTED] AT
  tawa@kauripo@CCMAIL
cc:(bcc: Phillip Middlemiss/NZ Forest Research Institute/NZ)
Subject:  Re: [DUG]:  Repainting the desktop





Is this what you want:
  SendMessage(FindWindow('Progman', 'Program Manager'),
  WM_COMMAND,
  $A065,
  0);



I have a routine that grabs the device context of the Screen (I know I
shouldn't really) and draws to it. When I am finished I need to refresh
the whole screen to it's original state. Does anyone know how to do such a
thing? I've tried various combinations of invalidating the whole rectangle
etc with no joy.

Thanks.

Phil Middlemiss
[EMAIL PROTECTED]


--
-
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz


---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz







---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz



Re: [DUG]: Repainting the desktop

1999-02-23 Thread phillipm

Thanks for the info,

I will probably go with the send a general broadcast message rather than
finding all the windows. That's the sort of thing I was looking for but
couldn't remember the message I would need.

Thanks,

Phil.







From: "Alistair George" [EMAIL PROTECTED] AT tawa on 24/02/99 14:34 ZE12

To:   Multiple recipients of list delphi [EMAIL PROTECTED] AT
  tawa@kauripo@CCMAIL
cc:(bcc: Phillip Middlemiss/NZ Forest Research Institute/NZ)
Subject:  [DUG]:  Repainting the desktop




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_ 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));





!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"
HTML
HEAD

META content=text/html;charset=iso-8859-1 http-equiv=Content-Type
META content='"MSHTML 4.72.3110.7"' name=GENERATOR
/HEAD
BODY
DIVFONT face=Arial size=2Had another idea; you will have to search for
it
though./FONT/DIV
DIVFONT face=Arial size=2I 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./FONT/DIV
DIVFONT face=Arial size=2Sorry I misconstrued your requirement -
thought you

meant the desktop itself./FONT/DIV
DIVFONT face=Arial size=2Cheers,/FONT/DIV
DIVFONT face=Arial size=2Alistair/FONT/DIV
DIVFONT face=Arial size=2/FONTnbsp;/DIV
DIVFONT face=Arial size=2/FONTnbsp;/DIV
DIVFONT face=Arial size=2Have just checked on some info I have here
maybe
either/or helps:/FONT/DIV
DIVFONT face=Arial size=2/FONTnbsp;/DIV
DIVFONT color=#80 face=Arial size=2The Windows 95 Desktop is
overlayed with a ListView component.BRYou simply need to get a handle to
the ListView. Example:BRnbsp;function GetDesktopListViewHandle:
THandle;BRnbsp;varBRnbsp;nbsp; S:
String;BRnbsp;beginBRnbsp;Result := FindWindow('ProgMan',
nil);BRnbsp;Result := GetWindow(Result, GW_CHILD);BRnbsp;Result :=
GetWindow(Result, GW_CHILD);BRnbsp;SetLength(S,

40);BRnbsp;GetClassName(Result, PChar(S), 39);BRnbsp;if PChar(S)
lt;gt; 'SysListView32' then Result := 0;BRnbsp;end;BRnbsp;BROnce
you have the handle, you can use the list view-related APIBRfunctions in
the CommCtrl unit to manipulate the desktop. SeeBRthe LVM_ messages
in the Win32 online help. BRnbsp;BRFor example the following line of
code:BRnbsp;BRSendMessage(GetDesktopListViewHandle,LVM_ALIGN,LVA_ALIGN
LEFT,
0);BRnbsp;BRwill
align the desktop icons to the left side of the Windows 95
desktop./FONT/DIV DIVFONT color=#80 face=Arial
size=2/FONTnbsp;/DIV DIVFONT color=#80 face=Arial size=2FONT
color=#00I would run with the following even though you havent made a
WinInI change:/FONT/FONT/DIV DIVFONT color=#80 face=Arial
size=2FONT
color=#00/FONT/FONTnbsp;/DIV
DIVFONT color=#80 face=Arial size=2FONT color=#ffSendMessage
(the Windows API function) takes a number of parameters. First is the
window handle; BRHWND_BROADCAST is correct for that. Next comes the
message, WM_WININICHANGE.

The last two parameters BRare the wParam and lParam (word parameter and
long parameter) for the message. For this particular message, the
BRwParam must be 0, and the 

RE: [DUG]: Repainting the desktop

1999-02-23 Thread Dennis Chuah


Phillip,

It looks like you are trying to refresh all top-level windows on the
desktop.  To do that, you will need to loop through all the top-level
windows (use GetWindow) and invalidate them.

Dennis.


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
 Behalf Of [EMAIL PROTECTED]
 Sent: Wednesday, 24 February, 1999 14:35
 To: Multiple recipients of list delphi
 Subject: Re: [DUG]: Repainting the desktop


 Not quite good enough.

 That will refresh the desktop background, but any other windows that are
 visible do not refresh.

 I think I will give up and just use a form's canvas.

 Phil.



 From: "Alistair George" [EMAIL PROTECTED] AT tawa on 24/02/99 11:34 ZE12

 To:   Multiple recipients of list delphi [EMAIL PROTECTED] AT
   tawa@kauripo@CCMAIL
 cc:(bcc: Phillip Middlemiss/NZ Forest Research Institute/NZ)
 Subject:  Re: [DUG]:  Repainting the desktop





 Is this what you want:
   SendMessage(FindWindow('Progman', 'Program Manager'),
   WM_COMMAND,
   $A065,
   0);



 I have a routine that grabs the device context of the Screen (I know I
 shouldn't really) and draws to it. When I am finished I need to refresh
 the whole screen to it's original state. Does anyone know how to
 do such a
 thing? I've tried various combinations of invalidating the whole
 rectangle
 etc with no joy.
 
 Thanks.
 
 Phil Middlemiss
 [EMAIL PROTECTED]
 
 
 -
 -
 -
 New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
   Website: http://www.delphi.org.nz
 

 --
 -
 New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
   Website: http://www.delphi.org.nz







 --
 -
 New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
   Website: http://www.delphi.org.nz



---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz