Solved

How to paint standard Delphi control on some DC?

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 64
Virtuailstring tree add node to another virtuailstring tree list 4 115
creating threads in delphi 1 103
Delphi: sending SMS on android platform 1 19
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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

776 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