• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/11

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

11 Cards in this Set

  • Front
  • Back
Every Windows program has a function called ________________.
WinMain
(See Page 31)
In the WinMain function call, what does HINSTANCE hInstance do and how is it important?
This parameter of WinMain identifies the instance of the program being called (See Page 32) as a program may be called several times.
In the WinMain function call, what does HINSTANCE hPrevInstance do and why is it important?
This parameter of WinMain identifies the previous instances of a program. It is important because it keeps the program from running multiple instances of itself. (Page 33)
In the WinMain function call, what does LPTSTR lpCmdLine do and why is it important?
This parameter of WinMain is a string that contains the command line parameters passed to a program. This is important as a debugging tool, and passing parameters. (Page 33)
In the WinMain function call, what does int nCmdLine do and why is it important?
This parameter of WinMain specifies how the program window is to be displayed. (page 33)
In WinMain, what is the purpose of the MSG msg variable?
The MSG variable is used by the GetMessage function to retrieve details of each Windows message.
(Page 33)
In GetMessage, what does LPMSG lpMsg do?
This parameter of GetMessage is a long pointer to a MSG structure which handles the message information.
(Page 35)
In GetMessage, what does HWND hWnd do, and why is it important?
This parameter of GetMessage is a handle to a specfic windows messages.

-Note- If this is NULL then GetMessage will return all of the messages for the current instance of the program.

(Page 35)
In GetMessage, what does UNIT wMsgFilterMin and UNIT wMsgFilterMax do?
These parameters of GetMessage tell GetMessage to return messages in a certain range.

(Page 35)
Why is the GetMessage call so important?
Without this function, the program could not receive, get, or process any messages. Essentially it would be sensory deprived.

(Page 35)
What is wrong with this line of code?

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hInstance, LPSTR lpCmdLine, int nShowCmd)
{
MessageBox(NULL, "You have been hacked!",
"Public Security", MB_OK | MB_ICONEXCLAMATION);
}
The second parameter of WinMain should not call hInstance again, but call hPrevInstannce.