473,407 Members | 2,315 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,407 software developers and data experts.

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 LockSetForegroundWindow got a unsigned integer as a parameter that
either can be the value of "LSFW_LOCK" or "LSFW_UNLOCK"
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
SetForegroundWindow.asp
Nov 20 '05 #1
4 3663
* "Jarod_24" <ja******@hotmail.com> scripsit:
But some of these methods got constants that you should use when caling
them. for example
the LockSetForegroundWindow got a unsigned integer as a parameter that
either can be the value of "LSFW_LOCK" or "LSFW_UNLOCK"
How do i get hold of these constants?
<http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.html>
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******@hotmail.com> scripsit:
But some of these methods got constants that you should use when
caling them. for example
the LockSetForegroundWindow got a unsigned integer as a parameter
that either can be the value of "LSFW_LOCK" or "LSFW_UNLOCK"
How do i get hold of these constants?


<http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.html>
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}BTInternet{dot}com
Nov 20 '05 #3
* "One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> scripsit:
Nice link.

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


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_UNLOCK" 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 LockSetForegroundWindow 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\PlatformSDK\Include

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

Hope this helps
Jay

"Jarod_24" <ja******@hotmail.com> wrote in message
news:d4******************************@news.teranew s.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 LockSetForegroundWindow got a unsigned integer as a parameter that
either can be the value of "LSFW_LOCK" or "LSFW_UNLOCK"
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 SetForegroundWindow.asp

Nov 20 '05 #5

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

Similar topics

0
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...
11
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...
0
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...
2
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...
2
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
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...
5
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...
8
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. ...
1
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...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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,...
0
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...

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.