473,565 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using Win32 Constants

I've managed find out how to start using the Win32 API's

But some of these methods got constants that you should use when caling
them. for example
the LockSetForegrou ndWindow got a unsigned integer as a parameter that
either can be the value of "LSFW_LOCK" or "LSFW_UNLOC K"
How do i get hold of these constants?

Is there some <DllImport-thing that i can use to get hold of these
constants?
and what should i use instead of "UInt32" (wich VB.net dosent support) when
using the API's

http://msdn.microsoft.com/library/de...Functions/Lock
SetForegroundWi ndow.asp
Nov 20 '05 #1
4 3669
* "Jarod_24" <ja******@hotma il.com> scripsit:
But some of these methods got constants that you should use when caling
them. for example
the LockSetForegrou ndWindow got a unsigned integer as a parameter that
either can be the value of "LSFW_LOCK" or "LSFW_UNLOC K"
How do i get hold of these constants?
<http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.ht ml>
Is there some <DllImport-thing that i can use to get hold of these
constants?
No.
and what should i use instead of "UInt32" (wich VB.net dosent support) when
using the API's


'UInt32' is available in VB.NET too.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Nice link.

Regards - OHM

Herfried K. Wagner [MVP] wrote:
* "Jarod_24" <ja******@hotma il.com> scripsit:
But some of these methods got constants that you should use when
caling them. for example
the LockSetForegrou ndWindow got a unsigned integer as a parameter
that either can be the value of "LSFW_LOCK" or "LSFW_UNLOC K"
How do i get hold of these constants?


<http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.ht ml>
Is there some <DllImport-thing that i can use to get hold of these
constants?


No.
and what should i use instead of "UInt32" (wich VB.net dosent
support) when using the API's


'UInt32' is available in VB.NET too.


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com
Nov 20 '05 #3
* "One Handed Man [ OHM# ]" <O_H_M{at}BTInt ernet{dot}com> scripsit:
Nice link.

[...]
<http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.ht ml>


Notice that the .NET support is /very/ "buggy".

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Jarod_24,
In addition to the other comments.

I normally define constants such as "LSFW_LOCK" or "LSFW_UNLOC K" as part of
an enum, which then provides intellisense to the API itself.

Something like (untested):

Enum LockCode As Integer
Lock = 1
Unlock = 2
End Enum

Declare Auto Function LockSetForegrou ndWindow Lib "user32" (ByVal
lockCode As LockCode) As Boolean

As Herfried stated you can use UInt32 in the api declaration itself, however
I normally use an enum of the same size (32bit).
How do i get hold of these constants? Of course finding the values for the Enum is the "challange" . ;-) I normally
look at the C++ include files as I can read C/C++, For VS.NET 2003 the
include files are found in:

\Program Files\Microsoft Visual Studio .NET 2003\Vc7\Platfo rmSDK\Include

Otherwise you can use a tool such as the one Herfried identified.

Hope this helps
Jay

"Jarod_24" <ja******@hotma il.com> wrote in message
news:d4******** *************** *******@news.te ranews.com... I've managed find out how to start using the Win32 API's

But some of these methods got constants that you should use when caling
them. for example
the LockSetForegrou ndWindow got a unsigned integer as a parameter that
either can be the value of "LSFW_LOCK" or "LSFW_UNLOC K"
How do i get hold of these constants?

Is there some <DllImport-thing that i can use to get hold of these
constants?
and what should i use instead of "UInt32" (wich VB.net dosent support) when using the API's

http://msdn.microsoft.com/library/de...Functions/Lock SetForegroundWi ndow.asp

Nov 20 '05 #5

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

Similar topics

0
1898
by: Quinet, Joel | last post by:
Hi all, I use the Win32 extension (Build 157) module with Python 2.3 to add row in a sql server 2000 sp3 DB. My problem is I can not insert data of type money in the DB. I use the following command to create the parameter : prm = cmd.CreateParameter('Open', constants.adCurrency, constants.adParamInput, 8, 12.10)...
11
6564
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am...
0
3464
by: Jim dunn | last post by:
HI I am having problems with C# with regards to its compatibility with win32 API methods, I am trying to read from a windows CE comm port using C# and imported methods from coredll.dll, it seems that I can set the comm state however when I try and read from the port using ReadFile method I cannot, I've tried to change the DCB object flag...
2
2234
by: Rookie | last post by:
Hi, Can someone suggest a way to use some of the constants defined in Win32.h eg. FILE_MAP_ALL_ACCESS ? Is there a way to include a .h file in C# code? It would be great if someone could provide links to articles/tutorials on this topic. Thank you.
2
5422
by: ason | last post by:
Does anybody know where to find all these API Constants like for example LVCFMT_BITMAP_ON_RIGHT = 4094; // = 0x1000 Are these Constants in any *.h files???? thanks ..::AsOn
0
2048
by: Guy Mahieu | last post by:
Hi, I am trying to dynamically add menu items to external win32 applications from c# code. I have found some VB6 examples on the net that do just that, but when I rewrite them into c# they will either do nothing, add a separator or add an empty menu item which does not trigger commands when clicked. The difference between a separator or...
5
6752
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would cause. If I could create a large file that could be encrypted, and maybe add files to it by appending them and putting in some kind of delimiter...
8
4202
by: John Salerno | last post by:
I figured my first step is to install the win32 extension, which I did, but I can't seem to find any documentation for it. A couple of the links on Mark Hammond's site don't seem to work. Anyway, all I need to do is search in the Word document for certain strings and either delete them or replace them. Easy enough, if only I knew which...
1
2412
by: Sin Jeong-hun | last post by:
The .NET BCL is great but not always sufficient. We need Win32 API's to do certain tasks. It's not impossible. We can manually write extern function signatures by hand or copy and paste from a site like pInvoke.net. But I always feel this is a little bit painstaking. Sometimes some signatures are missing or not provided for the CLR language...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
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. ...
0
6260
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...
1
5484
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...
0
3643
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
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
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.