Re: How do I find and use the window handle of an external application?
- From: erewhon@xxxxxxxxxx (J French)
- Date: Thu, 13 Apr 2006 07:42:58 GMT
On Wed, 12 Apr 2006 15:30:50 +0200, "Vic Joseph"
<vic_ngreply@xxxxxxxxx> wrote:
Hi Mr. French,
Thanks, for a start, for sending me all those links. I shall have to spend
some time checking them out. And thanks too for the warning about
SubClass/Hook.
No problem
You and the VBn community have my sympathy. I have read enough about the
money-grubbing nastiness of the company we depend on for our programming
language(s). Still, B# (or should it be Bflat? Musically, B# is C) does seem
to be a good tool for someone like myself, an amateur making a new start.
I did not know B# should be C
- that makes C# 'D' - how amusing
I feel almost mean about returning to my own question, but I clearly am
still dependent on API calls to get the external window dimensions. If it
does only take a few well-aimed lines of code to do the trick in VB6, I
wonder whether it wouldn't be possible to compile those lines as an .EXE or
as a DLL function. Then perhaps I could launch it from my own program as a
shell process, supplying the window title and two rectangles (the intended
window area and the client area) as arguments. I'm not sure if this is
moonshine, but I'm willing to try anything.
I am sure you can get at the APIs using B#
- it is just that the declarations are different from the VB6 ones
If you know the caption of the Window then you can use FindWindowEx
to get its hWnd eg:
' --- locate Top Window with Caption "TARGET"
hApp = FindWindowEx(0, 0, vbNullString, "TARGET")
Private Declare Function FindWindowEx _
Lib "user32" _
Alias "FindWindowExA" _
(ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) _
As Long
cSharpless has shown you GetClientRect
Assuming it isn't moonshine, the next question is - ahem - would anyone be
prepared to write down those lines of code in VB6 for me; and perhaps even
compile it for me as an .exe or .dll?
If you really find it impossible, then I could do it, but I really
think you would be better off doing it yourself in B#
- at some stage you need to get familiar with APIs
- so a 'work around' would just be delaying things
By the way, just before writing this sentence I downloaded a free Visual
Basic compiler called Visual Basic 5 CCE. At first sight, it looks
wonderfully uncomplicated compared to Visual Studio. I wonder whether I
could use that to compile the VB code myself? And perhaps I could even learn
Visual Basic after all....
Yes, that is VB5, but only creates controls, you can't make an EXE
- VB6 is really VB5 with a few extra bells and whistles
Have a another crack at it in B#
.
- 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
- Re: How do I find and use the window handle of an external application?
- From: Karl E. Peterson
- 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: Karl E. Peterson
- Re: 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: J French
- 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: Are file extensions visible?
- 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):
Relevant Pages
|