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

•  DeLiKaTeS Tetris (Тетрис)  3 601

•  TDictionary Custom Sort  5 739

•  Fast Watermark Sources  5 538

•  3D Designer  8 098

•  Sik Screen Capture  5 844

•  Patch Maker  6 328

•  Айболит (remote control)  6 316

•  ListBox Drag & Drop  5 180

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

•  Графические эффекты  6 509

•  Рисование по маске  5 572

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

•  Canvas Drawing  5 080

•  Рисование Луны  4 805

•  Поворот изображения  4 351

•  Рисование стержней  3 064

•  Paint on Shape  2 300

•  Генератор кроссвордов  3 170

•  Головоломка Paletto  2 496

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

•  Пазл Numbrix  2 152

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

•  Игра HIP  1 772

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

•  Симулятор лифта  2 024

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

•  Генератор лабиринта  2 189

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

•  HEX View  2 174

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

 
скрыть

  Форум  

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

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



Delphi Sources

Получить текст заголовка определенного окна



Оформил: DeeCo

// This example will show you a faster method how you can obtain 
// the text of the specified window's title bar under Windows NT/2000 systems. 
// (c)1999 Ashot Oganesyan K, SmartLine, Inc 
// mailto:ashot@aha.ru, http://www.protect-me.com, http://www.codepile.com 

// The function copies the text of the specified window's title bar 
// (if it has one) into a buffer. The InternalGetWindowText function is 
// much faster than the documented GetWindowText because it uses INT 2E interrupt 

// NT-Specific! 
// Here is the prototype for InternalGetWindowText: 

 (*
   InternalGetWindowText(
   hWnd: HWND;  {a handle to a window or control with text}
   lpString: PChar;  {a pointer to a buffer to receive the string (UNICODE!!!)}
   nMaxCount: Integer  {the maximum number of characters to copy}
   ): Integer;  {returns the length of the copied string}
 *)


 function NT_InternalGetWindowText(Wnd: HWND): string;
 type
   TInternalGetWindowText = function(Wnd: HWND; lpString: PWideChar;
     nMaxCount: Integer): Integer;
    stdcall;
 var
   hUserDll: THandle;
   InternalGetWindowText: TInternalGetWindowText;
   lpString: array[0..MAX_PATH] of WideChar; //Buffer for window caption 
  oemStr: PChar;
 begin
   Result   := '';
   hUserDll := GetModuleHandle('user32.dll');
   if (hUserDll > 0) then
   begin @InternalGetWindowText := GetProcAddress(hUserDll, 'InternalGetWindowText');
     if Assigned(InternalGetWindowText) then
     begin
       InternalGetWindowText(Wnd, lpString, SizeOf(lpString));
       Result := string(lpString);
     end;
   end;
 end;

 procedure TForm1.Button1Click(Sender: TObject);
 begin
   ShowMessage(NT_InternalGetWindowText(Form1.Handle));
 end;




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

Image2Text (изображение в текст)

Генератор текстур

TextureGen (генератор текстур)

Текст Drag & Drop

 

Текст по синусоиде

Текст внутри файла

Зеркальный текст

Посторонние окна WinAPI

 



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

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