Hello, my name is Juliana Botero. I am trying to open a VB program ("ConsultaDocLinking.exe" from a Extra! client Macro. At this moment the macro is working well but my problem is that "ConsultaDocLinking.exe" is not being opened by the system as a main window.I have to minimize the Extra Cliente in order to see the application. Please someone help me.... I NEED this application as the main window.
I have already tryed with this functions:
num=shell("ConsultaDocLinking.exe", 1)
iRetVal = SetActiveWindow(num)
iRetVal = SetForegroundWindow32(num)
iRetVal = ShowWindow32(num,9)
iRetVal = SetFocus(num)
Here is the macro code:
*********************************************************
'32 Bit Declares.
Declare Function ShowWindow32 Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Declare Function FindWindow32 Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetForegroundWindow32 Lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As Long) As Long
Declare Function SetActiveWindow Lib "user32" (ByVal hwnd As Long) As Long
Declare Function SetFocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
Sub Main
Dim System As ExtraSystem, Session As ExtraSession
' Get the main system object
Set System = CreateObject("EXTRA.System"
If (System is Nothing) Then
Msgbox "Could not create the EXTRA System object." Stop
End If
' Get the necessary Session Object
Set Session = System.ActiveSession
If (Session is Nothing) Then
Msgbox "Could not create the Session "
Stop
else
msgbox Session.name
dim num
dim iRetVal
num=shell("ConsultaDocLinking.exe", 1)
iRetVal = SetActiveWindow(num)
iRetVal = SetForegroundWindow32(num)
iRetVal = ShowWindow32(num,9)
iRetVal = SetFocus(num)
end if
I have already tryed with this functions:
num=shell("ConsultaDocLinking.exe", 1)
iRetVal = SetActiveWindow(num)
iRetVal = SetForegroundWindow32(num)
iRetVal = ShowWindow32(num,9)
iRetVal = SetFocus(num)
Here is the macro code:
*********************************************************
'32 Bit Declares.
Declare Function ShowWindow32 Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Declare Function FindWindow32 Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetForegroundWindow32 Lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As Long) As Long
Declare Function SetActiveWindow Lib "user32" (ByVal hwnd As Long) As Long
Declare Function SetFocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
Sub Main
Dim System As ExtraSystem, Session As ExtraSession
' Get the main system object
Set System = CreateObject("EXTRA.System"
If (System is Nothing) Then
Msgbox "Could not create the EXTRA System object." Stop
End If
' Get the necessary Session Object
Set Session = System.ActiveSession
If (Session is Nothing) Then
Msgbox "Could not create the Session "
Stop
else
msgbox Session.name
dim num
dim iRetVal
num=shell("ConsultaDocLinking.exe", 1)
iRetVal = SetActiveWindow(num)
iRetVal = SetForegroundWindow32(num)
iRetVal = ShowWindow32(num,9)
iRetVal = SetFocus(num)
end if