Solved

Bring an unactive vb program to active

Posted on 2002-06-03
1
192 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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

763 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

7 Experts available now in Live!

Get 1:1 Help Now