473,810 Members | 2,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looking for Windows API Definitions

Where is the equivalent of the Windows.h (and it's includes) for C#?
Nov 8 '08
12 3601
I took another look -- it appears to include the enums for each function.

Thanks.

"Alberto Poblacion" <ea************ *************** ***@poblacion.o rgwrote:
>"Stewart Berman" <sa******@nospa m.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.comw rote:
>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.mic rosoft.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****@microsof t.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
2296
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
7988
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 pretty good: http://expertrating.com/c++test.asp
5
2479
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 variable for the multiple definitions. C++, however, does not permit redefinition of a variable or any other entity for a very definite reason that we will discuss later." Chapter 1. C++ Tutorial. Coronado Enterprises Charles L
3
2140
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 fit comfortably in a single source file, call it a "module". Let's call it "module A". Also assume for various reasons module A needs a private data store with static storage duration, accessible from files in more than one translation unit. ...
5
7276
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 point promotion on the formal parameters. Is this true? Is it okay for me to set up a new style funciton prototype when calling old style function definitions (for legacy code)? Is this okay?
0
1351
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 plain C++ ISAPI Web service. I took the WSDL from:
36
3860
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 program will result in a linker error complaining about multiple definitions. So this kind of definition should be avoided as much as possible. But as we know, the definition of a class is always in a header file. And we can use "#ifndef" to eliminate...
8
2299
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 struggling with several free (as beer) compilers on windows, but none of them does the job. I am not sure how much of the blame goes to our code and how much to the compilers. By the way the platform is Windows XP and all the softwares mentioned...
18
6525
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 application on a 32-bit machine. Any clue?
0
10643
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10391
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10121
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.