[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Bring a VB application to front and activate it

Posted on 2002-03-24
7
Medium Priority
?
246 Views
Last Modified: 2010-05-02
Hi,I have a VB applications which deals with autocad i can make the autocad the activeapplication by using
AppActivate "AutoCAD" but i don't know how to let my vb form active and raised infront of the autocad application when i neeed so.
0
Comment
Question by:nermeen
[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
7 Comments
 
LVL 28

Expert Comment

by:vinnyd79
ID: 6892085
Private Declare Function 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 wFlags As Long) As Long

Private Sub Command1_Click()
  SetWindowPos Me.hWnd, -1, 0, 0, 0, 0, 3
End Sub
0
 
LVL 6

Expert Comment

by:pierrecampe
ID: 6893517
fortunately in newer windows versions an app can not easily bring itself to the foreground
a workaround is your app 'appactivates' an other app and that other app 'appactivates' your app and quits
to do it directly your app has to attach itself to the input thread of the foreground app (in your case autocad)
there is an api to do that i think it is called something like 'attachthreadinput'
give me some time i'll try to look it up

0
 

Author Comment

by:nermeen
ID: 6895925
Thank u vinnyd79 and pierrecampe for trying to help.
I tried your function vinnyd79 but it didn't work but i
got the same problem the form appears in the taskbar but it is not raised in the front.
As for u pierrecampe I am waiting for your api.
Thanks again for concern.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 6

Accepted Solution

by:
pierrecampe earned 160 total points
ID: 6896139
okay here it is explained by the vb pro himself:

http://www.devx.com/premier/archives/listissue.asp?MagIssueId=170
0
 

Author Comment

by:nermeen
ID: 6909875
Thank u very very much  pierrecampe your answer was more
than excellent for me i am going to increase the questions
points to the double i wish i could increase them more
i don't have many much points thank u very much u did me
a great help.Sorry for the delay in accepting the answer
it i was in avacation thanks again.
0
 

Author Comment

by:nermeen
ID: 6909877
It deserves more than A++++++++++++++++++................
0
 
LVL 4

Expert Comment

by:bhermer
ID: 14934848
This is the problem with posting links, I have exactly the same problem, and the bl***y link is dead, please please please people, post the answer not the link to the answer, this is makin EE unusable
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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

650 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