Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / December 2003

Tip: Looking for answers? Try searching our database.

Message pump

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Francois Piette - 18 Sep 2003 15:22 GMT
I'm new to DotNet, so excuse my stupid questions -(
I have to port a Windows program making use of Windows messaging system
(PostMessage with custom messages). Does DotNet programs have a message pump
? Do we have access to the window handle of each form or control ? How do I
write a message handler ?

--
francois.piette@overbyte.be
http://www.overbyte.be
Mattias Sj?gren - 18 Sep 2003 21:13 GMT
Francois,

microsoft.public.dotnet.framework.windowsforms is a better group for
Windows Forms related questions.

>Does DotNet programs have a message pump?

Yes, it's started when you call Application.Run().

>Do we have access to the window handle of each form or control ?

Yes, check the Handle property.

>How do I write a message handler ?

You can override the virtual WndProc method and handle any custom
message.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.

jl.altair - 08 Dec 2003 12:26 GMT
        [STAThread
        static void Main()
       
            Application.Run(new Form1())
       
        protected override void WndProc(ref Message m)
            int intTRUE        = 0x1
            int intFALSE    = 0x0
            switch (m.Msg)
                case WM_SYSCOMMAND
                    if(m.WParam.ToInt32() == SC_SCREENSAVE)
                        if(numeroDeCiclos < 10)
                            m.Result = (IntPtr)intTRUE
                            return
                       
                        else
                           
                       
                   
                    break
                default
                    break
           
            base.WndProc (ref m)
        }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.