Недавно добавленные исходники

•  TDictionary Custom Sort  3 223

•  Fast Watermark Sources  2 989

•  3D Designer  4 750

•  Sik Screen Capture  3 259

•  Patch Maker  3 466

•  Айболит (remote control)  3 526

•  ListBox Drag & Drop  2 903

•  Доска для игры Реверси  80 760

•  Графические эффекты  3 842

•  Рисование по маске  3 171

•  Перетаскивание изображений  2 544

•  Canvas Drawing  2 672

•  Рисование Луны  2 500

•  Поворот изображения  2 091

•  Рисование стержней  2 119

•  Paint on Shape  1 523

•  Генератор кроссвордов  2 181

•  Головоломка Paletto  1 730

•  Теорема Монжа об окружностях  2 157

•  Пазл Numbrix  1 649

•  Заборы и коммивояжеры  2 016

•  Игра HIP  1 262

•  Игра Go (Го)  1 200

•  Симулятор лифта  1 421

•  Программа укладки плитки  1 177

•  Генератор лабиринта  1 512

•  Проверка числового ввода  1 297

•  HEX View  1 466

•  Физический маятник  1 322

•  Задача коммивояжера  1 357

 
скрыть


Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Переслать данные в другую программу методом Drag-and-Drop



Оформил: DeeCo

// Autor: Hagen Reddmann

         uses
   ShellAPI;

 function MakeDrop(const FileNames: array of string): THandle;
 // Creates a hDrop Object 
// erzeugt ein hDrop Object 
var
   I, Size: Integer;
   Data: PDragInfoA;
   P: PChar;
 begin
   // Calculate memory size needed 
  // berechne notwendig Speichergro?e 
  Size := SizeOf(TDragInfoA) + 1;
   for I := 0 to High(FileNames) do
     Inc(Size, Length(FileNames[I]) + 1);
   // allocate the memory 
  // alloziere den speicher 
  Result := GlobalAlloc(GHND or GMEM_SHARE, Size);
   if Result <> 0 then
   begin
     Data := GlobalLock(Result);
     if Data <> nil then
       try
         // fill up with data 
        // fulle daten 
        Data.uSize := SizeOf(TDragInfoA);
         P  := PChar(@Data.grfKeyState) + 4;
         Data.lpFileList := P;
         // filenames at the at of the header (separated with #0) 
        // am ende des headers nun die filenamen getrennt mit #0 
        for I := 0 to High(FileNames) do
         begin
           Size := Length(FileNames[I]);
           Move(Pointer(FileNames[I])^, P^, Size);
           Inc(P, Size + 1);
         end;
       finally
         GlobalUnlock(Result);
       end
     else
     begin
       GlobalFree(Result);
       Result := 0;
     end;
   end;
 end;

 function MyEnum(Wnd: hWnd; Res: PInteger): Bool; stdcall;
 // search for a edit control with classname 'TEditControl' 
// suche ein child fenster mit klassennamen 'TEditControl' 
var
   N: string;
 begin
   SetLength(N, MAX_PATH);
   SetLength(N, GetClassName(Wnd, Pointer(N), Length(N)));
   Result := AnsiCompareText('TEditControl', N) <> 0;
   if not Result then Res^ := Wnd;
 end;

 // Example: Open msdos.sys in Delphi's Editor window 
// Beispiel: msdos.sys im Delphi Editor offnen 
procedure TForm1.Button1Click(Sender: TObject);
 var
   Wnd: HWnd;
   Drop: hDrop;
 begin
   // search for Delphi's Editor 
  // suche Delphis Editor Fenster 
  EnumChildWindows(FindWindow('TEditWindow', nil), @MyEnum, Integer(@Wnd));
   if IsWindow(Wnd) then
   begin
     // Delphi's Editor found. Open msdos.sys 
    // Delphis editor gefunden, also offne msdos.sys 
    Drop := MakeDrop(['c:\msdos.sys']);
     if Drop <> 0 then PostMessage(Wnd, wm_DropFiles, Drop, 0);
     // Free the memory? 
    // Speicher wieder freigeben? 
    GlobalFree(Drop);
   end;
 end;




Похожие по теме исходники

Сортировка методом Хоара

Текст Drag & Drop

Drag and Drop Text

Quick Drag & Drop

 

Dragster Tree Relay

ListBox Drag & Drop

Backup and Restore

Market Monitoring and Billing

 

Black and White Effects

Sand Dog

Wave and MIDI In-Out

Vista and 7 Sound

 

Improved Buttons and ProgressBar

Desktop Sands

Rotation and Symmetry

Dropper (пипетка Фотошоп)

 



Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте