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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:44:31+00:00 2026-05-13T06:44:31+00:00

We have a c++ legacy application and have been extending it with c# applets

  • 0

We have a c++ legacy application and have been extending it with c# applets that are invoked using COM from the parent c++ app. They bring up windows that are not modal. Moreover, I think these .NET windows are not proper children of the c++ application, since EnumChildWindows misses them, and EnumWindows finds them. One child-like behavior remains, however, in that if you close the parent c++ app, the c# window will close as well.

My basic problem with all this is that if the user invokes one of these c# applets, then inadvertently clicks the parent (c++) app window, the c# window drops to the background. If the user wants to bring this back to the top, they should be able to just click its icon in the TaskBar. Unfortunately, for some strange reason, it is often necessary to click the TaskBar icon three times! The first time should bring a hidden window to the top, but it doesn’t. The second click minimizes the hidden window, and the third restores it successfully.

Has anyone else run across this bug/feature when bridging the legacy->.NET divide? I’m wondering if I can intercept the first click on the taskbar icon for my C# applet, and somehow force it to claw its way back to the top. 🙂

I’ve been experimenting with the following:

  [DllImport("User32.dll")]
  private static extern int ShowWindow(IntPtr hwnd, IntPtr nCmdShow);

but even if I get this working I’ll still need to intercept that first mouseclick. Thanks for your help!

  • 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-13T06:44:31+00:00Added an answer on May 13, 2026 at 6:44 am

    Would it work if the C# windows actually were child windows? It might be possible to accomplish that by passing the parent HWND as an argument to the C# COM object, and then using PInvoke to call SetParent on the C# windows. (I’ve never done this, but it sounds at least as safe as fighting with ShowWindow and the task bar?)

    (Note from the comments in the documetation for SetParent that you might also need to fiddle with the child window’s window flags?)

    (Depending on the C# window type, it might already have a Handle property you can use; otherwise you could kludge a PInvoke call to FindWindow to get its handle.)

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

Sidebar

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.