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 7179513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:09:19+00:00 2026-05-28T17:09:19+00:00

so I have created this popup window with a custom move and sizing, pressing

  • 0

so I have created this popup window with a custom move and sizing, pressing ctrl and click anywhere in the client to move and alt at the borders to size. The problem is, now i’m creating child windows for inside this window and here it goes “wrong”. I can’t find how to send the message to the parent window.
This is what I’ve tried.

I handle these messages in the wndproc of the parent window

case WM_NCHITTEST:
    //determines if the window should be moving, sizing or don't do a thing
    return DoHitTest(pWnd, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) );

case WM_NCLBUTTONDOWN:
    //just set the cursor for visual notice
if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
    SetCursor(LoadCursor(NULL, IDC_SIZEALL));
break;

and this is the doHitTest method

int WindowGnaq::DoHitTest(WindowBase* pWnd, int x, int y)
{
    if( GetAsyncKeyState( VK_CONTROL ) & 0x8000 )
        return HTCAPTION;

    if( m_bAdjustable && GetAsyncKeyState( VK_MENU ) & 0x8000 )
    {
        short spare = 5;
        RECT r;
        pWnd->GetRect(r);
        r.right -= 1;
        r.bottom -= 1;

        if (x < (r.left + spare) && y < (r.top + spare))
            return HTTOPLEFT;
        else if (x < (r.left + spare) && y > (r.bottom - spare))
            return HTBOTTOMLEFT;
        else if (x < (r.left + spare))
            return HTLEFT;
        else if (x > (r.right - spare) && y < (r.top + spare))
            return HTTOPRIGHT;
        else if (x > (r.right - spare) && y > (r.bottom - spare))
            return HTBOTTOMRIGHT;
        else if (x > (r.right - spare))
            return HTRIGHT;
        else if (y < (r.top + spare))
            return HTTOP;
        else if (y > (r.bottom - spare))
            return HTBOTTOM;
    }
    return HTCLIENT;
}

and this is what I’m trying in the childs window procedure

    case WM_NCHITTEST:
        //this just moves the mouse to the border i don't have but doesn't make me able to move
        return SendMessage( m_pParent->GetHandle(), WM_SYSCOMMAND, SC_MOVE, -1); 
        //this doesn't to anything
        return PostMessage( m_pParent->GetHandle(), msg, wParam, lParam); 

        //this makes the childwindow move instead of the parent
        return SendMessage( m_pParent->GetHandle(), msg, wParam, lParam);
  • 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-05-28T17:09:20+00:00Added an answer on May 28, 2026 at 5:09 pm

    The childrens’ window procedures should return HTTRANSPARENT in response to WM_NCHITTEST, and (citing MSDN) "the message will be sent to underlying windows in the same thread until one of them returns a code that is not HTTRANSPARENT".

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have dialog created like this $('#add_error').click(function(e) { $('<div>') .load('/someaction/format/html/') .dialog({ title: 'Some title',
I have created a custom tag that looks like this: def textField = {
So, I have a popup information window on my site. Basically, I've created a
I have created a dialog popup on click to show - I would like
I have an application that brings up a popup window when you click a
I have a popup menu that displays dynamically created custom JPanel objects in a
I have created this code, and when I run it, don't get any errors
I have created this report using BIRT and phpjavabridge <?php header(Content-type: application/pdf); header(Content-Disposition: inline;
I have created something like this and this . In effect I have a
I have created a MultiSelectList like this: MultiSelectList UsergroupID = new MultiSelectList(_ug.GetUsergroups(), UsergroupID, UsergroupName,

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.