Solved

Bring an unactive vb program to active

Posted on 2002-06-03
1
202 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

856 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