• 15 апреля стартует «Курс «SQL-injection Master» ©» от команды The Codeby

    За 3 месяца вы пройдете путь от начальных навыков работы с SQL-запросами к базам данных до продвинутых техник. Научитесь находить уязвимости связанные с базами данных, и внедрять произвольный SQL-код в уязвимые приложения.

    На последнюю неделю приходится экзамен, где нужно будет показать свои навыки, взломав ряд уязвимых учебных сайтов, и добыть флаги. Успешно сдавшие экзамен получат сертификат.

    Запись на курс до 25 апреля. Получить промодоступ ...

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

  • Автор темы Serduko
  • Дата начала
S

Serduko

Есть ли возможность запустить агент по ярлыку? Т.е. запуская клиент, открывается нужная база и запускается нужный агент.
 

NickProstoNick

Статус как статус :)
Lotus Team
22.08.2008
1 851
27
BIT
0
Думаю можно где-то в Database Script... в событии PostOpen например
 
S

Serduko

Спасибо :)

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

Serduko

Если не сложно, подкинте пожалуйста API команды.
 
S

Serduko

Неасилил, не совсем понимаю принцип вызова, т.е. как объявлять, дайте пример пожалуйста.

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

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
 
S

Serduko

А вот как это применить к открытому клиенту, вопрос...
 
N

nvyush

Код:
'(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
 
S

Serduko

Если я например хочу получить другой hwnd, например IE?

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

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

nvyush

Код:
Declare Private Function FindWindow Lib "user32" (Byval lpClassName As Lmbcs String, Byval lpWindowName As Lmbcs String) As Long
 
N

nvyush

Вместо "" попробуйте 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)"
 
S

Serduko

Почитал, в принципе функция находиться, может быть параметры как то неверно передаются, попробовал еще Unicode функцию:

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

Все равно 0.
 
N

nvyush

Код:
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 "Безымянный - Блокнот"))
 
S

Serduko

С блокнотом работают :newconfus: все (и моя в том числе), кроме последней...
 
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!