×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

SW API macro runs in background

SW API macro runs in background

SW API macro runs in background

(OP)
I'm sure this topic has been covered, but I've had no luck finding related threads. Most of my macro prompts get lost in the background of Windows 7 and I have to hit Alt-Tab to switch it over and it is starting to get a bit annoying. Is there any easy way to set them to come up in the foreground immediately? Could someone point me to the corresponding thread if it exists? I've solved it before but I used a really ugly collection of functions and modules that didn't seem too efficient. Thanks for your help.
 

RE: SW API macro runs in background

(OP)
Macro does not contain any userforms, just msgboxs... will it work nonetheless?

RE: SW API macro runs in background

(OP)
Sorry, I should've been more specific: MY macro doesn't include any userforms, only msgboxs. ill try these ideas though, thanks.

RE: SW API macro runs in background

Can you share the macro to test?

Or

Change the macro into a user form using these macro.

Deepak Gupta
SW 2010 SP4.0 & 2011 SP3.0
Boxer's SolidWorks™ Blog

RE: SW API macro runs in background

(OP)
I don't need or want a userform.


Sub main()

Dim Question as Long

Question = msgbox("Does this come up first?", vbYesNo)

If Question = vbYes Then
      msgbox "You obviously don't need to do this.", vbOkayOnly
Else
      msgbox "More help is needed.", vbOkayOnly
End if

End Sub


Obviously if you run this on W7x64 SW2011 SP3.0 - all msgboxs will remain hidden. Is there anyone that has changed system options or possibly vb add-in library references to achieve this result?  

RE: SW API macro runs in background

What if you use SldWorks.SendMsgToUser2 instead of MsgBox?

If I'm not mistaken, those windows originate in SolidWorks, as opposed to Windows.  Plus, if it does work, it gives you quite a few options as far as the buttons on the message box...

RE: SW API macro runs in background

There are a couple work-arounds you can do.

One would be to use a form and use the code to change the text shown on the form with the code from Lorono's site.

I did read about another method than message boxes while researching the code to write what I posted at Lorono's.

What gopack13 posted should work as well as long as you're running from Solidworks.

James Spisich
Design Engineer, CSWP

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources