Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to paint standard Delphi control on some DC?

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Internet Explorer View Settings Question 15 116
Magic Software info 18 138
select query - oracle 16 100
how to change, disabled button color FMX ? 1 40
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

861 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