Codes can be shared through DLL. There are many DLL built-in to the window operating system. In this example, we will demonstrate how to access the built-in DLL for Windows.
We will create a program that can access C-based DLL in a loop:
GetSystemPowerStatusfunction within the
kernel32.dll. The bottom loop executes the
kernel32.dllwith frequency and duration input set to
GetSystemPowerStatusfunction is shown in the following screenshot: