Thread

Another Non-SDK Related VB Question (Sdk)

Another Non-SDK Related VB Question // Sdk

1  |  

lanezeri

Nov 4, 2001, 12:05pm
Okay, I need some help.

My DSL connection fails on me quite a bit, and it's really making me angry,
because if I'm not online, neither is www.degtur.com. So I was wondering if
someone could tell me how to do this:

If a message box with the title "Connection Not Active" pops up, bring it to
focus.

I can do the rest after that, but I need to know how to make the thing
become active IF it is even existent. So say you are playing in AW and you
select an object, making the Object Properties window open. Lets pretend
the title says "Connection Not Active", when you select the object and the
box pops up, I want to know how to make that window be the window with
focus, and then after that I will need to send the enter key, and wait 3
seconds and send the enter key again. All I really need to know is how to
make the window have focus, and to realize it is there. I appreciate all
help that I can get, as I know it isn't that easy to do.

--

Thanks,
Ricky Lipe

Degtur Solutions at http://www.degtur.com
Stuff-X at http://www.stuff-x.com

ananas

Nov 4, 2001, 12:37pm
http://www.mjtnet.com/ - their Macro Scheduler - might help

--
"_
|
/\
\ /
__/ /_

lanezeri

Nov 4, 2001, 12:55pm
Sweet! Thanks much. Just hafta order it now, that is awesome.

--

Thanks,
Ricky Lipe

Degtur Solutions at http://www.degtur.com
Stuff-X at http://www.stuff-x.com


[View Quote]

lanezeri

Nov 4, 2001, 12:59pm
Maybe I'll order it; heh, probably worth it, but I think making one would be
less expensive.

--

Thanks,
Ricky Lipe

Degtur Solutions at http://www.degtur.com
Stuff-X at http://www.stuff-x.com


[View Quote]

foxmccloud

Nov 4, 2001, 1:53pm
I don't know VB at all, but I've looked up the API calls you need on MSDN
First you need to do an EnumWindows -> http://support.microsoft.com/support/kb/articles/Q183/0/09.ASP
The EnumWindows function should be OK as I guess the window you want is a top-level window, else you should use EnumChildWindows...
So in the EnumWinProc function in their example, you don't need to go farther than ' see the Windows Class and Title for
each top level Window , and you can just compare your window title with WinTitle. if it's the right one, you can use the
SetFocus function (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/keybinpt_8yb7.asp) on its window handle,
then use the SendInput function (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/keybinpt_7id0.asp) to send
the Enter Key, then return False for the enumeration to stop.

Fox Mc Cloud

lanezeri

Nov 4, 2001, 2:07pm
Wow.. you really did a lot of searching for me.. I thank you much but I just
"half-assed" my way around it. If you care to know how, it's simple:

Loops use too much RAM so I used a timer.. took no time to name anything
either.

Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
Me.Hide
End Sub

Private Sub Timer1_Timer()
On Error GoTo Hell:
Interaction.AppActivate "EnterNet 300"
SendKeys "{ENTER}"
SendKeys "{ENTER}"
Hell:
Exit Sub
End Sub

--

Thanks,
Ricky Lipe

Degtur Solutions at http://www.degtur.com
Stuff-X at http://www.stuff-x.com


[View Quote]

ananas

Nov 4, 2001, 6:02pm
I missed that you are looking for a VB solution, didn't
see the message subject, that's why I came with this
macro thing, sorry.

I can name some system calls that might bring you closer
to a solution, I have no experience with them but know
roughly what they do :

Hook = SetWindowsHookEx (WH_SYSMSGFILTER, ...)
SysMsgProc (...);
UnhookWindowsHookEx (Hook);

Maybe this points you to some ideas without the need
for a timer.

[View Quote] --
"_
|
/\
\ /
__/ /_

foxmccloud

Nov 5, 2001, 12:26am
lol, don't worry i already knew how to do all that... I just looked up the words on msdn and gave you the links :)

Fox Mc Cloud

"lanezeri" <rlipe at degtur.com> a écrit dans le message news: 3be575c7 at server1.Activeworlds.com...
> Wow.. you really did a lot of searching for me.. I thank you much but I just
> "half-assed" my way around it. If you care to know how, it's simple:
>
> Loops use too much RAM so I used a timer.. took no time to name anything
> either.
>
> Private Sub Form_Load()
> Timer1.Interval = 1000
> Timer1.Enabled = True
> Me.Hide
> End Sub
>
> Private Sub Timer1_Timer()
> On Error GoTo Hell:
> Interaction.AppActivate "EnterNet 300"
> SendKeys "{ENTER}"
> SendKeys "{ENTER}"
> Hell:
> Exit Sub
> End Sub

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn