1 00:00:00,920 --> 00:00:08,300 In this lesson we are going to study a little bit on Windows API functions which is also commonly known 2 00:00:08,330 --> 00:00:14,430 as we will take you to API and we are going to take a look at an example. 3 00:00:14,490 --> 00:00:19,800 We know API call message box which is commonly used. 4 00:00:20,130 --> 00:00:24,370 An example of a message box is like this. 5 00:00:24,720 --> 00:00:34,710 If you double click on correct me to run it and over here if you click on check it's got a message box. 6 00:00:34,770 --> 00:00:41,430 Now in order for this message both to show a few things has to happen. 7 00:00:41,430 --> 00:00:41,880 Take a look. 8 00:00:43,010 --> 00:00:49,860 First you have to create the caption which is this caption sorry. 9 00:00:49,910 --> 00:00:59,390 Next you have to create the text that is to be shown in a message box then you have to call the message 10 00:00:59,390 --> 00:01:01,470 box function yourself. 11 00:01:02,080 --> 00:01:09,330 Now what do all this mean zero in the zero item at the bottom and a top. 12 00:01:09,350 --> 00:01:17,040 Now you can look up any documentation for Microsoft by heading over to this webpage. 13 00:01:17,360 --> 00:01:27,140 You can reach this webpage by searching for it like this is the n key message box presenter and then 14 00:01:27,140 --> 00:01:31,450 click the first result here and then scroll down. 15 00:01:32,500 --> 00:01:39,150 So over here you will see that the message box function accepts for parameters. 16 00:01:39,400 --> 00:01:47,500 The first one is the parent window which means who is the parent window for this message box. 17 00:01:47,740 --> 00:01:52,400 If you would put zero there is a message box does not belong to any parent. 18 00:01:52,680 --> 00:01:54,750 It stands alone by cell. 19 00:01:55,270 --> 00:02:01,810 Then the second parameter is a text that is to be shown in year and the third parameter is a caption 20 00:02:02,200 --> 00:02:08,880 showing up here and the fourth barometer is a type of button that you want to show. 21 00:02:08,920 --> 00:02:16,750 So if you were to compare this to the Assembly version this is how you implement it you will really 22 00:02:16,750 --> 00:02:18,040 from bottom to the top. 23 00:02:19,210 --> 00:02:25,530 So if you compare it I say call a message box is here. 24 00:02:25,530 --> 00:02:33,490 Now the function name is so then the one just before I put zero refers to this which is the parent window 25 00:02:34,300 --> 00:02:35,550 then the next one. 26 00:02:35,750 --> 00:02:43,700 But it is the text which is referring to this second parameter and the one next after it will be a caption 27 00:02:44,270 --> 00:02:49,010 we should be the third parameter and the last one. 28 00:02:49,280 --> 00:02:49,800 Right. 29 00:02:49,820 --> 00:02:53,280 Number four from from the bottom would be the button type. 30 00:02:53,510 --> 00:02:54,810 This should be this time. 31 00:02:55,580 --> 00:02:58,460 If you want more details you can really help. 32 00:02:58,700 --> 00:03:11,450 He it down here so this is what he looks like in the assembly called you remember in assembly we push 33 00:03:11,510 --> 00:03:12,590 from bottom to top. 34 00:03:13,130 --> 00:03:17,910 We sat back the opposite from what is shown here. 35 00:03:18,050 --> 00:03:25,730 So if your function parameter is listed from this station top to bottom when you implement it in assembly 36 00:03:25,880 --> 00:03:27,230 it is the reverse. 37 00:03:27,230 --> 00:03:31,510 It means you push zero from the bottom you sign. 38 00:03:31,540 --> 00:03:40,500 To this day then push the caption nice which is this one push this up nicely and finally push this on. 39 00:03:40,540 --> 00:03:41,320 Nice. 40 00:03:41,560 --> 00:03:45,590 So is a reverse order of what you see in the function itself. 41 00:03:46,260 --> 00:03:47,110 So let's take a look. 42 00:03:47,350 --> 00:03:50,460 In India a 64 debugger. 43 00:03:50,740 --> 00:03:56,560 Let's close these first and now open your grimy me in the ICC for DB e.g. 44 00:04:03,280 --> 00:04:09,650 that is run to the entry point that is now run to the entry point by clicking on this button or press 45 00:04:09,680 --> 00:04:13,210 F 9 and oh here we are the entry point. 46 00:04:13,220 --> 00:04:23,250 So now let's put a breakpoint at the place where the data box is going to show go and search for the 47 00:04:23,730 --> 00:04:25,840 string. 48 00:04:26,100 --> 00:04:34,800 Search for current value string references look for the message from here and go day and over here you 49 00:04:34,800 --> 00:04:37,140 can see the message box here. 50 00:04:38,750 --> 00:04:42,140 And if you compare this with the 51 00:04:46,980 --> 00:04:55,160 ages you will see the parameters that set up the message box. 52 00:04:55,170 --> 00:05:00,990 If you have the first Bush year at the bottom if you must re reverse direction remember. 53 00:05:02,060 --> 00:05:08,600 So you have put zero would you first do this and then you have this second pusher which is your wrong 54 00:05:08,600 --> 00:05:09,560 zero key. 55 00:05:09,620 --> 00:05:17,180 Try again which is a tax that is to be shown and then the third parameter will be this pusher which 56 00:05:17,180 --> 00:05:22,930 is the exception referring to this and your fourth push is way up here. 57 00:05:22,970 --> 00:05:30,090 This pusher which is the type of button that is going to be shown now is not this push here because 58 00:05:30,810 --> 00:05:36,500 always push here being jumped over by the jam session. 59 00:05:36,620 --> 00:05:44,720 So he has the biggest push this his father pushing would be the push for the fourth barometer of this 60 00:05:44,720 --> 00:05:47,580 message box the first perimeter is here. 61 00:05:47,660 --> 00:05:52,420 Second perimeter here the barometer here and the fourth perimeter is before the jump. 62 00:05:52,890 --> 00:05:55,880 Oh here he is fourth push. 63 00:05:56,110 --> 00:06:06,190 So this is how we should study now if we take a look at this uh this one this message box here this 64 00:06:06,190 --> 00:06:07,890 message more is the good message. 65 00:06:07,920 --> 00:06:10,240 Congress has done the same thing. 66 00:06:10,240 --> 00:06:19,600 So starting from the bottom the first parameter 1 is this which refers to your parent window in your 67 00:06:19,600 --> 00:06:26,920 second parameter next year will be this wish you'll be uh tax is to be shown in the message box. 68 00:06:26,920 --> 00:06:32,570 You are done then your third parameter caption will be the third from the bottom one do tree. 69 00:06:32,590 --> 00:06:41,770 Is just one the caption wishes to be shown on your search box and a fourth parameter should be. 70 00:06:42,080 --> 00:06:46,330 This should be the type of button to be shown by the message box. 71 00:06:46,920 --> 00:06:47,450 OK. 72 00:06:47,590 --> 00:06:52,380 So let us now put an breakpoint over here and he's I mean the content. 73 00:06:52,390 --> 00:06:53,110 As he runs.