procedure TFrm_BD_Orga.Select_Module(hApp: HWND; Module: integer);
var I: Integer;
wnd: HWND;
CName:
array [0 .. 255]
of Char;
begin
if hApp = 0
then begin
hApp := FindWindow(
nil, '
Fremdsoftware');
//Handle der Software
GetClassName(hApp, CName, 256);
wnd := FindWindowEx(hApp, 0, CName, '
MenuStrip1');
// Handle des Menüs
end;
PostMessage(wnd, WM_KEYDOWN, VK_F10, 0);
PostMessage(wnd, WM_KEYUP, VK_F10, 0);
PostMessage(wnd, WM_KEYDOWN, VK_RIGHT, 0);
PostMessage(wnd, WM_KEYUP, VK_RIGHT, 0);
for I := 0
to Module -1
do begin
PostMessage(wnd, WM_KEYDOWN, VK_Down, 0);
PostMessage(wnd, WM_KEYUP, VK_Down, 0);
end;
PostMessage(wnd, WM_KEYDOWN, VK_RETURN, 0);
PostMessage(wnd, WM_KEYUP, VK_RETURN, 0);
end;