Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Bring an unactive vb program to active

Posted on 2002-06-03
1
Medium Priority
?
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
Toad224 earned 200 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

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.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Suggested Courses

705 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