loading...
مرجع مهندسی نرم افزار
آخرین ارسال های انجمن
حامد شیرزاد بازدید : 544 شنبه 21 آبان 1390 نظرات (0)
;
procedure TForm1.Button1Click(Sender: TObject);
var
  SearchRec: TSearchRec;
begin
  if FindFirst('C:WINDOWS*.INI', faAnyFile and not
     (faVolumeID or faDirectory), SearchRec) = 0 then
  begin
    repeat
      // Here we process each fond file.
      // Its info is in SearchRec.
    until FindNext(SearchRec) <;> 0;
    FindClose(SearchRec);
  end;
end;

 

حامد شیرزاد بازدید : 412 شنبه 21 آبان 1390 نظرات (0)
uses Forms, Windows;
procedure TForm1.Button1Click(Sender: TObject);
var
  proc_info: TProcessInformation;
  startinfo: TStartupInfo;
  ExitCode: longword;
begin
  // Initialize the structures
  FillChar(proc_info, sizeof(TProcessInformation), 0);
  FillChar(startinfo, sizeof(TStartupInfo), 0);
  startinfo.cb := sizeof(TStartupInfo);
  // Attempts to create the process
  if CreateProcess('c:windowsnotepad.exe', nil, nil,
      nil, false, NORMAL_PRIORITY_CLASS, nil, nil,
       startinfo, proc_info) <;> False then begin
    // The process has been successfully created
    // No let's wait till it ends...
    WaitForSingleObject(proc_info.hProcess, INFINITE);
    // Process has finished. Now we should close it.
    GetExitCodeProcess(proc_info.hProcess, ExitCode);  // Optional
    CloseHandle(proc_info.hThread);
    CloseHandle(proc_info.hProcess);
    Application.MessageBox(
      PChar(Format('Notepad finished! (Exit code=%d)', [ExitCode])),
      'Info', MB_ICONINFORMATION);
  end else begin
    // Failure creating the process
    Application.MessageBox('Couldn''t execute the '
      + 'application', 'Error', MB_ICONEXCLAMATION);
  end;//if
end;

 

حامد شیرزاد بازدید : 430 شنبه 21 آبان 1390 نظرات (0)
procedure AngleTextOut(ACanvas: TCanvas; Angle, X, Y: Integer; Str: string);
var LogRec: TLogFont;
  OldFontHandle,
  NewFontHandle: hFont;
begin GetObject(ACanvas.Font.Handle, SizeOf(LogRec), Addr(LogRec));
  LogRec.lfEscapement := Angle*10;
  NewFontHandle := CreateFontIndirect(LogRec);
  OldFontHandle := SelectObject(ACanvas.Handle, NewFontHandle);
  ACanvas.TextOut(X, Y, Str);
  NewFontHandle := SelectObject(ACanvas.Handle, OldFontHandle);
  DeleteObject(NewFontHandle);
end;

 

حامد شیرزاد بازدید : 844 شنبه 21 آبان 1390 نظرات (0)
uses ShellAPI;
...
 
if ShellExecute(Form1.Handle, nil,
    'c:windowsgeneral.txt', nil, nil, SW_SHOW) <;= 32 then
  Application.MessageBox('Couldn''t execute the application',
    'Error', MB_ICONEXCLAMATION);
ShellExecute(Form1.Handle, nil, 'c:windowsnotepad.exe',
  'c:windowsgeneral.txt', nil, SW_SHOWMAXIMIZED);
ShellExecute(Form1.Handle, 'open', 'c:windowsnotepad.exe',
  'general.txt', 'c:windows', SW_SHOWNORMAL);
ShellExecute(Form1.Handle, nil, PChar(fname + '.txt'),
  nil, nil, SW_MAXIMIZE);
ShellExecute(Form1.Handle, nil, 'c:windowsnotepad.exe',
  nil, nil, SW_SHOWNORMAL);

 

حامد شیرزاد بازدید : 391 شنبه 21 آبان 1390 نظرات (0)
procedure TForm1.Button1Click(Sender: TObject); 
var 
N : Integer; //Counter 
TL,TT : Integer; //Backup for LEFT and TOP of teh FORM 
begin 
TL := Left; //Backups Left of the Form 
TT := Top; //Backups Top of the Form 
//********************************************************************* 
for N:=1 to 40 do begin //Counter Time 
Left:= (TL-10) + (Random(20)); {Shake Range in Horizontal Driection} 
Top := (TT-10) + (Random(20)); {Shake Range in Vertical Driection} 
end; 
//********************************************************************* 
Left := TL; //Restores Left of the Form 
Top := TT; //Restores Top of the Form 
end;

 

تعداد صفحات : 13

درباره ما
به نام آنکه جان را فکرت آموخت در این وبلاگ سعی می شود به صورت تخصصی به مباحث مربوط به مهندسی نرم افزار به خصوص برنامه نویسی کامپیوتری پرداخته شود. مدیر وبلاگ : حامد شیرزاد
اطلاعات کاربری
  • فراموشی رمز عبور؟
  • آمار سایت
  • کل مطالب : 431
  • کل نظرات : 9
  • افراد آنلاین : 1
  • تعداد اعضا : 109
  • آی پی امروز : 25
  • آی پی دیروز : 185
  • بازدید امروز : 837
  • باردید دیروز : 718
  • گوگل امروز : 0
  • گوگل دیروز : 0
  • بازدید هفته : 1,886
  • بازدید ماه : 4,537
  • بازدید سال : 23,638
  • بازدید کلی : 792,166
  • کدهای اختصاصی

    قالب وبلاگ