In this lesson we are going to study a little bit on Windows API functions which is also commonly known
as we will take you to API and we are going to take a look at an example.
We know API call message box which is commonly used.
An example of a message box is like this.
If you double click on correct me to run it and over here if you click on check it's got a message box.
Now in order for this message both to show a few things has to happen.
Take a look.
First you have to create the caption which is this caption sorry.
Next you have to create the text that is to be shown in a message box then you have to call the message
box function yourself.
Now what do all this mean zero in the zero item at the bottom and a top.
Now you can look up any documentation for Microsoft by heading over to this webpage.
You can reach this webpage by searching for it like this is the n key message box presenter and then
click the first result here and then scroll down.
So over here you will see that the message box function accepts for parameters.
The first one is the parent window which means who is the parent window for this message box.
If you would put zero there is a message box does not belong to any parent.
It stands alone by cell.
Then the second parameter is a text that is to be shown in year and the third parameter is a caption
showing up here and the fourth barometer is a type of button that you want to show.
So if you were to compare this to the Assembly version this is how you implement it you will really
from bottom to the top.
So if you compare it I say call a message box is here.
Now the function name is so then the one just before I put zero refers to this which is the parent window
then the next one.
But it is the text which is referring to this second parameter and the one next after it will be a caption
we should be the third parameter and the last one.
Right.
Number four from from the bottom would be the button type.
This should be this time.
If you want more details you can really help.
He it down here so this is what he looks like in the assembly called you remember in assembly we push
from bottom to top.
We sat back the opposite from what is shown here.
So if your function parameter is listed from this station top to bottom when you implement it in assembly
it is the reverse.
It means you push zero from the bottom you sign.
To this day then push the caption nice which is this one push this up nicely and finally push this on.
Nice.
So is a reverse order of what you see in the function itself.
So let's take a look.
In India a 64 debugger.
Let's close these first and now open your grimy me in the ICC for DB e.g.
that is run to the entry point that is now run to the entry point by clicking on this button or press
F 9 and oh here we are the entry point.
So now let's put a breakpoint at the place where the data box is going to show go and search for the
string.
Search for current value string references look for the message from here and go day and over here you
can see the message box here.
And if you compare this with the
ages you will see the parameters that set up the message box.
If you have the first Bush year at the bottom if you must re reverse direction remember.
So you have put zero would you first do this and then you have this second pusher which is your wrong
zero key.
Try again which is a tax that is to be shown and then the third parameter will be this pusher which
is the exception referring to this and your fourth push is way up here.
This pusher which is the type of button that is going to be shown now is not this push here because
always push here being jumped over by the jam session.
So he has the biggest push this his father pushing would be the push for the fourth barometer of this
message box the first perimeter is here.
Second perimeter here the barometer here and the fourth perimeter is before the jump.
Oh here he is fourth push.
So this is how we should study now if we take a look at this uh this one this message box here this
message more is the good message.
Congress has done the same thing.
So starting from the bottom the first parameter 1 is this which refers to your parent window in your
second parameter next year will be this wish you'll be uh tax is to be shown in the message box.
You are done then your third parameter caption will be the third from the bottom one do tree.
Is just one the caption wishes to be shown on your search box and a fourth parameter should be.
This should be the type of button to be shown by the message box.
OK.
So let us now put an breakpoint over here and he's I mean the content.
As he runs.