Re: How do I find and use the window handle of an external application?
- From: "Karl E. Peterson" <karl@xxxxxxxx>
- Date: Tue, 11 Apr 2006 13:48:37 -0700
Vic Joseph wrote:
Thanks for your attention, Karl and Ken. I have tried posting similar
questions to a couple of VB.Net groups but for some reason I haven't
had any replies;
Wow, really? Sorry to hear that, but it's pretty unlikely nothing useful
will be offered here as most folks here have more-or-less rejected VFred.
so I thought perhaps VB.Net and WinAPI have become
two separate worlds.
I think that was the intent, yeah.
I found various examples on the Web of these function calls, and all
of them used Longs, even when apparently talking about VB.Net. But
perhaps the need to replace them by something else would be obvious
to a programmer versed in VB6 (which I am not).
Anyway, following Ken's hint I tried replacing all the Longs by
Integers. No error, but it didn't work because FindWindow always
returns a zero value: Declare Function FindWindow Lib "user32"
Alias "FindWindowA" ...<snip>... As Integer
Next I tried leaving FindWindow as Long and changing only FlashWindow
to integer (well, you never know..).
Declare Function FlashWindow...<snip>...(ByVal hwnd As Integer,
ByVal bInvert As Integer) As Integer
Then, in the sub, I called the functions as follows:
wHandle=FindWindow("", "Calculator") '(unchanged)
Dim intWHandle = CInt(wHandle / &H100000000) '(get the top half
of wHandle as an Integer)
FlashWindow(intWHandle,1)
This doesn't produce an error. But it doesn't have any effect either.
Any further suggestions?
Best suggestion would be to look for other examples of passing Strings as
parameters in VFred. You'll definitely want to pass 32-bit integers for
dword params. Or, to repost with a simpler example, perhaps subject'd "API
Declaration?" or some such. Good luck.
--
Working without a .NET?
http://classicvb.org/
.
- Follow-Ups:
- References:
- How do I find and use the window handle of an external application?
- From: Vic Joseph
- Re: How do I find and use the window handle of an external application?
- From: Ken Halter
- Re: How do I find and use the window handle of an external application?
- From: Vic Joseph
- How do I find and use the window handle of an external application?
- Prev by Date: Re: How do I find and use the window handle of an external application?
- Next by Date: Re: How do I find and use the window handle of an external application?
- Previous by thread: Re: How do I find and use the window handle of an external application?
- Next by thread: Re: How do I find and use the window handle of an external application?
- Index(es):