🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9839

Re: Add shadow to a form

#9839
From: Mario Sernicola
Date: Thu, 10 Jun 2004 19:44
66 lines
2942 bytes
Hi Remy,

I'd like to toggle form shadow at runtime, in the OnShow method, reading a
ini file.

How can I do this? Can you help me writing the right code? I think I have to
write in my header file:

//---------------------------------

virtual void __fastcall TForm1::CreateParams(TCreateParams &Params);

//--------------------------

 and in the cpp file:

void __fastcall TForm1::CreateParams(TCreateParams &Params)
{
   const CS_DROPSHADOW = 0x00020000;

   TForm::CreateParams(Params);

   Params.Style = Params.Style | CS_DROPSHADOW; //<---- is it right???
}
//--------------------------------------------------------------------------
-

How can restore in my WinXp system, form shadows?

How can I toggle shadows in my forms by code?

Thanks

Mario Sernicola

"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> ha scritto nel
messaggio news:40c8a7f1$1@newsgroups.borland.com...
>
> "Mario Sernicola" <mariosernicola@nospam.libero.it> wrote in message
> news:40c88f63$1@newsgroups.borland.com...
>
> >    RecreateWnd();
>
> By calling that, you are going to lose your custom settings to the class
> info.  You should be setting CS_DROPSHADOW in the CreateParams() method
> instead so that it is always applied whenever the window is created for
any
> reason (there are other reasons for a window to be re-created during its
> lifetime).
>
> > Now the problem is that I've executed this function:
> >
> > ...
> > SystemParametersInfo(0x1025, false, NULL, 0);
> > ...
> >
> > and now the shadow don't appear even if I reboot my computer!
>
> Well, for one thing, you *disabled* the system's ability to display drop
> shadows.  Second, which OS are you actually using to begin with?
> CS_DROPSHADOW and SPI_SETDROPSHADOW are only available on Win2K and XP.
>
>
> Gambit
>
>
Technical Details
Message-ID: <40c8ba1d@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40c6e830@newsgroups.borland.com> <40c84615$1@newsgroups.borland.com> <40c88f63$1@newsgroups.borland.com> <40c8a7f1$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,700c24ec51a7d447
X-Google-Attributes: gid10cc67,public
Reply-To: "Mario Sernicola" <mariosernicola@nospam.libero.it>
From: "Mario Sernicola" <mariosernicola@nospam.libero.it>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40c6e830@newsgroups.borland.com> <40c84615$1@newsgroups.borland.com> <40c88f63$1@newsgroups.borland.com> <40c8a7f1$1@newsgroups.borland.com>
Subject: Re: Add shadow to a form
Date: Thu, 10 Jun 2004 21:44:34 +0200
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 80.181.137.60
Message-ID: <40c8ba1d@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1086896669 80.181.137.60 (10 Jun 2004 12:44:29 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail