home *** CD-ROM | disk | FTP | other *** search
- unit WindowProps;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls, ComCtrls;
-
- type
- TpropWindow = class(TFrame)
- pc: TPageControl;
- tsGeneral: TTabSheet;
- stText: TEdit;
- Label24: TLabel;
- stHandle: TStaticText;
- Label26: TLabel;
- stProcess: TStaticText;
- Bevel6: TBevel;
- winIcon: TImage;
- Bevel7: TBevel;
- Label22: TLabel;
- stInst: TStaticText;
- Label25: TLabel;
- stID: TStaticText;
- Label28: TLabel;
- stProc: TStaticText;
- Label23: TLabel;
- stParent: TStaticText;
- Label27: TLabel;
- stData: TStaticText;
- Label32: TLabel;
- stClient: TStaticText;
- Label35: TLabel;
- stRect: TStaticText;
- Label49: TLabel;
- stThread: TStaticText;
- tsStyle: TTabSheet;
- tsClass: TTabSheet;
- Label29: TLabel;
- stAtom: TStaticText;
- Label31: TLabel;
- stCBytes: TStaticText;
- Bevel8: TBevel;
- Label36: TLabel;
- stCName: TEdit;
- Label38: TLabel;
- stCInst: TStaticText;
- Label42: TLabel;
- stCWndproc: TStaticText;
- Label44: TLabel;
- stWBytes: TStaticText;
- Label30: TLabel;
- stHBkg: TStaticText;
- Label37: TLabel;
- stHCur: TStaticText;
- Label46: TLabel;
- stHIcon: TStaticText;
- Bevel10: TBevel;
- Bevel9: TBevel;
- lbcs: TListBox;
- lbws: TListBox;
- lbwes: TListBox;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- bVisible: TButton;
- procedure cmVisible(Sender: TObject);
- private
- FWindow: TObject;
- public
- property Window: TObject read FWindow write FWindow;
- procedure Refresh;
- end;
-
- implementation
-
- uses MiTec_Routines;
-
- {$R *.DFM}
-
- { TpropWindow }
-
- procedure TpropWindow.Refresh;
- begin
- with MiTeC_Routines.PWindow(Window)^ do begin
- if IsWindowVisible(PWindow(Window)^.Handle) then
- bVisible.Caption:='&Hide'
- else
- bVisible.Caption:='&Show';
- bVisible.Enabled:=IsWindow(Handle);
- stText.Text:=Text;
- stHandle.Caption:=Format('%d (0x%0:x)',[Handle]);
- stProcess.Caption:=Format('%d (0x%0:x)',[Process]);
- stThread.Caption:=Format('%d (0x%0:x)',[Thread]);
- stParent.Caption:=Format('%d (0x%0:x)',[ParentWin]);
- stProc.Caption:=Format('%d (0x%0:x)',[WndProc]);
- stInst.Caption:=Format('%d (0x%0:x)',[Instance]);
- stID.Caption:=Format('%d (0x%0:x)',[ID]);
- stData.Caption:=Format('%d (0x%0:x)',[UserData]);
- stRect.Caption:=Format('(%d,%d)-(%d,%d), %dx%d',[Rect.Left,Rect.Top,
- Rect.Right,Rect.Bottom,
- Rect.Right-Rect.Left,
- Rect.Bottom-Rect.Top]);
- stClient.Caption:=Format('(%d,%d)-(%d,%d), %dx%d',[ClientRect.Left,ClientRect.Top,
- ClientRect.Right,ClientRect.Bottom,
- ClientRect.Right-ClientRect.Left,
- ClientRect.Bottom-ClientRect.Top]);
-
- with lbWS, Items do begin
- BeginUpdate;
- Clear;
- AddStrings(Styles);
- EndUpdate;
- end;
- with lbWES, Items do begin
- BeginUpdate;
- Clear;
- AddStrings(ExStyles);
- EndUpdate;
- end;
-
- stCName.Text:=ClassName;
- stAtom.Caption:=Format('%d (0x%0:x)',[Atom]);
- stCBytes.Caption:=Format('%d (0x%0:x)',[ClassBytes]);
- stWBytes.Caption:=Format('%d (0x%0:x)',[WinBytes]);
- stCWndProc.Caption:=Format('%d (0x%0:x)',[ClassWndProc]);
- stCInst.Caption:=Format('%d (0x%0:x)',[ClassInstance]);
- stHBkg.Caption:=Format('%d (0x%0:x)',[Background]);
- stHCur.Caption:=Format('%d (0x%0:x)',[Cursor]);
- stHIcon.Caption:=Format('%d (0x%0:x)',[Icon]);
- with lbCS, Items do begin
- BeginUpdate;
- Clear;
- AddStrings(ClassStyles);
- EndUpdate;
- end;
- end;
- winIcon.Picture.Icon.Handle:=SendMessage(PWindow(Window)^.Handle,WM_GETICON,ICON_BIG,0);
- end;
-
- procedure TpropWindow.cmVisible(Sender: TObject);
- var
- Flags :Longword;
- begin
- if IsWindowVisible(PWindow(Window)^.Handle) then
- Flags:=SWP_NOZORDER+SWP_NOMOVE+SWP_NOSIZE+SWP_HIDEWINDOW
- else
- Flags:=SWP_NOZORDER+SWP_NOMOVE+SWP_NOSIZE+SWP_SHOWWINDOW;
- if not SetWindowPos(PWindow(Window)^.Handle,HWND_TOP,0,0,0,0,Flags) then
- MessageDlg('This window no longer exists.',mtwarning,[mbok],0);
- Refresh;
- end;
-
- end.
-