[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to paint standard Delphi control on some DC?

Posted on 1998-01-18
4
Medium Priority
?
294 Views
Last Modified: 2010-04-04
How to paint standard Delphi control on some DC? For example I want to put TButton into form's caption. I can obtain caption's DC using WM_NCPAINT what then? Once again I want to put Delphi's TWinControl's descendant, not Windows button class.

Thanks!
0
Comment
Question by:_art_
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 200 total points
ID: 1356972
You can use any TWinControl's "PaintTo" method if you have a DC.

E.g.
  MyButton.PaintTo(SomeDC, 10, 20);

JB
0
 

Author Comment

by:_art_
ID: 1356973
Well not exactly. This draws control's actual image and
no more (btw it isn't working with TAnimate at some reasons).
What I need is to put fullly workable control with all its behavior into knowing DC.
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1356974
To get a control to work in the non-client area, you need to trap other the NC messages: WM_NCHITTEST, WM_NCLBUTTONDOWN, WM_NCLBUTTONUP, WM_NCPAINT (you already do this).
0
 

Author Comment

by:_art_
ID: 1356975
Yep, but how to do that? To put control there. My main task is to add TAnimate to the menu item (maybe you have seen CoolMenus - package of mine). TAnimate or any TWinControl's descendant that does AVI... It is no problem to write one but it has to be
WINDOWED control itself...

SendMessage(Handle, ACM_OPEN, 0, LongInt(FileName));
            ^^^^^^
Should be passed DC of windowed control but not menu item's or whatever's else.
Any working ideas will be appreciated (not just with points) :-)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Integration Management Part 2
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

830 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