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

  • Home
  • SEARCH
  • 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 8871775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:04:36+00:00 2026-06-14T18:04:36+00:00

I have a C Legacy app, this app opens and closes windows as time

  • 0

I have a C Legacy app, this app opens and closes windows as time goes on (its a server app).

On the same machine, I’m running a C# winforms app.

Here is my goal:
My C# app sends my C app a win32 message. The C app opens the window up. I want the newly opened C window to bring to front, IN FRONT OF my C# app.

Here is the process currently:

  • C# sends win32 message to C
  • C receives, and opens new window
  • C attempts to bring itself forward
  • (I’m wondering at this point if C# should be telling C to ‘bring yourself in front of me’)

edit I have everything finished except for the part where I get the C window to come to front somehow. I currently message the C app, and it opens the new window (in front of all other windows of the same .exe), but under my C# app.

I’ve tried using

[DllImport("user32.dll")]
static extern bool AllowSetForegroundWindow(ServerWindowHandle);

But had no luck with it. Do I somehow need to have my C app have “ownership” of my .net app? The C# app is getting launched via a programinvoke.

  • 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-14T18:04:37+00:00Added an answer on June 14, 2026 at 6:04 pm

    You didn’t mention what operating system you were using but through some searching I found that SetForegroundWindow apparently does not always work on Windows 7. A workaround is described here. Perhaps you could take some ideas from there and apply them in either the C or C# app to get a working solution?

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

Sidebar

Related Questions

I have a legacy web app running in Tomcat 5.0. This web app has
We have a (massive) legacy WinForms app which, through a menu item, opens up
Im working on a legacy app that has this logic in its code that
I have a legacy (solve this problem for us issue) app that communicates with
We have an existing legacy app written in C++/powerbuilder running on Unix with it's
I have a legacy WinForms Mdi App in VB.Net 2.0 which I am adding
I have a legacy app that seems to be exporting/saving files with CArchive (legacy
I have a legacy intranet web app that was written for IE7 and contains
I have a legacy PHP/MySQL app that calls mysql_connect(). Tons of existing downstream code
I have a legacy Java (not my native language) app that I'm trying to

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.