Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 02:39:28 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Silly but handy button scripts. Help Calc Wiki
Pages: 1   Go Down
Print
Author Topic: Silly but handy button scripts. Help Calc Wiki  (Read 1191 times)
0 Members and 1 Guest are viewing this topic.
lhaddix
Active Member

Offline Offline

Posts: 2


View Profile
« on: December 21, 2008, 09:09:33 PM »

Hi,
Get tired of leaving Masch to fire up the winfows calc?
Place this under a button.

Shell(calc.exe)

I also wanted a button to open the PDF, without having to know the path to Acrobat. So I did this:


Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA"(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String,ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

ExecuteLink("Mach3Mill_1.84.pdf")

Public Sub ExecuteLink(Link As String)
   On Error Resume Next
   Dim lRet As Long
   If Link <> "" Then
       lRet = ShellExecute(0, "open", Link, "", CurDir())
       If lRet >= 0 And lRet <= 32 Then
           MsgBox "Error jumping to:" & Link, 48, "Warning"
       End If
   End If
End Sub





I also wanted to be able to bring up the Wiki. Use the previous scipt but replace the
line ExecuteLink("Mach3Mill_1.84.pdf")
with  ExecuteLink("http://www.machsupport.com/MachCustomizeWiki/index.php?title=Main_Page")

I take no responsibility for how stable this is because I not used it much so far, but it seems fine.

Landrum
Logged
Chaoticone
South Carolina, US
Administrator
*
Offline Offline

Posts: 3,598


Precision Chaos



View Profile WWW
« Reply #1 on: December 21, 2008, 10:18:53 PM »

Thanks for shareing Landrum.  Smiley

Time savers are great.

Brett
Logged

Grin If you could see the things I have in my head, you would be laughing too. Grin
www.precisionchaos1.com
My guard dog is not what you need to worry about!
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!