Solved

style property of TWndClass

Posted on 2002-05-02
5
375 Views
Last Modified: 2008-03-17
Hi there,

I use regular mdi child forms in my program. I create these forms by using Application.Createform. Now I want to set the style property of the TWndClass for these mdi child forms like this:

style := CS_HREDRAW or CS_VREDRAW or CS_OWNDC;

But as far as I know, we only use TWndClass in Win32 applications. How do I set this style property in VCL application???

Bye,
Jeroen
0
Comment
Question by:jccommandeur
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6987783
SetWindowLong(Handle, GWL_STYLE, CS_HREDRAW or CS_VREDRAW or CS_OWNDC);
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6987784
put it after OnCreate... or perhaps in OnShow? forgot which one, hehehe :)
0
 
LVL 8

Accepted Solution

by:
TOndrej earned 100 total points
ID: 6988496
You can simply override CreateParams in your MDI child forms:

type
  TMyMDIChildForm = class(TForm)
  ...
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  end;

procedure TMyMDIChildForm.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  with Params do
    WindowClass.style := CS_HREDRAW or CS_VREDRAW or CS_OWNDC;
end;

HTH
TOndrej
0
 

Author Comment

by:jccommandeur
ID: 6989536
Thanks, that was indeed what I was looking for. Do I need to register the class also?

Jeroen
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 6989639
You don't have to register the class, VCL does it for you.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now