|
제 생각엔 Cursor위치에 있는 Window의 Class 명을 읽어 오는 기능 같은데....
원하는 기능인지 모르겠군요.
Form에 TMemo, TSpeedButton 하나씩 두시고
TSpeedButton에 OnMouseDown, OnMouseUp Event 연결하시면 OK
동작은 TSpeedButton을 누른 상태에서 원하는 위치로 Cursor
이동후 마우스 Button을 놓으면 됩니다. 마치 Spy 같이.....
행복하세요.
피 에쓰. 대충 만들어서 혹시 Bug가 있을지 모르겠네요. 그래도 너그러이 .....
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton1MouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y)
{
POINT pt;
HWND hWnd;
char achClass[0x100];
::ReleaseCapture();
::GetCursorPos( &pt );
hWnd = ::WindowFromPoint( pt );
if( hWnd != NULL ) {
int nLen = ::GetClassName( hWnd, achClass, sizeof(achClass) );
if( nLen >= 1 ) {
Memo1->Lines->Add( achClass );
}
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y)
{
::SetCapture( Handle );
}
---------------------------------
백도준 님이 쓰신 글 :
: 예전에 몇년전에 있었던 프로그램인데요..
: 하이텔이나 천리안에서요..
: 마우스를 갔다되면 panel인지 richedit 인지, 기타등등 무슨 속성인지..
: spy류의 프로그램인데.. 갑자기 없어져서 찾을려고 하니까 없네요..
: 혹시 아시는분 있나요? 델파이라 만든 프로그램인것 같던데..
:
|