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
Deepak Gupta
SW 2010 SP4.0 & 2011 SP3.0
Boxer's SolidWorks™ Blog
RE: SW API macro runs in background
RE: SW API macro runs in background
Actually you need to use the codes from this macro into your macro or vice versa.
If you still feel it is not working, try these ones:
http://
https://forum.solidworks.com/message/203792#203792
Deepak Gupta
SW 2010 SP4.0 & 2011 SP3.0
Boxer's SolidWorks™ Blog
RE: SW API macro runs in background
RE: SW API macro runs in background
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
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
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
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