From: Marc Hillman on
Dumb question I know, but after 2 hours googling I give up.

What is the easiest/recommended way to access the Win32 API from VB Studio
Express? I assumed it would be a simple matter of Imports Win32, or
something similar and the whole API would be exposed. Surely I don't have to
Declare every API function I call individually? I just want to do things
like FindWindow, GetForegroundWindow and SendMessage. There are also a
gazillion constants like WM_CHAR et al, that I would have thought were
predefined somewhere.

From: Armin Zingler on
Am 09.03.2010 11:45, schrieb Marc Hillman:
> Dumb question I know, but after 2 hours googling I give up.
>
> What is the easiest/recommended way to access the Win32 API from VB Studio
> Express? I assumed it would be a simple matter of Imports Win32, or
> something similar and the whole API would be exposed. Surely I don't have to
> Declare every API function I call individually? I just want to do things
> like FindWindow, GetForegroundWindow and SendMessage. There are also a
> gazillion constants like WM_CHAR et al, that I would have thought were
> predefined somewhere.

Nope. Dotnet was (also) meant to avoid API calls. But as it's not 100%
avoidable, you still have the possibility to declare and call what you need.

Anyway, in most applications you don't need hundreds of these declaration.
If you had a file or dll with all of them, it would increase application size
considerably (I guess). So I think it's better to collect them on your own
and paste in every application. Also see www.pinvoke.net (but I'd check each
declaration used) There are probably other collections out there in the
wide open web.


--
Armin
From: Patrice on
No, .NET expose most Win32 capabilities as classes, this is not a direct
copy of the underlying Win32 API. If you don't find a feature you need
you'll have to declare them (possibly wrapping this in a class).

Try for example :
http://www.pinvoke.net/

I assume this is to interact with an external Win32 app ?

--
Patrice



"Marc Hillman" <7owsx1j02(a)sneakemail.com> a �crit dans le message de groupe
de discussion : uExZ2W3vKHA.5940(a)TK2MSFTNGP02.phx.gbl...
> Dumb question I know, but after 2 hours googling I give up.
>
> What is the easiest/recommended way to access the Win32 API from VB Studio
> Express? I assumed it would be a simple matter of Imports Win32, or
> something similar and the whole API would be exposed. Surely I don't have
> to Declare every API function I call individually? I just want to do
> things like FindWindow, GetForegroundWindow and SendMessage. There are
> also a gazillion constants like WM_CHAR et al, that I would have thought
> were predefined somewhere.


From: Family Tree Mike on


"Marc Hillman" wrote:

> Dumb question I know, but after 2 hours googling I give up.
>
> What is the easiest/recommended way to access the Win32 API from VB Studio
> Express? I assumed it would be a simple matter of Imports Win32, or
> something similar and the whole API would be exposed. Surely I don't have to
> Declare every API function I call individually? I just want to do things
> like FindWindow, GetForegroundWindow and SendMessage. There are also a
> gazillion constants like WM_CHAR et al, that I would have thought were
> predefined somewhere.
>
> .
>

There is a site, http://www.pinvoke.net, which has tools and signatures to
make this easier. The few times that I've needed these functions, that is
where I've looked.

Mike
From: Marc Hillman on
So how does one find the .dot version of (say) FindWindow?

"Armin Zingler" <az.nospam(a)freenet.de> wrote in message
news:OsdS#L4vKHA.5940(a)TK2MSFTNGP02.phx.gbl...
> Am 09.03.2010 11:45, schrieb Marc Hillman:
>> Dumb question I know, but after 2 hours googling I give up.
>>
>> What is the easiest/recommended way to access the Win32 API from VB
>> Studio
>> Express? I assumed it would be a simple matter of Imports Win32, or
>> something similar and the whole API would be exposed. Surely I don't have
>> to
>> Declare every API function I call individually? I just want to do things
>> like FindWindow, GetForegroundWindow and SendMessage. There are also a
>> gazillion constants like WM_CHAR et al, that I would have thought were
>> predefined somewhere.
>
> Nope. Dotnet was (also) meant to avoid API calls. But as it's not 100%
> avoidable, you still have the possibility to declare and call what you
> need.
>
> Anyway, in most applications you don't need hundreds of these declaration.
> If you had a file or dll with all of them, it would increase application
> size
> considerably (I guess). So I think it's better to collect them on your own
> and paste in every application. Also see www.pinvoke.net (but I'd check
> each
> declaration used) There are probably other collections out there in the
> wide open web.
>
>
> --
> Armin

 |  Next  |  Last
Pages: 1 2
Prev: Some concepts of OOP.
Next: withevents and arrays