PASCAL Keyword:
PASCAL is a compiler keyword.
It should be in uppercase.
It informs C compiler to use function-calling conventions of Pascal language but not C language.
The reason behind this is Pascal language’s function calling convention produces less code when compiled into machine instructions.
This is because the Pascal function calling conventions puts parameters passed by a function n the stack, in the order there are declared in function, in C calling convention this is the reverse.
As a stack uses LIFO (Last In First Out) principle.
In the case of Pascal, compiler always knows the first argument is at the end of the stack, while in C, the compiler has to search for the first parameter by checking each and every parameter in the stack ,so the extra number of CPU instructions are generated when the function is called.
MessageBox Function:
This function is used to display message on the message box.
The declaration of this function is the following :
int MessageBox(HWND hWnd , LPSTR lptext , LPSTR lpcaption ,WORD wType)
Parameters passed to MessageBox function:
The first parameter hWnd is the handle of the parent window.
0 can be used as first parameter if the message box belongs to the current window.
The second parameter lpText is the text, which should be displayed as a message.
The third parameter lpCaption is the caption of the message box window.
The fourth parameter wType is the type of the message box required.
The valid values, which can be used as fourth parameter, are
MB_OK --- to display a simple MessageBox
MB_ICONQUESTION -----to display Message box with a question mark as an icon.
MB_ICONEXCLAMATION ---to display MessageBox with a exclamation mark as an icon.
MB_ICONHAND----it display message box with cross mark as an icon.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment