::: µ¨ÆÄÀÌ Tip&Trick :::

µ¨ÆÄÀÌ Tip&Trick ¼º°Ý¿¡ ¸ÂÁö ¾Ê´Â ±¤°í,ºñ¹æ,Áú¹®ÀÇ ±ÛÀº Áï½Ã »èÁ¦Çϸç
³»¿ëÀ» º¹»çÇÏ¿© »ç¿ëÇÒ °æ¿ì ¹Ýµå½Ã ÀÌ°÷(http://www.howto.pe.kr)À» Ãâó·Î ¸í½ÃÇÏ¿© ÁÖ¼¼¿ä


Category

  ±è¿µ´ë(2004-07-24 22:35:09, Hit : 13909, Vote : 4204
 http://www.howto.pe.kr
 ¸¶¿ì½º ¾Æ·¡ÀÇ À©µµ¿ì ÇÚµé ±¸Çϱâ

// ¾Æ·¡Ã³·³ ŸÀ̸Ӹ¦ »ç¿ëÇÏÁö ¾Ê°í ¸¶¿ì½º ÈÄÅ·À» »ç¿ëÇϸé Á»´õ °£°áÇÑ ÇÁ·Î±×·¥À» ¸¸µé ¼ö ÀÖ½À´Ï´Ù
// SetWindowsHookEx(WH_MOUSE,...) ¸¦ ã¾Æº¸¼¼¿ä

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

const
  PROCESS_MURDER = $0001;
  
var
  Form1: TForm1;

implementation

{$R *.dfm}

function ForceForegroundWindow(hwnd: THandle): boolean;
const
  SPI_GETFOREGROUNDLOCKTIMEOUT = $2000;
  SPI_SETFOREGROUNDLOCKTIMEOUT = $2001;
var
  ForegroundThreadID: DWORD;
  ThisThreadID: DWORD;
  timeout: DWORD;
begin
  if IsIconic(hwnd) then
    ShowWindow(hwnd, SW_RESTORE);
  if GetForegroundWindow = hwnd then
    Result := true
  else
  begin
    {Windows 98/2000 doesn't want to foreground a window when some
    other window has keyboard focus}
    if ((Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MajorVersion > 4))
       or ((Win32Platform = VER_PLATFORM_WIN32_WINDOWS) and ((Win32MajorVersion > 4)
       or ((Win32MajorVersion = 4) and (Win32MinorVersion > 0)))) then
    begin
      {Code from Karl E. Peterson, www.mvps.org/vb/sample.htm
      Converted to Delphi by Ray Lischner
      Published in The Delphi Magazine 55, page 16}
      Result := false;
      ForegroundThreadID := GetWindowThreadProcessID(GetForegroundWindow,nil);
      ThisThreadID := GetWindowThreadProcessId(hwnd,nil);
      if AttachThreadInput(ThisThreadID, ForegroundThreadID, true) then
      begin
        BringWindowToTop(hwnd);  {IE 5.5 related hack}
        SetForegroundWindow(hwnd);
        AttachThreadInput(ThisThreadID, ForegroundThreadID, false);
        Result := (GetForegroundWindow = hwnd);
      end;
      if not Result then
      begin
        {Code by Daniel P. Stasinski}
        SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, @timeout, 0);
        SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, TObject(0),
                                                     SPIF_SENDCHANGE);
        BringWindowToTop(hwnd);  {IE 5.5 related hack}
        SetForegroundWindow(hWnd);
        SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, TObject(timeout),
                                                     SPIF_SENDCHANGE);
      end;
    end
    else
    begin
      BringWindowToTop(hwnd);  {IE 5.5 related hack}
      SetForegroundWindow(hwnd);
    end;
    Result := (GetForegroundWindow = hwnd);
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ForceForegroundWindow(Self.Handle);
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
  APoint: TPoint;
  AHwnd: HWND;
  c, P: array[0..256] of Char;
begin
  GetCursorPos(APoint);
  AHwnd := WindowFromPoint(APoint);

  P[0] := #0;
  GetWindowText(AHwnd, P, 255); {window's title bar¸¦ ¾Ë¾Æ³½´Ù}
  if (P[0] <> #0) then
  begin
    Memo1.Lines.Add(P);

    if GetClassName(AHwnd, c, SizeOf(c)) > 0 Then
      Memo1.Lines.Add(c);
  end;
end;

end.





211   [À©µµ¿ìÁî API] ÄÞÆ÷³ÍÆ®ÀÇ Hint ¿¡ ±×¸²(Bitmap) ³Ö±â  ±è¿µ´ë 2003/04/11 5613 1417
210   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] Å°º¸µåÀÇ Shift+Tab ÀÌ ´­¸°°Íó·³ ó¸®ÇÏ±â  ±è¿µ´ë 2003/04/14 5052 1339
209   [À©µµ¿ìÁî API] ÆûÀÌ Minimized µÇ¾úÀ»¶§ ±ô¹ÚÀÌ°Ô Çϱâ 2  ±è¿µ´ë 2003/04/14 6469 1369
208   [COM/OLE] ±×¸®µå ÀÚ·á ¿¢¼¿·Î Á»´õ ºü¸£°Ô º¸³»±â  °ø¼ºÈ¯ 2003/04/16 5889 1027
207   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] C¿¡¼­ ÇѱÛÀÚ¸£±â  °ø¼ºÈ¯ 2003/04/16 5147 1028
206   [COM/OLE] ±âÁ¸ Excel ¹®¼­ ºÒ·¯¿Í¼­ ÆíÁýÈÄ ÀúÀåÇÏ±â  ±è¿µ´ë 2003/04/18 5850 1356
205   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] thread-safe Queue ±¸Çö  ±è¿µ´ë 2003/08/18 6658 1446
204   [¾Ë°í¸®Áò] ¼ýÀÚ¸¦ KB, MB, GB ´ÜÀ§·Î ȯ»êÇÏ±â  ±è¿µ´ë 2003/11/13 5350 1213
203   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] StrToFloatDef  ±è¿µ´ë 2003/11/13 5295 1285
202   [¾Ë°í¸®Áò] ±¸ºÐÀÚ(delimiter)¸¦ »ç¿ëÇÑ ¹®ÀÚ¿­ ÆĽÌ(parsing)  ±è¿µ´ë 2003/11/13 5466 1182
201   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] thread-safe Queue¸¦ ÀÌ¿ëÇÑ TLogThread  ±è¿µ´ë 2003/11/18 5116 1186
200   [³×Æ®¿÷/ÀÎÅͳÝ] IOCP(I/O Completion Port) class  ±è¿µ´ë 2003/11/18 11527 933
199   [³×Æ®¿÷/ÀÎÅͳÝ] Winsock WriteFile and Overlapped IO  ±è¿µ´ë 2003/11/18 5714 1283
198   [½Ã½ºÅÛ] À©µµ¿ìÁî ¼­ºñ½º ¸ñ·Ï ±¸ÇÏ±â  ±è¿µ´ë 2004/07/22 4964 1289
197   [½Ã½ºÅÛ] À©µµ¿ìÁî ¼­ºñ½º »óÅ ±¸ÇÏ±â  ±è¿µ´ë 2004/07/22 5355 1338
196   [½Ã½ºÅÛ] À©µµ¿ìÁî ¼­ºñ½º ½ÃÀÛ/ÁßÁö ÇÏ±â  ±è¿µ´ë 2004/07/22 6526 1616
195   [½Ã½ºÅÛ] À©µµ¿ìÁî ½Ã½ºÅÛÀÇ ½ºÅ©·Ñ¹Ù µÎ²² ¹Ù²Ù±â  ±è¿µ´ë 2004/07/24 6022 1499
  [½Ã½ºÅÛ] ¸¶¿ì½º ¾Æ·¡ÀÇ À©µµ¿ì ÇÚµé ±¸ÇÏ±â  ±è¿µ´ë 2004/07/24 13909 4204
193   [½Ã½ºÅÛ] ³» ÇÁ·Î±×·¥ÀÇ ½ÇÇà ¿ì¼±¼øÀÇ ¹Ù²Ù±â  ±è¿µ´ë 2004/07/24 5448 1457
192   [À©µµ¿ìÁî API] ³» ÇÁ·Î±×·¥ÀÇ È­¸éÀ» °¡¸®´Â ÇÁ·Î±×·¥ ¸®½ºÆ®  ±è¿µ´ë 2004/07/24 4948 1275
191   [À©µµ¿ìÁî API] Taskbar ÀÇ Æ¯Á¤ À§Ä¡¿¡ popup ¸Þ´º ¶ç¿ì±â  ±è¿µ´ë 2004/07/24 4945 1276
190   [À©µµ¿ìÁî API] Taskbar ÀÇ À§Ä¡ ÃßÀûÇÏ±â  ±è¿µ´ë 2004/07/24 4459 1121
189   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] À©µµ¿ìÁî"½ÃÀÛ" ¹öÆ°À§¿¡ ±Û¾¾ ¾²±â  ±è¿µ´ë 2004/07/24 4441 1203
188   [½Ã½ºÅÛ] Á¦¾îÆÇÀÇ ¸ðµç applet Á¤º¸ ±¸ÇÏ±â  ±è¿µ´ë 2004/07/24 4750 1188
187   [À©µµ¿ìÁî API] ¹Ù·Î Á÷Àü¿¡ active µÇ¾ú´ø À©µµ¿ì¿Í ÄÜÆ®·Ñ ±¸ÇÏ±â  ±è¿µ´ë 2004/07/24 5000 1230
186   [À©µµ¿ìÁî API] Áö¿øÇÏ´Â Å°º¸µå ÀÔ·Â ¾ð¾î ±¸ÇÏ°í º¯°æÇÏ±â  ±è¿µ´ë 2004/07/24 5080 1354
185   [À©µµ¿ìÁî API] ÇöÀç Å°º¸µå ÀÔ·Â ¾ð¾î ±¸ÇÏ±â  ±è¿µ´ë 2004/07/24 5406 1426
184   [COM/OLE] À©µµ¿ìÁî "ÀÛ¾÷ Ç¥½ÃÁÙ ¹× ½ÃÀÛ ¸Þ´º µî·Ï Á¤º¸" È­¸é  ±è¿µ´ë 2004/07/25 6332 1692
183   [COM/OLE] À©µµ¿ìÁî "ÀÎÅÍ³Ý µî·Ï Á¤º¸" È­¸é  ±è¿µ´ë 2004/07/25 4493 1377
182   [COM/OLE] À©µµ¿ìÁî "³¯Â¥/½Ã°£ µî·Ï Á¤º¸" È­¸é  ±è¿µ´ë 2004/07/25 6616 1707
181   [COM/OLE] À©µµ¿ìÁî "°Ë»ö: ÆÄÀÏ ¶Ç´Â Æú´õ" È­¸é  ±è¿µ´ë 2004/07/25 5195 1436
180   [COM/OLE] À©µµ¿ìÁî "½Ã½ºÅÛ Á¾·á" È­¸é  ±è¿µ´ë 2004/07/25 4838 1354
179   [COM/OLE] À©µµ¿ìÁî "¸ðµç âÀ» ÃÖ¼ÒÈ­"  ±è¿µ´ë 2004/07/25 6517 1769
178   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TList ¸¦ ÀÌ¿ëÇÑ stack ±¸Á¶ ±¸Çö  ±è¿µ´ë 2004/07/25 4655 1221
177   [À©µµ¿ìÁî API] Æû¿¡ ¾Ö´Ï¸ÞÀÌ¼Ç È¿°ú ÁÖ±â  ±è¿µ´ë 2004/07/25 5129 1307
176   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¸ð¼­¸®°¡ µÕ±Ù(rounded ends) TMemo ¸¸µé±â  ±è¿µ´ë 2004/07/25 4957 1228
175   [½Ã½ºÅÛ] ·ÎÄà °¡»ó µå¶óÀ̹ö(substitution device) ¸¸µé°í Á¦°ÅÇÏ±â  ±è¿µ´ë 2004/07/25 8504 1425
174   [³×Æ®¿÷/ÀÎÅͳÝ] ³×Æ®¿öÅ© µå¶óÀÌºê ¿¬°á È­¸é ¶ç¿ì±â  ±è¿µ´ë 2004/07/26 6254 1652
173   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TProgressbar ÀÇ »ö»ó ¹Ù²Ù±â  ±è¿µ´ë 2004/07/26 4864 1267
172   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TTrewView, TListView ¸¦ À̹ÌÁö·Î ÀúÀåÇÏ±â  ±è¿µ´ë 2004/07/26 4616 1005

[ÀÌÀü 10°³] [1]..[11][12][13][14][15][16][17][18][19] 20 ..[25] [´ÙÀ½ 10°³]
 

Copyright 1999-2024 Zeroboard / skin by zero