Autor Beitrag
Maledictus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 21



BeitragVerfasst: Di 29.04.03 09:57 
Hallo Leute,
ich muss schnell nen prog schreiben, was Tasten an Outlook Express 5 sendet.
Meine exportieren funktion ist kaputt, und jetzt will ich alle Dateien einzeln "exportieren".
dazu müsste ich folgendes drücken:
ausblenden Quelltext
1:
2:
3:
4:
5:
[alt]-d       Menü Datei
u             Speichern unter
i             Laufvariable der For Schleife als Dateinamen
[Enter]       Speichern
[Pfeilrunter] nächste Datei.

das ganze soll dann in einer schleife laufen, die das so oft macht, wie ich angebe, also die anzahl der emails in dem ordner...

Danke im voraus.
Maledictus
DaFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 189



BeitragVerfasst: Mi 30.04.03 01:38 
Hi!

Naja, solche Methoden sind nicht gerade die feinsten, aber ich denke das weißt Du schon... Ich erspare Dir (und mir) deshalb die lehrreichen Sprüche, wie sie sonst immer bei solchen Fragen aufkommen...

Versuch es mal damit:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
procedure TForm1.Button1Click(Sender: TObject);
var
  hOE: hWnd;
  cnt: Integer;
begin
  hOE := FindWindow('Outlook Express Browser Class', nil);
  SetForegroundWindow(hOE);

  for cnt := 1 to ? do
  begin
    Keybd_Event(VK_MENU, 0, 0, 0);
    Keybd_Event(Word('D'), 0, 0, 0);
    Keybd_Event(Word('D'), 0, KEYEVENTF_KEYUP, 0);
    Keybd_Event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);

    Keybd_Event(Word('U'), 0, 0, 0);

    Keybd_Event(48 + cnt, 0, 0, 0);

    Keybd_Event(VK_RETURN, 0, 0, 0);

    Keybd_Event(VK_DOWN, 0, 0, 0);
  end;

end;


Gruß,
Markus
Maledictus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 21



BeitragVerfasst: Mi 30.04.03 14:37 
Danke für die Antwort, das funktioniert soweit ganz gut...
Nur leider habe ich mehr als 10 mails in diesem ordner, wie mache ich es, dass der vernünftig weiter nummeriert?

gurss
Maledictus
DaFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 189



BeitragVerfasst: Mi 30.04.03 19:36 
Hi.

Naja, stell' Dir vor du würdest das von Hand machen (das simulieren wir hier ja!). Du musst jede einzelne Zahl, aus der sich cnt zusammensetzt, separat per Keybd_Event() an das Fenster schicken, denn genau das würde auch passieren, wenn Du im Dateinamen-Edit '12345' eingeben würdest.

Gruß,
Markus