Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Setting Focus On A VB App

Posted on 2002-05-03
6
Medium Priority
?
147 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 400 total points
ID: 6989373
   Beep
    Me.SetFocus
    MsgBox "Done!"
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

916 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