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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:11:27+00:00 2026-05-24T12:11:27+00:00

To communicate with a certain service, I have to override the WindProc . and

  • 0

To communicate with a certain service, I have to override the WindProc. and receive window messages.

However, when the form is minimized, I get no longer any message. I know that it has to be like that, but is there a workaround for this? I don’t want to have a hidden form which stays always open…

  • 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-24T12:11:28+00:00Added an answer on May 24, 2026 at 12:11 pm

    I’ve also needed to solve a similar problem recently. Abel’s answer set me on the right direction. Here is a complete example of how I did it, by changing a normal window into a message-only window:

    class MessageWindow : Form {
    
      [DllImport("user32.dll")]
      static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
    
      public MessageWindow() {
         var accessHandle = this.Handle;
      }
    
      protected override void OnHandleCreated(EventArgs e) {
         base.OnHandleCreated(e);
         ChangeToMessageOnlyWindow();         
      }
    
      private void ChangeToMessageOnlyWindow() {         
         IntPtr HWND_MESSAGE = new IntPtr(-3);
         SetParent(this.Handle, HWND_MESSAGE);         
      }
    
      protected override void WndProc(ref Message m) {
         // respond to messages here
      } 
    }
    

    Pay attention to the constructor: I’ve found that I need to access the Handle property or otherwise the OnHandleCreated method won’t get called. Not sure of the reason, perhaps someone can explain why.

    I believe my sample code also would answer a related question: How do I create a message-only window from windows forms?

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

Sidebar

Related Questions

We have certain pages that get updated often. However, the images are cached and
I have written a sample web service, which consist of certain .aspx pages. I
I am using boost::asio::ip::udp::socket to communicate. I use socket.receive_from(...) to receive messages from clients.
I have a service that listens to a socket. When receiving certain input it
I have a couple different objects that allocate certain objects to communicate with each
I'm making a program that communicate with certain patient monitor using C sockets. I'm
I'm writing a program to communicate with certain patient monitor using connection-less (UDP) sockets.
I have to communicate with a device which listens on a port for all
I have a service bound to an activity. The activity is a ListView of
i have a problem in certain company in germany. They use proxy in their

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.