Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to avoid flicker when moving or sizing a MDI child form (2) Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
25-Oct-02
Category
Others
Language
Delphi 2.x
Views
121
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius

I have a MDI application which maximizes the client forms as they are created. On 
Win9x I can stop the initial flash of the MDI child form being created by using 
LockWindowUpdate(Handle). However on Win XP this code doesn't work as predicted. 
The form updating is turned off, but the client form still draws its outline 
briefly in the MDI client space. So, does anyone know how I can get round this on 
Win XP?

Answer:

1   { ...}
2   TForm1 = class(TForm)
3   private
4     fLockClientUpdateCount: Integer;
5   public
6     constructor Create(aOwner: TComponent); override;
7     procedure LockClientUpdate;
8     procedure UnlockClientUpdate;
9   end;
10  
11  { ... }
12  
13  constructor TForm1.Create(aOwner: TComponent);
14  begin
15    inherited Create(aOwner);
16    fLockClientUpdateCount := 0;
17  end;
18  
19  procedure TForm1.LockClientUpdate;
20  begin
21    if fLockClientUpdateCount = 0 then
22      SendMessage(ClientHandle, WM_SETREDRAW, 0, 0);
23    Inc(fLockClientUpdateCount);
24  end;
25  
26  procedure TForm1.UnlockClientUpdate;
27  begin
28    Dec(fLockClientUpdateCount);
29    if fLockClientUpdateCount = 0 then
30    begin
31      SendMessage(ClientHandle, WM_SETREDRAW, 1, 0);
32      RedrawWindow(ClientHandle, nil, 0, RDW_FRAME or RDW_INVALIDATE or
33        RDW_ALLCHILDREN or RDW_NOINTERNALPAINT)
34    end;
35  end;


Now, simply call LockClientUpdate and UnlockClientUpdate instead of LockWindowUpdate.

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC