Skip to content

Commit

Permalink
Padaryta su show ir be modal, veikia ir is exe
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernikas committed Oct 7, 2012
1 parent 55bedfb commit 18858b2
Show file tree
Hide file tree
Showing 26 changed files with 114 additions and 42 deletions.
5 changes: 2 additions & 3 deletions ALoader/ALib/ALib.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,12 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_AutoGenVersion>true</VerInfo_AutoGenVersion>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.2.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.2;Comments=</VerInfo_Keys>
<Debugger_RunParams>&quot;d:\DEV\ADS\trunk\ALoader\ALib\Win32\Debug\ALib.dll &quot; Debug</Debugger_RunParams>
<VerInfo_DLL>true</VerInfo_DLL>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.1.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.1;Comments=</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Release>2</VerInfo_Release>
<Manifest_File>None</Manifest_File>
<VerInfo_Release>1</VerInfo_Release>
<Debugger_HostApplication>c:\Windows\System32\rundll32.exe</Debugger_HostApplication>
<DCC_RemoteDebug>false</DCC_RemoteDebug>
</PropertyGroup>
Expand Down
15 changes: 9 additions & 6 deletions ALoader/ALib/ALib.dproj.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
<BorlandProject>
<Transactions>
<Transaction>1899.12.30 00:00:00.000.518,=C:\Users\User\Documents\RAD Studio\Projects\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.975,=D:\DEV\ADS\trunk\ALoader\ALib\ALib.todo</Transaction>
<Transaction>1899.12.30 00:00:00.000.645,=C:\Users\User\Documents\RAD Studio\Projects\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.262,D:\DEV\ADS\trunk\ALoader\ALib\MainFRM.pas=D:\DEV\ADS\trunk\ALoader\ALib\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.153,=C:\Users\User\Documents\RAD Studio\Projects\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.645,=C:\Users\User\Documents\RAD Studio\Projects\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.463,D:\DEV\ADS\trunk\ALoader\ALib\ALib.dproj=C:\Users\User\Documents\RAD Studio\Projects\Project1.dproj</Transaction>
<Transaction>1899.12.30 00:00:00.000.757,=D:\DEV\ADS\trunk\ALoader\ALib\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.262,D:\DEV\ADS\trunk\ALoader\ALib\Unit1.pas=D:\DEV\ADS\trunk\ALoader\ALib\MainFRM.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.463,C:\Users\User\Documents\RAD Studio\Projects\Project1.dproj=D:\DEV\ADS\trunk\ALoader\ALib\ALib.dproj</Transaction>
<Transaction>1899.12.30 00:00:00.000.262,D:\DEV\ADS\trunk\ALoader\ALib\Unit1.dfm=D:\DEV\ADS\trunk\ALoader\ALib\MainFRM.dfm</Transaction>
</Transactions>
<Transaction>1899.12.30 00:00:00.000.975,=D:\DEV\ADS\trunk\ALoader\ALib\ALib.todo</Transaction>
<Transaction>1899.12.30 00:00:00.000.262,D:\DEV\ADS\trunk\ALoader\ALib\MainFRM.dfm=D:\DEV\ADS\trunk\ALoader\ALib\Unit1.dfm</Transaction>
</Transactions> <ProjectSortOrder AutoSort="0" SortType="0">
<File Path="MainFRM.pas"/>
<File Path="MainFRM.dfm"/>
</ProjectSortOrder>
</BorlandProject>
Binary file modified ALoader/ALib/ALib.res
Binary file not shown.
Binary file modified ALoader/ALib/DLL_Loader/Win32/Debug/DLL_Loader.exe
Binary file not shown.
Binary file modified ALoader/ALib/DLL_Loader/Win32/Debug/FastMM4.dcu
Binary file not shown.
Binary file modified ALoader/ALib/DLL_Loader/Win32/Debug/FastMM4Messages.dcu
Binary file not shown.
Binary file modified ALoader/ALib/DLL_Loader/Win32/Debug/Unit2.dcu
Binary file not shown.
9 changes: 6 additions & 3 deletions ALoader/ALib/MainFRM.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ object frmMain: TfrmMain
object WB1: TEmbeddedWB
Left = 0
Top = 0
Width = 0
Height = 0
Width = 751
Height = 403
Align = alClient
TabOrder = 0
Silent = False
RegisterAsBrowser = True
OnNavigateComplete2 = WB1NavigateComplete2
OnDocumentComplete = WB1DocumentComplete
DisableCtrlShortcuts = 'N'
UserInterfaceOptions = [EnablesFormsAutoComplete, EnableThemes]
Expand All @@ -164,6 +165,8 @@ object frmMain: TfrmMain
'<HTML></HTML>')
PrintOptions.Footer = '&u&b&d'
PrintOptions.Orientation = poPortrait
ExplicitWidth = 100
ExplicitHeight = 100
ControlData = {
4C000000D5440000CB2400000000000000000000000000000000000000000000
000000004C000000000000000000000001000000E0D057007335CF11AE690800
Expand Down
127 changes: 97 additions & 30 deletions ALoader/ALib/MainFRM.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface
uses
FastMM4, Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.OleCtrls, SHDocVw_EWB, EwbCore, EmbeddedWB, Vcl.ComCtrls,
MSHTML_EWB, Winapi.ActiveX;
MSHTML_EWB, Winapi.ActiveX, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, IdSSLOpenSSL;

Type
TAnimal = record
Expand Down Expand Up @@ -43,6 +43,7 @@ TfrmMain = class(TForm)
txtCompany: TEdit;
StatusBar1: TStatusBar;
memResult: TMemo;
ProgressBar1: TProgressBar;
procedure btnSubmitClick(Sender: TObject);
function Get1(ANumber: String): Boolean;
function Get2(ANumber: String): Boolean;
Expand All @@ -53,6 +54,7 @@ TfrmMain = class(TForm)
procedure WB1DocumentComplete(ASender: TObject; const pDisp: IDispatch; var URL: OleVariant);
function NavigateDetail2(AHTML: String): Boolean;
procedure FormCreate(Sender: TObject);
procedure WB1NavigateComplete2(ASender: TObject; const pDisp: IDispatch; var URL: OleVariant);

private
{ Private declarations }
Expand Down Expand Up @@ -86,6 +88,7 @@ function StripHTML(S: string): string;
gloCount, gloCount1: Integer;
gloCompany: String;
gloSearchNumber: String;
gloExecuting: Boolean;

implementation

Expand All @@ -100,41 +103,60 @@ implementation

Function GetData(AUser, APassword, ACompany, ASearchNumber: WideString; out ANumber: WideString): Boolean;
begin
//Laikina
if assigned(frmMain) then
begin
frmMain.WindowState := wsMaximized;
frmMain.Show;
end;

gloCount := 0;
gloCount1 := 0;
// AUser := StrAlloc(MAX_PATH);
// APassword := StrAlloc(MAX_PATH);
// ACompany := StrAlloc(MAX_PATH);
// ASearchNumber := StrAlloc(MAX_PATH);
gloExecuting := True;
try

Result := False;
gloCount := 0;
gloCount1 := 0;
// AUser := StrAlloc(MAX_PATH);
// APassword := StrAlloc(MAX_PATH);
// ACompany := StrAlloc(MAX_PATH);
// ASearchNumber := StrAlloc(MAX_PATH);

if Trim(AUser) <> '' then
gloUser := AUser;
Result := False;

if Trim(APassword) <> '' then
gloPsw := APassword;
if Trim(AUser) <> '' then
gloUser := AUser;

if Trim(ACompany) <> '' then
gloCompany := ACompany;
if Trim(APassword) <> '' then
gloPsw := APassword;

if Trim(ASearchNumber) <> '' then
gloSearchNumber := ASearchNumber;
if Trim(ACompany) <> '' then
gloCompany := ACompany;

if not assigned(frmMain) then
Exit;
if Trim(ASearchNumber) <> '' then
gloSearchNumber := ASearchNumber;

if not assigned(frmMain) then
Exit;

// frmMain.Get1('LT000005816831');
Result := frmMain.Get2(gloSearchNumber);

// StrDispose(AUser);
// StrDispose(APassword);
// StrDispose(ACompany);
// StrDispose(ASearchNumber);
while gloExecuting <> False do
begin
Application.ProcessMessages;
end;

// frmMain.Get1('LT000005816831');
Result := frmMain.Get2(gloSearchNumber);
ANumber := WideString(gloLivestock.Number);
// Laikina
//frmMain.Close;

// StrDispose(AUser);
// StrDispose(APassword);
// StrDispose(ACompany);
// StrDispose(ASearchNumber);
ANumber := WideString('Labas4');
// Laikina
// frmMain.Free;
except
gloExecuting := False;
Abort;
end;
end;

Procedure Debug();
Expand Down Expand Up @@ -329,6 +351,9 @@ function TfrmMain.NavigateDetail2(AHTML: String): Boolean;
APosition, APosition2: Integer;
ATable: TStringList;
i: Integer;
IdHTTP: TIdHTTP;
lIOHandler: TIdSSLIOHandlerSocketOpenSSL;
AHTMLStream: TStringStream;
begin
Result := False;

Expand Down Expand Up @@ -420,7 +445,42 @@ function TfrmMain.NavigateDetail2(AHTML: String): Boolean;
Exit;

{ Open page and wait }
try
IdHTTP := TIdHTTP.Create(nil);
AHTMLStream := TStringStream.Create;
lIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);

IdHTTP.IOHandler := lIOHandler;
IdHTTP.HandleRedirects := True;

IdHTTP.ConnectTimeout := 10000;
IdHTTP.Request.Clear;

IdHTTP.Request.BasicAuthentication := True;
IdHTTP.Request.Username := gloUser;
IdHTTP.Request.Password := gloPsw;

try
IdHTTP.Get(URLMain + AString, AHTMLStream);
gloLivestock.OwnerCode := ParseValue2('Laikytojo kodas:', AHTMLStream.DataString);
gloLivestock.OwnerName := ParseValue2('Laikytojo vardas:', AHTMLStream.DataString);
gloLivestock.HerdCode := ParseValue2('Bandos kodas:', AHTMLStream.DataString);
gloLivestock.HerdAddress := ParseValue2('Bandos adresas:', AHTMLStream.DataString);
memResult.Lines.Add(gloLivestock.OwnerCode);
memResult.Lines.Add(gloLivestock.OwnerName);
memResult.Lines.Add(gloLivestock.HerdCode);
memResult.Lines.Add(gloLivestock.HerdAddress);
gloExecuting := False;
// memResult.Lines.Text:= AHTMLStream.DataString;
except

end;

finally
IdHTTP.free;
lIOHandler.free;
AHTMLStream.free;
end;


// gloLivestock.OwnerCode := ParseValue2('Laikytojo kodas:', WB2.DocumentSource);
Expand All @@ -430,7 +490,7 @@ function TfrmMain.NavigateDetail2(AHTML: String): Boolean;

Result := True;
finally
ATable.Free;
ATable.free;
end;
end;

Expand Down Expand Up @@ -565,10 +625,17 @@ procedure TfrmMain.WB1DocumentComplete(ASender: TObject; const pDisp: IDispatch;
// end;
end;
finally
LStream.Free();
LStream.free();
end;
end;

procedure TfrmMain.WB1NavigateComplete2(ASender: TObject; const pDisp: IDispatch; var URL: OleVariant);
var
a: String;
begin
a := 'a';
end;

function StripHTML(S: string): string;
var
TagBegin, TagEnd, TagLength: Integer;
Expand All @@ -591,6 +658,6 @@ initialization
finalization

CoUninitialize;
frmMain.Free;
frmMain.free;

end.
Binary file modified ALoader/ALib/Win32/Debug/ALib.dll
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/Browse4Folder.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/EWB.IEConst.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/EWBMouseHook.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/EmbeddedWB.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/EwbAcc.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/EwbCore.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/EwbCoreTools.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/EwbFocusControl.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/EwbTools.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/FastMM4.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/FastMM4Messages.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/MainFRM.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/Mshtml_Ewb.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/SHDocVw_EWB.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/SendMail_For_Ewb.dcu
Binary file not shown.
Binary file modified ALoader/ALib/Win32/Debug/Wcrypt2.dcu
Binary file not shown.

0 comments on commit 18858b2

Please sign in to comment.