[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== API Call (ViP Specific) ====
=== At 19 JAN 1998 01:11:18PM Mike Edkins wrote: ===
{{tag>"ViP Specific"}}
Is there an API call we can use within VIP to add a shortcut to the Start button so that we can create a user setup program.
----
=== At 20 JAN 1998 02:31PM John Averell Revelation wrote: ===
No, sorry.
----
=== At 24 JAN 1998 12:42PM George Vaccaro wrote: ===
John, you gave up too early.
This is not a complete answer, my ViP is a bit rusty, but here is some VB code stolen from their setup Wizard (where did the ViP setup wizard go? I know I wrote one).
Mike, you'll have to mess around a bit with this, but I'm sure you can get it to work. Windows95 is backward compatible with Windows3.1 Program Manager DDE with respect to this particular task so that 16 Bit windows applications can install correctly under it.
Good luck.
George_Vaccaro@lotus.com
Here's the code:
'-----------------------------------------------------------
' SUB: PerformDDE
'
' Performs a Program Manager DDE operation as specified
' by the intDDE flag and the passed in parameters.
' Possible operations are:
'
' mintDDE_ITEMADD: Add an icon to the active group
' mintDDE_GRPADD: Create a program manager group
'
' IN: frm - form containing a label named 'lblDDE'
' strGroup - name of group to create or insert icon
' strTitle - title of icon or group
' strCmd - command line for icon/item to add
' intDDE - ProgMan DDE action to perform
'-----------------------------------------------------------
'
Sub PerformDDE(frm As Form, ByVal strGroup As String, ByVal strCmd As String, ByVal strTitle As String, ByVal intDDE As Integer, ByVal fLog As Boolean)
Const strCOMMA$=,"
Const strRESTORE$=, 1)]"
Const strACTIVATE$=, 5)]"
Const strENDCMD$=)]"
Const strSHOWGRP$=ShowGroup("
Const strADDGRP$=CreateGroup("
Const strREPLITEM$=ReplaceItem("
Const strADDITEM$=AddItem("
Dim intIdx As Integer 'loop variable
SetMousePtr gintMOUSE_HOURGLASS
'
'Initialize for DDE Conversation with Windows Program Manager in
'manual mode (.LinkMode=2) where destination control is not auto-
'matically updated. Set DDE timeout for 10 seconds. The loop around
'DoEvents() is to allow time for the DDE Execute to be processsed.
'
Dim intRetry As Integer
For intRetry=1 To 20
On Error Resume Next
frm.lblDDE.LinkTopic=PROGMAN|PROGMAN"
If Err=0 Then
Exit For
End If
DoEvents
Next intRetry
frm.lblDDE.LinkMode=2
For intIdx=1 To 10
DoEvents
Next
frm.lblDDE.LinkTimeout=100
On Error Resume Next
If Err=0 Then
Select Case intDDE
Case mintDDE_ITEMADD
'
' The item will be created in the group titled strGroup
'
' Write the action to the logfile
'
If fLog Then
NewAction gstrKEY_PROGMANITEM, """" & strUnQuoteString(strGroup) & """" & ", " & """" & strUnQuoteString(strTitle) & """"
End If
'
' Force the group strGroup to be the active group. Additem only
' puts icons in the active group.
'
#If 0 Then
frm.lblDDE.LinkExecute strSHOWGRP & strGroup & strACTIVATE
#Else
' BUG #5-30466,stephwe,10/96: strShowGRP doesn't seem to work if ProgMan is minimized.
' : strADDGRP does the trick fine, though, and it doesn't matter if it already exists.
frm.lblDDE.LinkExecute strADDGRP & strGroup & strENDCMD
#End If
frm.lblDDE.LinkExecute strREPLITEM & strTitle & strENDCMD
Err=0
frm.lblDDE.LinkExecute strADDITEM & strCmd & strCOMMA & strTitle & String$(3, strCOMMA) & strENDCMD
Case mintDDE_GRPADD
'
' Write the action to the logfile
'
If fLog Then
NewAction gstrKEY_PROGMANGROUP, """" & strUnQuoteString(strGroup) & """"
End If
frm.lblDDE.LinkExecute strADDGRP & strGroup & strENDCMD
frm.lblDDE.LinkExecute strSHOWGRP & strGroup & strRESTORE
'End Case
End Select
End If
'
'Disconnect DDE Link
'
frm.lblDDE.LinkMode=0
frm.lblDDE.LinkTopic="
SetMousePtr gintMOUSE_DEFAULT
If fLog Then
CommitAction
End If
Err=0
End Sub
----
=== At 26 JAN 1998 08:56AM John Averell Revelation wrote: ===
George,
Thanks for the detailed reply. Good to hear from you.
I suspect this would be considered rather more than a simple API call in ViP! However, if it works for the user, great!
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=D84070853E53386D852565910063E972|View this thread on the forum...]]