Ir para conteúdo
Fórum Script Brasil

Jhonas

Monitores
  • Total de itens

    9.657
  • Registro em

Tudo que Jhonas postou

  1. ok... tente esse exemplo e faça uma mudança no seu código Mudando o valor de uma constante Procedure ChangeConst(const Constant; var Value; Size: Integer); begin Move((@Value)^, (@Constant)^, Size); end; // Como usar ChangeConst: (Exemplo) const TestStrConst: string = 'Este é um exemplo de texto'; TestInteger: Integer = 4367; var NewString: string; NewInteger: Integer; begin // Demo String: ShowMessage('Antes de ChangeConst (TestStrConst): ' + TestStrConst); NewString := 'Novo Valor'; ChangeConst(TestStrConst, NewString, SizeOf(string)); ShowMessage('Após ChangeConst (TestStrConst): ' + TestStrConst); // Demo Integer: ShowMessage('Antes ChangeConst (TestInteger): ' + IntToStr(TestInteger)); NewInteger := 93534; ChangeConst(TestInteger, NewInteger, SizeOf(Integer)); ShowMessage('Após ChangeConst (TestInteger): ' + IntToStr(TestInteger)); end; abraço
  2. exemplo: unit Unit2; interface uses Windows, tlhelp32, SysUtils; const Count = 2; // Cheat count type TMemDump = array[0..31] of Byte; TCheatList = record Offset : Cardinal; MemDump : TMemDump; end; const ProcessesDumps: array[0..Count -1] of TCheatList = ((Offset : $4C8259; //Catastrophe MemDump :($A1, $38, $BD, $4C, $00, $8B, $00, $8B, $4D, $FC, $BA, $C0, $82, $4C, $00, $E8, $1F, $F1, $FF, $FF, $33, $DB, $E8, $F8, $BE, $F3, $FF, $33, $C0, $5A, $59, $59)), (Offset : $4C8259; //Catastrophe MemDump :($7C, $23, $8B, $45, $FC, $80, $38, $C1, $75, $1B, $8B, $45, $FC, $80, $78, $02, $F3, $75, $12, $8B, $45, $FC, $80, $78, $03, $00, $75, $09, $8B, $45, $FC, $80))); implementation function ScanProcessMemory(hProcess: THandle):Boolean; var I: Integer; aTmpBuffer: array[0..31] of Byte; aBytesRead: DWORD; begin for I := 0 to count do begin aBytesRead := 0; ReadProcessMemory(hProcess, Pointer(ProcessesDumps[i].Offset),@aTmpBuffer, SizeOf(aTmpBuffer), aBytesRead); if CompareMem(@aTmpBuffer,@ProcessesDumps[i].MemDump,32) then begin Result := True; Exit; end; end; Result := False; end; procedure SystemProcessesScan; var hProcessSnap, hProcess: THandle; pe32: PROCESSENTRY32; begin hProcessSnap := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if hProcessSnap <> INVALID_HANDLE_VALUE then begin pe32.dwSize := SizeOf(PROCESSENTRY32); if Process32First(hProcessSnap, pe32) then begin repeat hProcess := OpenProcess(PROCESS_ALL_ACCESS, FALSE,pe32.th32ProcessID); if not (hProcess = 0) then begin if (ScanProcessMemory(hProcess)) then begin // do somthing Here! ExitProcess(0); end; end; until not Process32Next(hProcessSnap, pe32); end; CloseHandle(hProcessSnap); end; end; end. abraço
  3. tente ADODataSet1.CommandText := 'SELECT * FROM Alunos WHERE ArteMarcial = '+''''+ComboBox1.Text+''''; abraço
  4. Jhonas

    Supervisorio

    compile esse codigo e voce terá o Proxies.dcu unit Proxies; interface function IsProxyClass(ComponentClass: TClass): Boolean; implementation function IsProxyClass(ComponentClass: TClass): Boolean; begin Result := True; end; end. OBS: Se a versão do procmp11 não for para a versão do seu delphi, voce terá que procurar por outros arquivos abraço
  5. esse componente não existe ... é simplesmente uma montagem de um componente Memo ou outro por cima de uma imagem de fundo ( uma folha de papel continuo) . abraço
  6. veja A,0603.7857,S,04954.3335,000,P,1200,0000,00000 usando o conversor ficaria: 603W 47' 09" , 4954S 20' 01" 0E , 1200S 0E , 0N http://splink.cria.org.br/conversor http://splink.cria.org.br/more_conversor?criaLANG=pt http://www.ufrgs.br/museudetopografia/Arti...m_Geodesico.pdf componente para o delphi http://www.eye4software.com/products/gpstoolkit/ abraço
  7. Jhonas

    Supervisorio

    leia http://www.ramosdainformatica.com.br/art_r...s01.php?CDA=137 http://www.delphibr.com.br/artigos/dsgnIntf_pas.php abraço
  8. veja http://www.freegis.org/database/?cat=12 outras sugestões http://scriptbrasil.com.br/forum/index.php...st&p=469813 http://www.devmedia.com.br/post-5540-Usand...o-delphi-7.html abraço
  9. Jhonas

    Supervisorio

    tente esses http://www.etsimo.uniovi.es/delphi/ftp/d10free/procmp11.zip http://www.etsimo.uniovi.es/delphi/ftp/d10free/procomps.zip abraço
  10. é extamente isso que o código faz... o evento OnDrawColumnCell fica num loop infinito, então qualquer mudança de condição no campo, altera a cor do resgistro desse campo. abraço
  11. leia com calma os artigos sobre o assunto http://www.delphibr.com.br/artigos/transacoes.php http://www.ramosdainformatica.com.br/ser_n...hp?DTN=25022009 abraço
  12. Há uma propriedade do Quick Report - PrinterSettings - coloque a opção Duplex para true e se na impressora a opção frente e verso estiver ativada o relatório sairá frente e verso. OBS: nem todas as impressoras podem imprimir duplex ... nesse caso voce vai encontrar em proriedades da impressora > padrões de impressão > Acabamento > Imprimir dos dois lados ( Manualmente ) abraço
  13. tente no evento OnActive do Form: procedure TForm1.FormActivate(Sender: TObject); begin if datamodule2.ADOTable1.IsEmpty then button6.Enabled:=false; end; abraço
  14. exemplo: procedure Tfrmpagamentos.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin ShowScrollBar(dbgrid1.handle, SB_VERT, true); if (Column.FieldName = 'estado') then begin if Query1.FieldByName('estado').Value = 'A' then begin DBGrid1.Canvas.Font.Color := clRed; DBGrid1.Canvas.FillRect(Rect); DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State); end else begin DBGrid1.Canvas.Font.Color := clBlack; DBGrid1.Canvas.FillRect(Rect); DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State); end; end; end; avraço
  15. OK.. o código abaixo irá ler esse arquivo e jogará para um Memo, mas voce terá que usar um botão ou um timer para fazer a atualização da leitura unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids; type TForm1 = class(TForm) Button1: TButton; Memo1: TMemo; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var vFileList : TStringList; vFileStream : TStream; i : integer; begin vFileList := TStringList.Create; try Memo1.Clear; vFileStream := TFileStream.Create('C:\Arquivos de Programas\PokerStars\PokerStars.log.0', fmShareDenyNone); vFileList.LoadFromStream(vFileStream); vFileStream.Destroy; for i := 1 to vFileList.Count - 1 do Memo1.Lines.Append(vFileList.Strings[i]); finally vFileList.Free; end; end; end. abraço
  16. É essa informação que voce quer ler pelo delphi ?
  17. vamos a um exemplo CREATE TABLE tab_nota_fiscal (num_nota INTEGER); INSERT INTO tab_nota_fiscal VALUES (1); INSERT INTO tab_nota_fiscal VALUES (2); INSERT INTO tab_nota_fiscal VALUES (3); INSERT INTO tab_nota_fiscal VALUES (4); INSERT INTO tab_nota_fiscal VALUES (6); INSERT INTO tab_nota_fiscal VALUES (7); INSERT INTO tab_nota_fiscal VALUES (8); INSERT INTO tab_nota_fiscal VALUES (9); seria o mesmo que var a : integer; begin for a := 1 to 9 do begin SQLQuery1.Close; SQLQuery1.SQL.Clear; SQLQuery1.SQL.Add('INSERT INTO tab_nota_fiscal VALUES ('+a+')'); SQLQuery1.ExecSQL; end; end; abraço
  18. entendi... mas preciso de um programa que fique gerando o arquivo de log para poder efetuar a sua leitura
  19. veja http://indy.fulgan.com/ZIP/ abraço
  20. preciso de um exemplo pratico, para poder ajuda-lo
  21. voce tem que colocar uma rotina em um botão, para fazer esse arredondamento ... esse botão poderá ficar invisivel, e voce poderá acioná-lo quando for necessario abraço
  22. Jhonas

    Combobox

    sugestão: troque o componente e execute o Build All Projects abraço
  23. Oi Y4H1KO ou seria perobaferr ( forum active ) ... rs exemplo: procedure TForm1.Button1Click(Sender: TObject); var Prog: string; ProgC: PAnsiChar; Handle: THandle; rect: TRect; begin Prog := 'c:\calc.exe'; ProgC:= PAnsiChar(Prog); Handle := FindWindow(nil, 'Calculadora'); if Handle > 0 then Windows.SetParent(Handle, Form1.Handle) else begin WinExec(ProgC, SW_SHOWDEFAULT); Handle := FindWindow(nil, 'Calculadora'); if Handle > 0 then Windows.SetParent(Handle, Form1.Handle); end; if Handle > 0 then begin Windows.GetWindowRect(Handle, rect); // Pega a posição da calculadora Windows.MoveWindow(Handle, Form1.ClientHeight div 4, Form1.ClientWidth div 26 , rect.right-rect.left, rect.bottom-rect.top, true); // Move a posição da calculadora end; end; Faça as mudanças necessarias para o seu uso abraço
  24. var f:TextFile; Linha:String; begin AssignFile(f, 'Caminho do Arquivo.txt'); Reset(f); While not Eof(f) do Readln(f, Linha); CloseFile(f); end; quando voce quer ler um arquivo que esta sendo usado por outro programa, voce só poderá fazer isso se for somente para leitura. o comando Reset vai fechar e abrir o arquivo em modo exclusivo ( para leitura e escrita ) por isso acontece o erro: I/O ERROR 32. Ao tentar carregar o arquivo pelo Memo tambem não é possivel memo1.lines.LoadFromFile( 'c:\dirname\filename.txt'); "Cannot open File "C:\endereço_do_arquivo". O arquivo já está sendo usado por outro processo. Uma solução possivel seria, tentar abrir o arquivo mudando o seu atributo para somente leitura var f:TextFile; Linha:String; begin AssignFile(f, 'Caminho do Arquivo.txt'); FileMode := fmOpenRead or fmShareDenyNone; // atributo do arquivo Reset(f); While not Eof(f) do Readln(f, Linha); CloseFile(f); end; outro exemplo var f: textfile; s: string; xx: integer; begin getregistryvalue; Assignfile(F, 'Caminho do Arquivo.log'); FileMode := fmOpenRead or fmShareDenyNone; reset(F); repeat ReadLn(F, S); if (Pos('test', S) <> 0) then xx :=xx+1; until EOF(F); Closefile(F); label1.caption:=inttostr(xx); end; abraço
×
×
  • Criar Novo...