|
GetWindowLong API를 사용하여 적당한 속성대로 분리해주면 될 것 같습니다.
cuperido
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
}
//---------------------------------------------------------------------------
BOOL CALLBACK EnumWindowsProc(HWND hdHandle, LPARAM lpParam)
{
char chString[256];
String stString;
LONG lnStyle, lnExStyle;
GetWindowText(hdHandle, chString, sizeof(chString));
stString = chString;
if(stString == "") return(TRUE);
lnStyle = GetWindowLong(hdHandle, GWL_STYLE);
lnExStyle = GetWindowLong(hdHandle, GWL_EXSTYLE);
if((lnStyle & WS_VISIBLE) && (lnStyle & WS_OVERLAPPEDWINDOW) && !(lnExStyle & WS_EX_CONTROLPARENT))
Form1->Memo1->Lines->Add(stString);
return(TRUE);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Memo1->Lines->Clear();
EnumWindows((WNDENUMPROC)EnumWindowsProc, 0L);
}
//---------------------------------------------------------------------------
.멀모르는넘 님이 쓰신 글 :
: API를 이용하여 윈도우의 작업관리자 창의 응용프로그램 탭처럼 응용프로그램을 찾아내 보여주고 싶습니다
: 어떻게 해야하져??
: EnumWindows() 를 이용하여 GetWindowText()를 써서 찾았더니 윈도우XP와 같은 응용프로그램만 나오는것이
: 아니라 여러가지 쓸모없는걸들까지 같이 나오더라구여 어떻게 해야 윈도우 XP와 같은 결과를 얻을수 있지여??
|