473,395 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Looking for Windows API Definitions

Where is the equivalent of the Windows.h (and it's includes) for C#?
Nov 8 '08 #1
12 3571
On Fri, 07 Nov 2008 21:08:53 -0800, Stewart Berman
<sa******@nospam.nospamwrote:
Where is the equivalent of the Windows.h (and it's includes) for C#?
Since there is none, it's nowhere. C# doesn't have/use include files.
Everything it needs comes from manifests of assemblies you add as
references to your project.
Nov 8 '08 #2
Stewart Berman wrote:
Where is the equivalent of the Windows.h (and it's includes) for C#?
I guess you can always try MSDN:

http://msdn.microsoft.com/en-us/libr...49(VS.85).aspx
http://msdn.microsoft.com/en-us/libr...88(VS.85).aspx
http://msdn.microsoft.com/en-us/libr...86(VS.85).aspx

Regards.
Nov 8 '08 #3
"Stewart Berman" <sa******@nospam.nospamwrote in message
news:sk********************************@4ax.com...
Where is the equivalent of the Windows.h (and it's includes) for C#?
If you are going to make a lot of calls into the Windows APIs, you may wish
to take a look at this site: http://pinvoke.net/

It will help you find the various [DllImport] declaractions and associated
data structures that you need to use when using Platform Invoke.

Nov 8 '08 #4
Thanks -- but all that is is information on calling the API functions from C++ not C#.

"Fernando A. Gómez F." <fe****************@gmail.comwrote:
>Stewart Berman wrote:
>Where is the equivalent of the Windows.h (and it's includes) for C#?

I guess you can always try MSDN:

http://msdn.microsoft.com/en-us/libr...49(VS.85).aspx
http://msdn.microsoft.com/en-us/libr...88(VS.85).aspx
http://msdn.microsoft.com/en-us/libr...86(VS.85).aspx

Regards.
Nov 8 '08 #5
OK C# has using statements (the way java does) instead of include statements. Where are the type
descriptions for the Windows API?

"Peter Duniho" <Np*********@nnowslpianmk.comwrote:
>On Fri, 07 Nov 2008 21:08:53 -0800, Stewart Berman
<sa******@nospam.nospamwrote:
>Where is the equivalent of the Windows.h (and it's includes) for C#?

Since there is none, it's nowhere. C# doesn't have/use include files.
Everything it needs comes from manifests of assemblies you add as
references to your project.
Nov 8 '08 #6
Stewart Berman wrote:
OK C# has using statements (the way java does) instead of include statements. Where are the type
descriptions for the Windows API?
..NET do not come with all of those.

In most cases the .NET FrameWork provides same functionality as
Win32 API.

I assume you have found the docs of the .NET FrameWork.

If you really need to use Win32 API from C#, then you can.
Somebody else has already posted a link to a site where you
can find the declarations.

Arne
Nov 8 '08 #7
Stewart Berman wrote:
Where is the equivalent of the Windows.h (and it's includes) for C#?
http://pinvoke.net carries many of them and of other API headers, in C#
and in VB.NET syntax.

--
Rudy Velthuis http://rvelthuis.de

"Always code as if the guy who ends up maintaining your code will
be a violent psychopath who knows where you live."
-- Martin Golding
Nov 8 '08 #8
C# using statements are not equal to C++ include statements.

You have to add the the function imports, which can be found at pinvoke.net
as Alberto wrote.

"Stewart Berman" <sa******@nospam.nospamwrote in message
news:fm********************************@4ax.com...
OK C# has using statements (the way java does) instead of include
statements. Where are the type
descriptions for the Windows API?

"Peter Duniho" <Np*********@nnowslpianmk.comwrote:
>>On Fri, 07 Nov 2008 21:08:53 -0800, Stewart Berman
<sa******@nospam.nospamwrote:
>>Where is the equivalent of the Windows.h (and it's includes) for C#?

Since there is none, it's nowhere. C# doesn't have/use include files.
Everything it needs comes from manifests of assemblies you add as
references to your project.
Nov 8 '08 #9
That looks like you have to find each API function and all of the constants associated with it one
at a time and insert it. I am looking for the equivalent of either the Visual Studio 6 C++
Windows.h (and its includes) or the Visual Basic WIN32API.txt. Preferably updated for Vista.

"Alberto Poblacion" <ea******************************@poblacion.orgwro te:
>"Stewart Berman" <sa******@nospam.nospamwrote in message
news:sk********************************@4ax.com.. .
>Where is the equivalent of the Windows.h (and it's includes) for C#?

If you are going to make a lot of calls into the Windows APIs, you may wish
to take a look at this site: http://pinvoke.net/

It will help you find the various [DllImport] declaractions and associated
data structures that you need to use when using Platform Invoke.
Nov 8 '08 #10
I took another look -- it appears to include the enums for each function.

Thanks.

"Alberto Poblacion" <ea******************************@poblacion.orgwro te:
>"Stewart Berman" <sa******@nospam.nospamwrote in message
news:sk********************************@4ax.com.. .
>Where is the equivalent of the Windows.h (and it's includes) for C#?

If you are going to make a lot of calls into the Windows APIs, you may wish
to take a look at this site: http://pinvoke.net/

It will help you find the various [DllImport] declaractions and associated
data structures that you need to use when using Platform Invoke.
Nov 8 '08 #11
Stewart Berman wrote:
Thanks -- but all that is is information on calling the API functions from C++ not C#.

"Fernando A. Gómez F." <fe****************@gmail.comwrote:
>Stewart Berman wrote:
>>Where is the equivalent of the Windows.h (and it's includes) for C#?
I guess you can always try MSDN:

http://msdn.microsoft.com/en-us/libr...49(VS.85).aspx
http://msdn.microsoft.com/en-us/libr...88(VS.85).aspx
http://msdn.microsoft.com/en-us/libr...86(VS.85).aspx

Regards.
Of course, but you could easily port them to C#. I mean, AFAIK it's only
a matter of using the DllImport attribute properly.

Regards.
Nov 8 '08 #12
Hello Stewart,

Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou
[MSFT] and I will be working on this issue with you.

The .NET is a new platform with a new programming architecture. It just
provides a parallel programming API similar as the traditional Windows API.
Consequently, the recommended way is always to use the .NET platform API
instead of the native Windows API if we can.

However, if the native Windows API is very necessary in case of some
particular scenario, the .NET has provided the P/Invoke as a bridge to
communicate between the native and managed codes. That is to say, the way
of calling Windows API has changed in C#. The header file has died in the
managed world.

Rudy and others joined in this discussion have already gave some useful
links about the PInvoke signatures and samples. Actually, I want to mention
another useful tool, the P/Invoke Interop Assistant. This tool provides a
visual UI that let you select a Windows API you want to call, or native
structure you want to use, and then it will generate and report the
corresponding DllImport attribute and data structure definition to us.

You can have a look at this MSDN magazine article about how to use the
P/Invoke Interop Assitant tool,
http://msdn.microsoft.com/en-us/magazine/cc164193.aspx

Please let me know if you need any future assistance and I will do my best
to follow up. Have a good day!
Best regards,
Ji Zhou (v-****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 10 '08 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Martin MOKREJ© | last post by:
Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: cat somefile.py a = 222 b = 111 c = 9
51
by: Matt | last post by:
Hello, I'm a hiring C++ developer employer looking for existing, online C++ aptitude tests. I have not yet extensively researched this yet, but as an example, I thought this test looked...
5
by: Charles L | last post by:
Can someone explain to me what the following means? "C permits multiple definitions of a variable in any given namespace, provided the definitions are the same and it generates only a single...
3
by: Jack Klein | last post by:
I'm looking for opinions on a C technique I, and others, have used successfully in the past. While some people swear by, apparently others swear at it. Assume a part of a program too large to...
5
by: Kobu | last post by:
Does anyone know how old style function definitions differ in "behaviour" to new style function definitions? I heard the old style function definitions caused integeral promotion and floating...
0
by: mom_newbie | last post by:
Dear all, Could someone suggest a good WSDL reading, oriented for manual Web services implementation? There are plenty working ATL and .NET examples in Internet, but I have troubles making a...
36
by: zouyongbin | last post by:
Stanley B Lippman in his "C++ Primer" that a definition like this should not appear in a header file: int ix; The inclusion of any of these definitions in two or more files of the same...
8
by: rays | last post by:
Hi, I am trying to port a C++ program which is supposed to be standards compliant. It works fine on Linux with GCC (4.x). But as I try to compile it on Windows, all hell breaks loose. I have been...
18
by: hq4000 | last post by:
I have a 32-bit application installed on x64 (AMD64) Vista and Windows XP. The rasdial returns 632 - ERROR_INVALID_SIZE on x64 machine; but the rasdial behaves properly installing the same 32-bit...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.