Thread: A quick comprehension question...

  1. #1
    Registered User
    Join Date
    Nov 2004
    Location
    Pennsylvania
    Posts
    434

    A quick comprehension question...

    Hi guys, so i have been working through this Programming Windows book and im up to like page 100. I just want to confirm something before i keep going on so that i know my understanding of a standard windows program is correct. My question is just a simple one about the layout of the program. Ok so in WinMain we setup our windows class, register it, etc. But am i correct in saying that the 'Brain' of the program lies in the function: LRESULT CALLBACK WndProc ? Because it is that function that handles the messages going into the Windows Queue and then tells windows what to do if this message is next or if that message is next, under the switch statement. Is that right?

    My last questions are firstly what other uses does the WinMain function have (im sure there are plenty of them, just a roundabout general answer would make me happy )? And where are other program things handled? Such as if it were an encryption program for example. Where would the actual Encryption take place (in WinMain, Main, WndProc, etc...)? Thanks everyone!

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    WinMain starts up the program, and then control is basically passed to WndProc. Your program then responds to events. After each event, a function is usually executed, and these functions and the events they respond to define the behavior of the program. So, for example, in this encryption program, data would be entered, and then when you pushed a button to start the encryption another function would be called from WndProc that you had written - and that function would do the encryption.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Location
    Pennsylvania
    Posts
    434
    Oh ok, that makes perfect sense. Thanks Sean, as always your help is greatly appreciated!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Very quick math question
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 10-26-2005, 11:05 PM
  2. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  3. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 04:44 AM
  4. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM