loading...
مرجع مهندسی نرم افزار
آخرین ارسال های انجمن
حامد شیرزاد بازدید : 1131 شنبه 03 دی 1390 نظرات (0)
procedure TForm1.Button1Click(Sender: TObject) ;
 
  function FuncAvail(dllName, funcName: string; var p: pointer): boolean;
  var
    lib: THandle;
  begin
    result := false;
    p := nil;
    if LoadLibrary(PChar(dllName)) = 0 then exit;
    lib := GetModuleHandle(PChar(dllName)) ;
    if lib <> 0 then
    begin
     p := GetProcAddress(lib, PChar(funcName)) ;
     if p <> nil then Result := true;
    end;
  end;
 
  var
    BlockInput : function(Block: BOOL): BOOL; stdcall;
 
  begin
   if FuncAvail('USER32.DLL', 'BlockInput', @BlockInput) then
   begin
    ShowMessage('Your Mouse and Keyboard will be blocked for 5 seconds!') ;
    BlockInput(true) ;
    Sleep(5000) ;
    BlockInput(false) ;
   end;
  end;
 
end.

حامد شیرزاد بازدید : 766 شنبه 03 دی 1390 نظرات (0)
{We'll need several global variables}
var
    Form1: TForm1;
    StartButton : hWnd;
    OldBitmap : THandle;
    NewImage : TPicture;
...
{Now, we put this code in the
OnCreate event of the form:}
 
procedure TForm1.FormCreate(Sender: TObject) ;
begin
  NewImage:=TPicture.create;
  NewImage.LoadFromFile('C:WindowsCircles.BMP') ;
  StartButton := FindWindowEx
                  (FindWindow(
                     'Shell_TrayWnd', nil),
                      0,'Button', nil) ;
   OldBitmap:=SendMessage(StartButton,
                          BM_SetImage, 0,
                          NewImage.Bitmap.Handle) ;
  end;
...
{And this other in the OnDestroy:}
 
  procedure TForm1.FormDestroy(Sender: TObject) ;
  begin
   SendMessage(StartButton,BM_SetImage,0,OldBitmap) ;
   NewImage.Free;
  end;

حامد شیرزاد بازدید : 1023 چهارشنبه 23 آذر 1390 نظرات (0)
function CountFiles(const APath, AWildCard: string): Int64;
var
  ReturnCode: Integer;            // result of FindFirst and FindNext routines
  SearchRec: SysUtils.TSearchRec; // carries info about file search
begin
  Result := 0;
  ReturnCode := SysUtils.FindFirst(
    DirToPath(APath) + AWildCard, SysUtils.faAnyFile, SearchRec
  );
  try
    while ReturnCode = 0 do
    begin
      if not IsFlagSet(SearchRec.Attr, SysUtils.faDirectory) and
        (SearchRec.Name <> '.') and
        (SearchRec.Name <> '..') then
        Inc(Result);
      ReturnCode := SysUtils.FindNext(SearchRec);
      ProcessMessages;
    end;
  finally
    SysUtils.FindClose(SearchRec);
  end;
end;

 

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

درباره ما
به نام آنکه جان را فکرت آموخت در این وبلاگ سعی می شود به صورت تخصصی به مباحث مربوط به مهندسی نرم افزار به خصوص برنامه نویسی کامپیوتری پرداخته شود. مدیر وبلاگ : حامد شیرزاد
اطلاعات کاربری
  • فراموشی رمز عبور؟
  • آمار سایت
  • کل مطالب : 431
  • کل نظرات : 9
  • افراد آنلاین : 3
  • تعداد اعضا : 109
  • آی پی امروز : 29
  • آی پی دیروز : 8
  • بازدید امروز : 32
  • باردید دیروز : 9
  • گوگل امروز : 0
  • گوگل دیروز : 0
  • بازدید هفته : 98
  • بازدید ماه : 772
  • بازدید سال : 45,150
  • بازدید کلی : 710,325
  • کدهای اختصاصی

    قالب وبلاگ