Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7855795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:29:40+00:00 2026-06-02T20:29:40+00:00

I need to display some shapes (5 rectangles to be precise) on my caption

  • 0

I need to display some shapes (5 rectangles to be precise) on my caption less child window when ever my cursor is on the window, and erase them when cursor leaves the window; i.e enters into the parent window region.

I am tracking the mouse movement to the child window through NCHITTEST, and the rectangles pop up perfectly. But i cant get them to disappear when my cursor leaves the child window, they just remain there on the client area until WM_PAINT is called on to the window.

Can anybody tell me how to achieve this functionality? I need to use the NCHITTEST case as rest of my functionality depends on it. I have tried tracking mouse_move and lbuttondown events, but these events aren’t being captured along with nchittest.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:29:41+00:00Added an answer on June 2, 2026 at 8:29 pm

    Look at the TrackMouseEvent() function.

    This needs to be called when the mouse enters the window (WM_MOUSEMOVE if it’s not already being tracked) and will notify your window when the mouse leaves (WM_MOUSELEAVE).

    Here’s some sample VB6 code but the should be easily convertable to any other language.

    Select Case Msg
        Case WM_MOUSEMOVE
          If Not MouseInWindow Then
            Dim ET As TRACKMOUSEEVENTTYPE
            'Set up the mouse leave notification
            ET.cbSize = Len(ET)
            ET.hwndTrack = Me.hWnd
            ET.dwFlags = TME_HOVER Or TME_LEAVE
            ET.dwHoverTime = 0
            TrackMouseEvent ET
    
            MouseInWindow = True
            'The mouse has just entered
            Redraw
          End If
    
        Case WM_MOUSELEAVE
          If MouseInWindow Then
            MouseInWindow = False
            'The mouse has just left
            Redraw
          End If
    End Select
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to draw some shapes on retina display, so I convert logic points
What I need to do to draw some shapes on retina display, defining actual
I am displaying a form with Symfony2 and Twig, and need to display some
Need some help assigning a mouseover event to display some icons that start out
At some point I need to display a disabled (greyed out by disabled=disabled attribute)
I need to display to the screen some values which are read in method
I have a RichTextBox and I add some texts programatically. I need to display
I display set of images(small). I need to show the larger image(300*300) at some
I need to display some very large images on the iPad. The files are
I need to display some portion of html in my windows forms application. It's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.