Thanks,
David
Sounds like you're trying to fix a bug in your program by changing the
user's environment preferences. What's the bug?
--
Rob
Don't know how, but you can check Vista Battery Saver's source code.
http://blogs.microsoft.co.il/blogs/tamir/archive/2007/05/14/Vista-Batter
y-Saver.aspx
--
Primoz
Thanks for your interest, Rob. This is the problem as described by the
user:
--------------------------------------------------------------
Let me explain the best I can. Under correct operation, when the mouse is
over the image area you get a reading of temperature, location and time on
the bottom. When you move the mouse away from the image area that
correctly changes to 'click to make temperature units °F'.
With Vista when the mouse is over the image there is no reading but the
menu bar at the top flashes very fast. When you move the mouse off the
image the flashing stops and then the temperature, location and time
appears ..... but for what pixel I am not sure.
Also (and clearly tied up with this) if the mouse location is in the image
area whilst the file is loading it takes ages to load with the menu bar
again flashing.
--------------------------------------------------------------
This is the program:
http://www.david-taylor.myby.co.uk/software/hrpt.htm
and it works fine in VMware (which doesn't support Aero). It's written in
Delphi 5, and doesn't support XP themes. I suggested trying compatibility
to Windows 2000 but that doesn't seem to help. Eventually, I will move
the program to Delphi 2007, but a temporary fix would be appreciated by at
least two users.
Cheers,
David
Primoz,
Thanks for the pointer - perhaps the answer is hidden somewhere in the
lines of source code in the different modules.....
Cheers,
David
If you figure it out please post the code - I, and I suspect many others, will be fascinated.
Roy Lambert
Roy, you might want to check out here:
http://www.aeroxp.org/board/lofiversion/index.php?t6985.html
Can't vouch for it working, but at least it gives the DLL and the calls.
Cheers,
David
Unfortunatly I've never gotten it to work and when I asked about it
here no one responded.
Here is what I can tell you:
What you want to look at is the Desktop Window Manager (DWMAPI).
Marko Binic has made a translated API unit, I'll place it in the
attachments group, and the function you want to look, according to
M$, is the DwmSetWindowAttribute call.
As I've stated I've never been able to get this call to work.
I finally gave up on it and changed my program to work differently on
Vista so that I could move on.
If any one can make this work I'd really like to know how you did it.
Ryan.
Thanks for that, Ryan. Maybe it's the DwmEnableComposition procedure?
I'll look forward to the attchment appearing....ah, there it is now!
Thanks,
David
Yes, works a treat:
_____________________________________________
procedure AeroSetEnable (enable: boolean);
const
DWM_EC_DISABLECOMPOSITION = 0;
DWM_EC_ENABLECOMPOSITION = 1;
var
ok: integer;
begin
if DWMlibrary <> 0 then
begin
if @DwmEnableComposition <> nil then
begin
if enable
then DwmEnableComposition (DWM_EC_ENABLECOMPOSITION)
else DwmEnableComposition (DWM_EC_DISABLECOMPOSITION);
end;
end;
end;
initialization
DWMlibrary := LoadLibrary ('DWMAPI.dll');
if DWMlibrary <> 0 then
begin
DwmEnableComposition := GetProcAddress (DWMLibrary,
'DwmEnableComposition');
end;
_____________________________________________
You get the idea....
Cheers,
David
> David J Taylor wrote:
> []
> > Thanks for that, Ryan. Maybe it's the DwmEnableComposition
> > procedure? I'll look forward to the attchment appearing....ah,
> > there it is now!
> >
> > Thanks,
> > David
>
> Yes, works a treat:
Great! On behalf of everybody that is still struggling with Vista -
thanks for doing the research.
I've repacked your solution as two functions (DSiAeroEnable and
DSiAeroDisable) in the open sourced DSiWin32 library
(http://gp.17slon.com/gp/dsiwin32.htm) and added anoter one that checks
whether Aero is enabled (DSiIsAeroEnabled).
--
Primoz