Есть Ли Возможность Запустить Агент По Ярлыку?

Serduko

Well-Known Member
11.10.2011
170
0
#1
Есть ли возможность запустить агент по ярлыку? Т.е. запуская клиент, открывается нужная база и запускается нужный агент.
 

NickProstoNick

Статус как статус :)
Lotus team
22.08.2008
1 790
42
#3
Думаю можно где-то в Database Script... в событии PostOpen например
 

Serduko

Well-Known Member
11.10.2011
170
0
#4
Спасибо :)

Добавлено: А есть какая нибудь команда в LS что бы свернуть клиент Lotus Notes?
 

Serduko

Well-Known Member
11.10.2011
170
0
#9
Неасилил, не совсем понимаю принцип вызова, т.е. как объявлять, дайте пример пожалуйста.

Добавлено: Нашел:

Type ShellExecuteInfo
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type

Const SEE_MASK_NOCLOSEPROCESS = &H40
Const SEE_MASK_FLAG_DDEWAIT = &H100
Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Const SW_NORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3
Const SW_MAXIMIZE = 3
Const SW_SHOWNOACTIVATE = 4
Const SW_SHOW = 5
Const SW_MINIMIZE = 6
Const SW_SHOWMINNOACTIVE = 7
Const SW_SHOWNA = 8
Const SW_RESTORE = 9
Const SW_SHOWDEFAULT = 10
Const SW_FORCEMINIMIZE = 11
Const SW_MAX = 11

Declare Function ShellExecuteExA Lib "SHELL32.DLL"(sei As ShellExecuteInfo) As Integer
Declare Function GetLastError Lib "KERNEL32" () As Long

SUB INITIALIZE
Dim sei As ShellExecuteInfo
Dim res As Integer

sei.fMask = SEE_MASK_FLAG_DDEWAIT
sei.hwnd = 0
sei.lpParameters =""
sei.lpDirectory=""
sei.hInstApp=0
sei.lpVerb = "Open" 'Указываем тип действия,
' можно еще,например, "Print"
sei.lpFile = "C:\sample.tif" 'Путь к открываемому файлу
sei.nShow = SW_NORMAL 'Способ показа окна приложения
sei.cbSize = Len(sei)

res = ShellExecuteExA(sei)
If res = 0 Then Messagebox GetLastError 'Можно узнать код ошибки
END SUB
 

nvyush

Well-Known Member
Lotus team
22.04.2009
2 317
0
#11
Код:
'(Declarations)
Const SW_FORCEMINIMIZE = 11 'Minimizes a window, even if the thread that owns the window is not responding. This flag should only be used when minimizing windows from a different thread.
Const SW_HIDE = 0 'Hides the window and activates another window.
Const SW_MAXIMIZE = 3 'Maximizes the specified window.
Const SW_MINIMIZE = 6 'Minimizes the specified window and activates the next top-level window in the Z order.
Const SW_RESTORE = 9 'Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
Const SW_SHOW = 5 'Activates the window and displays it in its current size and position.
Const SW_SHOWDEFAULT = 10 'Sets the show state based on the SW_ value specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application.
Const SW_SHOWMAXIMIZED = 3 'Activates the window and displays it as a maximized window.
Const SW_SHOWMINIMIZED = 2 'Activates the window and displays it as a minimized window.
Const SW_SHOWMINNOACTIVE = 7 'Displays the window as a minimized window. This value is similar to SW_SHOWMINIMIZED, except the window is not activated.
Const SW_SHOWNA = 8 'Displays the window in its current size and position. This value is similar to SW_SHOW, except that the window is not activated.
Const SW_SHOWNOACTIVATE = 4 'Displays a window in its most recent size and position. This value is similar to SW_SHOWNORMAL, except that the window is not activated.
Const SW_SHOWNORMAL = 1 'Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.

Declare Private Function GetActiveWindow Lib "user32" () As Long
Declare Private Function ShowWindow Lib "user32" Alias "ShowWindow"(Byval lhwnd As Long, Byval nCmdShow As Long) As Long

Sub Initialize
Call ShowWindow(GetActiveWindow, SW_MINIMIZE)
End Sub
 

Serduko

Well-Known Member
11.10.2011
170
0
#13
Если я например хочу получить другой hwnd, например IE?

Нашел такую функцию: HWND WINAPI FindWindow(
__in_opt LPCTSTR lpClassName,
__in_opt LPCTSTR lpWindowName
);

Что за тип LPCTSTR, как он будет выглядеть или как его получить, н.р. для lpWindowName?
 

nvyush

Well-Known Member
Lotus team
22.04.2009
2 317
0
#14
Код:
Declare Private Function FindWindow Lib "user32" (Byval lpClassName As Lmbcs String, Byval lpWindowName As Lmbcs String) As Long
 

nvyush

Well-Known Member
Lotus team
22.04.2009
2 317
0
#16
Вместо "" попробуйте Chr$(0)

Добавлено
Или так
Код:
Declare Private Function FindWindow Lib "user32" (Byval lpClassName As Long, Byval lpWindowName As Lmbcs String) As Long
Print FindWindowA(0,"about:blank - Microsoft Internet Explorer")
Почитайте в справке дизайнера раздел "Declare statement (external C calls)"
 

Serduko

Well-Known Member
11.10.2011
170
0
#18
Почитал, в принципе функция находиться, может быть параметры как то неверно передаются, попробовал еще Unicode функцию:

MsgBox FindWindowW(0,"Google - Microsoft Internet Explorer")

Все равно 0.
 

nvyush

Well-Known Member
Lotus team
22.04.2009
2 317
0
#19
Код:
Declare Private Function FindWindow Lib "user32" Alias "FindWindowA" (Byval lpClassName As Long, Byval lpWindowName As String) As Long
Msgbox Cstr(FindWindow(0, "Безымянный - Блокнот")
или
Код:
Declare Private Function FindWindow Lib "user32" Alias "FindWindowW" (Byval lpClassName As Long, Byval lpWindowName As Unicode String) As Long
Msgbox Cstr(FindWindow(0, "Безымянный - Блокнот")
или
Код:
Declare Private Function FindWindow Lib "user32" Alias "FindWindowA" (lpClassName As Any, lpWindowName As Any) As Long
Msgbox Cstr(FindWindow(Byval 0&, Byval "Безымянный - Блокнот"))
 

Serduko

Well-Known Member
11.10.2011
170
0
#20
С блокнотом работают :newconfus: все (и моя в том числе), кроме последней...