Solved

How to paint standard Delphi control on some DC?

Posted on 1998-01-18
4
277 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 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 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

11 Experts available now in Live!

Get 1:1 Help Now