CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2010
    Posts
    2

    How to send a Click with PosteMessage without Form popping up

    Good Evening. I'm building a C# application, as follows : a main frame that allows the user to popup sub-forms, each one containing a WebBrowser component that loads a flash animation.

    The problem is the following: whenever i simulate a click on the subforms, they popup in the foreground and hide the main Form , while I need them to stay exactly where they are. How can I accomplish that? I've tried using the following code :
    Code:
    private const int WM_MOUSEACTIVATE = 0x0021; 
    
    private const int MA_NOACTIVATE = 3;       
    
    protected override void WndProc(ref Message m)       
    
    {
    
                if (m.Msg == WM_MOUSEACTIVATE)
    
                {
    
                    m.Result = (IntPtr)MA_NOACTIVATE;
    
                    return;
    
                }
    
                base.WndProc(ref m);       
    
    }
    without success.

    Thanks for your help

  2. #2
    Arjay's Avatar
    Arjay is online now Moderator / MS MVP Power Poster Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+)
    Join Date
    Aug 2004
    Posts
    10,339

    Re: How to send a Click with PosteMessage without Form popping up

    It's not real clear why you need to simulate a click at all. Can you describe what you are trying to do in a bit more detail.

    Most likely, if we understand what you are trying to do, we'll be able to help you do it without needing to override WndProc and use PostMessage.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts



HTML5 Development Center

Click Here to Expand Forum to Full Width