Mostrando postagens com marcador Verificar que programas estã na memoria. Mostrar todas as postagens
Mostrando postagens com marcador Verificar que programas estã na memoria. Mostrar todas as postagens

sábado, 17 de outubro de 2009

Verificar que programas estã na memoria

Function EnumWindowsProc (Wnd: HWND; lb: TListbox): BOOL; stdcall;
// listbox1.clear;
// EnumWindows( @EnumWindowsProc, integer(listbox1));
var
caption: Array [0..128] of Char;
begin
Result := True;
if IsWindowVisible(Wnd) and ((GetWindowLong(Wnd, GWL_HWNDPARENT) = 0) or
(HWND(GetWindowLong(Wnd, GWL_HWNDPARENT)) = GetDesktopWindow)) and
((GetWindowLong(Wnd, GWL_EXSTYLE) and WS_EX_TOOLWINDOW) = 0) then
begin
SendMessage( Wnd, WM_GETTEXT, Sizeof( caption ),integer(@caption));
lb.Items.AddObject( caption, TObject( Wnd ));
end;
end;

Verificar que programas estã na memoria

Function EnumWindowsProc (Wnd: HWND; lb: TListbox): BOOL; stdcall;
// listbox1.clear;
// EnumWindows( @EnumWindowsProc, integer(listbox1));
var
caption: Array [0..128] of Char;
begin
Result := True;
if IsWindowVisible(Wnd) and ((GetWindowLong(Wnd, GWL_HWNDPARENT) = 0) or
(HWND(GetWindowLong(Wnd, GWL_HWNDPARENT)) = GetDesktopWindow)) and
((GetWindowLong(Wnd, GWL_EXSTYLE) and WS_EX_TOOLWINDOW) = 0) then
begin
SendMessage( Wnd, WM_GETTEXT, Sizeof( caption ),integer(@caption));
lb.Items.AddObject( caption, TObject( Wnd ));
end;
end;