🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5718

Re: Draw WinControls on form

#5718
From: Thorsten Kettner
Date: Fri, 22 Jul 2005 07:39
53 lines
3392 bytes
"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>> What I need for my IDE is to receive all the mouse
>> events (move, click, startdrag, and so on)
>
>Then look at SetCapture().  That way, all mouse input is 
>directed to the IDE directly regardless of which control the 
>input is actually occuring.

Thank you for pointing to SetCapture. I didn't know it. It works
somehow, but not really good. At last it seems to complicate 
things a lot.

I did this:

  - Create a form with a some buttons having TabStop = false.
  - SetCapture(Handle); in my app's OnActivate (need to be there
    because alt-tabbing releases the capture).
  - Screen->Cursor = crArrow; in the next line, because 
    SetCapture switches the cursor to hourglass (strange 
    enough: setting the form's cursor had no effect).
  - Placing the same code in form's OnClick and OnDblClick, 
    because these events release the capture.

Here are the first problems I found:

  - Although OnDblClick gets called, SetCapture doesn't work:
    the capture remains released.
  - Alt-F4 does not work. 
  - Cannot drag the window's title bar. Neither can I use the 
    widgets for maximizing, minimizing and closing.
  - If I click the title bar without moving the mouse, the
    cature gets released.

Well, I don't know how many more problems still hide from me,
but I am not even able to solve these first ones. And I fear
that things get even more complicated when I switch from SDI to
MDI, right?. Do you know a solution? Or a better way still?

>> PS: I still think that if I rendered my control [snip]
>
>As I've already explained to you in another discussion, that is
>overcomplicating your design, and it NOT the way to handle the 
>situation.

I don't want to argue, but... ;-) you call it complicated to
move and resize some images on my form? The one and only problem
is that I don't know how to make them look exactly like a button
or checkbox or another control. I guess this is what you want 
to say: "Windows is not able to render controls to another DC. 
So, although it would be the easiest way, due to the Windows 
limitations it is impossible. WM_PRINT, PaintTo and the like
don't work, the docs are all wrong." Is this your statement?
Technical Details
Message-ID: <42e0a2cd$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42dbd87f$1@newsgroups.borland.com> <42dbe2e2$3@newsgroups.borland.com> <42dcddc7$1@newsgroups.borland.com> <42dd2a41$1@newsgroups.borland.com> <42dfb413$1@newsgroups.borland.com> <42dfdbd8$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c52395efb5c800b0
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de>
Sender: "Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de>
Reply-To: "Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de>
Subject: Re: Draw WinControls on form
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 80.85.196.93     
References: <42dbd87f$1@newsgroups.borland.com> <42dbe2e2$3@newsgroups.borland.com> <42dcddc7$1@newsgroups.borland.com> <42dd2a41$1@newsgroups.borland.com> <42dfb413$1@newsgroups.borland.com> <42dfdbd8$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <42e0a2cd$1@newsgroups.borland.com>
Date: 22 Jul 2005 00:39:57 -0700
X-Trace: newsgroups.borland.com 1122017997 207.105.83.66 (22 Jul 2005 00:39:57 -0700)
Lines: 53
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail