Solved

Setting Focus On A VB App

Posted on 2002-05-03
6
139 Views
Last Modified: 2010-05-02
I have a VB app that goes thru and make certain checks.  This can sometimes take about 3-4 minutes.  When the checks are completed, a Message Box pops up giving the results of the check.

What I need is, if while the checking process is going on, someone, lets say opens Microsoft Word to do some work in it.  

When the checking process is complete, I need to the VB app to become Visible again and setfocus on it.
I need for it to take over the screen again right before the Message Box pops up.

The name of my app is Search.exe

Thanks
WonHop
0
Comment
Question by:WonHop
6 Comments
 
LVL 5

Expert Comment

by:rkot2000
ID: 6988959
before showing msgbox :
appactivate currentform.name like :

AppActivate Me.Name
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6988982
optionally,
Private Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_RESTORE = 9


'usage
showwindow me.hwnd, SW_RESTORE
0
 
LVL 15

Accepted Solution

by:
ameba earned 100 total points
ID: 6989373
   Beep
    Me.SetFocus
    MsgBox "Done!"
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Author Comment

by:WonHop
ID: 6991371
Hello Guys.  Thanks for the reply.  Sorry I am just now getting back to you, but I did not receive and still have not received any emails saying anyone replied and I left early Friday.  I guess I should have checked anyway like I did today.

I will check these out and see how they work.

Thanks
WonHop
0
 
LVL 2

Author Comment

by:WonHop
ID: 6994342
Hello guys.  For the app I was running, ameba's comment was the one that worked.

Thanks to you all
WonHop

0
 
LVL 15

Expert Comment

by:ameba
ID: 6994353
Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now