Bonjour à Tous,

voilà j'ai créé une appli pour scanner des documents et les envoyer pas mail et sur un ftp directement....elle marche tres bien sous windows XP.
Pour Seven j'ai recupéré le composant Delphitwain2009 et j'ai un p'tit probléme sur un type de scanner (BROTHER MFC)
une fois les feuilles scannées par le chargeur...ça boucle constamment comme-c'il n'y avait pas de retour de l'interface du scanner.

voici mon code qui lance :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
      DelphiTwain1.Source[CurrentSource].EnableSource(True, FALSE);
      while DelphiTwain1.Source[CurrentSource].Enabled do Application.ProcessMessages;
      //Unload library
      DelphiTwain1.UnloadLibrary;
et voici le code qui boucle.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function VirtualWinProc(Handle: THandle; uMsg: UINT; wParam: WPARAM;
  lParam: LPARAM): LResult; stdcall;

  {Returns the TDelphiTwain object}
  function Obj: TDelphiTwain;
  begin
    Longint(Result) := GetWindowLong(Handle, GWL_USERDATA);
  end {function};

var
  Twain: TDelphiTwain;
  i    : Integer;
  Msg  : TMsg;
begin
  {Tests for the message}
  case uMsg of
    {Creation of the window}
    WM_CREATE:
      {Stores the TDelphiTwain object handle}
      with pCreateStruct(lParam)^ do
        SetWindowLong(Handle, GWL_USERDATA, Longint(lpCreateParams));
    {case} else
    begin
      {Try to obtain the current object pointer}
      Twain := Obj;
      if Assigned(Twain) then
        {If there are sources loaded, we need to verify}
        {this message}
       if (Twain.SourcesLoaded > 0) then
        begin
          {Convert parameters to a TMsg}
          Msg := MakeMsg(Handle, uMsg, wParam, lParam);
          {Tell about this message}
          FOR i := 0 TO Twain.SourceCount - 1 DO
            if ((Twain.Source[i].Loaded) and (Twain.Source[i].Enabled)) then
              if Twain.Source[i].ProcessMessage(Msg) then
              begin
                {Case this was a message from the source, there is}
                {no need for the default procedure to process}
                Result := 0;
                Exit;
              end;

        end {if (Twain.SourcesLoaded > 0)}
    end {case Else}
  end {case uMsg of};

  {Calls method to handle}
  Result := DefWindowProc(Handle, uMsg, wParam, lParam);
end;
si quelqu'un a une idée je suis preneur car je n'y arrive pas là.....

MERCI d'avance.

JC