Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.11 KB | None | 0 0
  1. unit Unit4;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls, ExtDlgs, Shellapi,FileCtrl;
  8.  
  9. type
  10.   TForm4 = class(TForm)
  11.     Memo1: TMemo;
  12.     Button1: TButton;
  13.     Button2: TButton;
  14.     Button4: TButton;
  15.     OpenDialog1: TOpenDialog;
  16.     SaveDialog1: TSaveDialog;
  17.     procedure Button4Click(Sender: TObject);
  18.     procedure Button1Click(Sender: TObject);
  19.   private
  20.     { Private-Deklarationen }
  21.   public
  22.     { Public-Deklarationen }
  23.   end;
  24.  
  25. var
  26.   Form4: TForm4;
  27.  
  28. implementation
  29.  
  30. {$R *.dfm}
  31.  
  32. procedure TForm4.Button1Click(Sender: TObject);
  33. var sou : Pwidechar;
  34. sou2 : widestring;
  35. begin
  36. new(sou);
  37. if savedialog1.Execute then
  38. begin
  39. Memo1.Lines.SaveToFile(savedialog1.FileName + '.java');
  40. sou2 := ExtractFilePath(SaveDialog1.FileName);
  41. sou := Pwidechar(sou2);
  42. end;
  43. ShellExecute(Application.Handle, 'open', 'C:\Windows\System32\cmd.exe', nil, sou , SW_SHOWNORMAL);
  44. dispose(sou);
  45. end;
  46.  
  47. procedure TForm4.Button4Click(Sender: TObject);
  48. begin
  49. if opendialog1.Execute then Memo1.Lines.LoadFromFile(opendialog1.FileName);
  50.  
  51. end;
  52.  
  53. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement