🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Disable hints on border icons - is that possible?

#4129
From: Remy Lebeau (TeamB)
Date: Mon, 20 Mar 2006 18:57
98 lines
4215 bytes
"Regis St-Gelais" <regis.st-gelais@NOSPAMlaubrass.com> wrote in message
news:441ea195@newsgroups.borland.com...

> With OWL and OwlNext, you can do that by overriding EvNCHitTest

The equivilent in Win32 VCL would be to intercept the WM_NCHITTEST,
WM_NCLBUTTONUP, and WM_NCLBUTTONDOWN messages, ie:

    private:
        bool hitOK;
        int iLastHit;
        TPoint tpSave;

    void __fastcall TForm1::WndProc(TMessage &Message)
    {
        switch( Message.Msg )
        {
            case WM_NCHITTEST:
            {
                TForm::WndProc(Message);
                if( !hitOK )
                {
                    iLastHit = Message.Result;
                    tpSave = Point(LOWORD(Message.LParam),
HIWORD(Message.LParam));

                    if( (Message.Result == HTMAXBUTTON) || (Message.Result
== HTMINBUTTON) || (Message.Result == HTCLOSE) )
                    {
                        Message.Result = 32;
                        // 32 is a value that is not normally
                        // supported by Windows (0-21 are Windows values)
                        // Using it prevents the Windows tooltips from
displaying
                    }
                }
                break;
            }

            case WM_NCLBUTTONUP:
            {
                if( Message.WParam == 32 ) // If we hit one of the system
menu button
                {
                    //  We have been trapping hit test return values,
                    //  but now we need to activate one of the system menu
button
                    //  So, resend the last sequence of messages with hitOK
set to true
                    //  so the messages are processed normally
                    hitOK = true;
                    LPARAM lP = MAKELPARAM(tpSave.x, tpSave.y);
                    Perform(WM_NCHITTEST, 0, lP);
                    Perform(WM_NCMOUSEMOVE, iLastHit, lP);
                    Perform(WM_NCLBUTTONUP, iLastHit, lP);
                    hitOK = false;
                }
                else // Process normaly
                    TForm::WndProc(Message);

                break;
            }

            case WM_NCLBUTTONDOWN:
            {
                if( Message.WParam == 32) // If we hit one of the system
menu button
                {
                    //  We have been trapping hit test return values,
                    //  but now we need to activate one of the system menu
button
                    //  So, resend the last sequence of messages with hitOK
set to true
                    //  so the messages are processed normally
                    hitOK = true;
                    LPARAM lP = MAKELPARAM(tpSave.x, tpSave.y);
                    Perform(WM_NCHITTEST, 0, lP);
                    Perform(WM_NCMOUSEMOVE, iLastHit, lP);
                    PostMessage(Handle, WM_NCLBUTTONDOWN, iLastHit, lP);
                    hitOK = false;
                }
                else // Process normaly
                    TForm::WndProc(Message);

                break;
            }

            default:
            {
                TForm::WndProc(Message);
                break;
            }
        }
    }


Gambit
Technical Details
Message-ID: <441efacb$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <441ba3d9$1@newsgroups.borland.com> <441ea195@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,21724f999055e2d
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <441ba3d9$1@newsgroups.borland.com> <441ea195@newsgroups.borland.com>
Subject: Re: Disable hints on border icons - is that possible?
Date: Mon, 20 Mar 2006 10:57:11 -0800
Lines: 100
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <441efacb$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1142880971 68.69.17.41 (20 Mar 2006 10:56:11 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail