How Winsock API Can be Used with Win32 API? - C C++ under Windows

As far as i know, to make network applications under windows you need to use Winsock API. What if i want to do network programming with Win32 API, what should i do?

1. Do i have to use Winsock API inside my Win32 API?

2. Doesn't Win32 API has  its own ways to handle sockets?

3. I used some Winsock API when i programmed in consoles. However, Winsock API
can create network application within Command Interface. I did not see any facility that makes
Winsock API can be programmed or handled through GUI! So is Win32 API has another set of libraries for sockets that handle sockets &  take the role of Winsock API?

4. If yes, then Winsock API is only good for non GUI application! Thats how i understand it, can you clarify please if i'm wrong

5. Winsock API comes beneath Win32 API, so Win32 is basic API for windows.  Right?

6. What other API's resides Windows other than Winsock? (Ignore DOS API)

7. Win32 API is written in C. Other windows API's (Winsock) are written in what language?

8. Is Winsock API written with Win32 API? As far as i know, Win32 API is the mother of any API resides in Windows OS. Any API in Win OS needs to be written with Win32 API! Right?

I hope my questions are clear. Please answer it in an easy fashion, if you don't mind!
I'm trying to understand what Win32 API before i start learning it. Thus, alot of why's pop up in my mind....

Thanks in Advance
LVL 1
F-J-KAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Infinity08Commented:
The Winsock library and the Win32 API are two different things - they can be used together. The Winsock library provides functionality for socket programming. The Win32 API is simply an interface to several system provided functions.

The Winsock library can be used in any kind of Windows application, whether it's a console application, it uses a GUI, or ... There's nothing in the Winsock library that would interfere.
0
Infinity08Commented:
Or question by question :

>> 1. Do i have to use Winsock API inside my Win32 API?

Using an API inside an API does not make sense. API's are simply interfaces (it literally means Application Programming Interface). You can make use of several API's at the same time if you want.


>> 2. Doesn't Win32 API has  its own ways to handle sockets?

The Win32 API (or more correctly the Windows API) is the superset of all standard API's provided by the Windows operating system. Note that the Winsock API is a (small) part of the Windows API. So, yes the Windows API has ways of handling sockets.


>> 3. I used some Winsock API when i programmed in consoles. However, Winsock API can create network application within Command Interface. I did not see any facility that makes Winsock API can be programmed or handled through GUI! So is Win32 API has another set of libraries for sockets that handle sockets &  take the role of Winsock API?

The Winsock library does not impose any limitations on whether the application has to be a console application or not. They're two different concepts (network programming versus presentation - they're generally on two opposite "ends" of the application).


>> 4. If yes, then Winsock API is only good for non GUI application! Thats how i understand it, can you clarify please if i'm wrong

Yes, you are wrong. The Winsock API can be used in both console and GUI applications.


>> 5. Winsock API comes beneath Win32 API, so Win32 is basic API for windows.  Right?

The Windows API is a collection of all the core API's provided by the Windows operating system. The Winsock API is a (small) part of that.


>> 6. What other API's resides Windows other than Winsock? (Ignore DOS API)

A lot ;) Here's a nice overview :

        http://en.wikipedia.org/wiki/Windows_API


>> 7. Win32 API is written in C. Other windows API's (Winsock) are written in what language?

I don't know for sure whether it's written in C - it seems like a logical guess though. In the end, it doesn't really matter how these API's are implemented. All that matters is how you can make use of the functionality, and that's exactly what an API describes : how to make use of the functionality provided by it.
Note that the Windows API can be used in a wide range of languages, including C, C++, C#, VB, etc.


>> 8. Is Winsock API written with Win32 API? As far as i know, Win32 API is the mother of any API resides in Windows OS. Any API in Win OS needs to be written with Win32 API! Right?

Any application that wants to make use of functionality provided by the Windows OS should make use of the Windows API.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
F-J-KAuthor Commented:
Clear enough. Well answered!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.