Solved

Bring an unactive vb program to active

Posted on 2002-06-03
1
194 Views
Last Modified: 2010-05-02
How do I bring a minimize vb program to active and put
it in 0, 0 position and on the top of others ?
0
Comment
Question by:dynomite082002
1 Comment
 
LVL 1

Accepted Solution

by:
Toad224 earned 50 total points
ID: 7052523
What do you mean bring a minimize vb program to active?


This code will make your window stay on top of others:

Declare Sub SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal giFlags As Long)

Sub StayOnTop(hWindow As Long, TopMost As Boolean)
    wFlags = &H2 Or &H1 Or &H40 Or &H10
    If TopMost = True Then Placement = -1
    If TopMost = False Then Placement = -2
    SetWindowPos hWindow, Placement, 0, 0, 0, 0, wFlags
End Sub




call     StayOnTop Me.hwnd, True     to make that window stay on top of the others


If you're talking about moving it also, you could do me.move 0,0


If th program's minimized, you can make it normal window state by doing    Me.WindowState = vbNormal


I hope this helps.  Good luck!
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

Suggested Solutions

Title # Comments Views Activity
Check Disk (CHKDSK) on all volumes and fix if needed. 8 178
Access 2016 VB code 9 102
SLMGR Switches Are Not Working On KMS Host 3 63
TT Auto Dashboard 13 80
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

914 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

14 Experts available now in Live!

Get 1:1 Help Now