Google Search

Welcome to Infonoy

Welcome to Infonoy, Techport Internet Cafe's website that gives you your news, general information, and technology needs. Stay tuned for news headlines, world updates, and articles for the hottest tech craze like cellphones, PDA's, broadbands, and more!

Tuesday, January 18, 2011

Interfacing with your Windows OS and your Computer Hardware

For windows, what your 3rd party applications basically can do, you can too. These are possible thru windows API function calls that you can access thru the DLL's provided. All you have to know is the function name, its parameters, and its return data type, if it returns a value. These information are readily available on the net, specifically in Microsoft website. You can embedd these functions in your C++ programs, visual basic, or any other language that allows function calls from a DLL.

Generally the first step would be to define the DLL function, its name, parameters, and return data type.

Here is one example of calling a dll function.

'Visual Basic:
Private Declare Function GetCpuSpeed Lib "DLL2.dll" () As Integer
The next step would be to simply call it and use its value.
Private Sub Command1_Click()
    Form1.Text1.Text = GetCpuSpeed()
End Sub
Or in void or simply procedural functions, just simply call it.
Private Sub Command1_Click()
    Form1.Text1.Text = GetCpuSpeed()
End Sub

Imagine how convenient it would be to customize and perform your computer hardware and software functions as you please. You can send data thru you RS232, printer port, LAN port, and others. Here are some useful DLLs that you can use to ease your daily computer life.

kernel32.dll - handles memory management, manages input/output processes and interrupts
user32.dll -  manages basic Windows graphical user interface, such as the desktop, windows, and menus.
gdi32.dll - handles Graphics Device Interface (GDI) functions that does drawing functions for graphic video displays and printers.
Comctl32.dll -  handles standard Windows controls, such as File operation (Open, Save, and Save As)dialogs, list views, progress bars, etc.
wsock32.dll - handle network connections for internet or local network.

Interfacing with your computer thru windows is now very easy even low level programmers can do it.

No comments:

Post a Comment