Significance of 'return (int) msg.wParam'?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: Significance of 'return (int) msg.wParam'?

  1. #1
    Join Date
    May 2010

    Cool Significance of 'return (int) msg.wParam'?

    Hello. I am new to multithreading and was on my way through a simple tutorial when I ran across this line to end the primary thread.

    return (int) msg.wParam;

    I am used to ending my programs in 'return(0);' and was curious as to what the significance of this statement is? Is this the way a thread (using windows API) checks for a success or failure on program termination? Or is there some other reason for this statement?

    Thank you in advance for the help!


  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004

    Re: Significance of 'return (int) msg.wParam'?

    A thread can return anything it wishes when it exits - it's up to the programmer to decide what to return.

    You use ExitCodeThread to retrieve the value.

    Lastly, the OS doesn't care what value is returned.

  3. #3
    Join Date
    May 2010

    Re: Significance of 'return (int) msg.wParam'?

    Thanks for the help, that cleared things up for me.


Tags for this Thread

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a survey!

HTML5 Development Center