Win.pas
上传用户:jiansibo
上传日期:2015-07-04
资源大小:524k
文件大小:2k
- unit Win;
- interface
- uses
- Windows,
- Messages,
- SysUtils,
- proc,
- keyscan;
- procedure Run;
- procedure Init;
- implementation
- function WindowProc(hWnd,Msg,wParam,lParam:longint):Longint; stdcall;
- begin
- Result:=DefWindowProc(hWnd,Msg,wParam,lParam);
- case Msg of
- WM_CREATE:wincreate(hwnd);
- WM_TIMER:ontimer;
- WM_HOTKEY:winhotkey;
- WM_DESTROY:windestroy;
- end;
- if msg=SHELL_EVENT then OnShellHook(wParam,lparam);
- if msg=KEY_EVENT then OnkeyHook(wParam,lParam);
- if msg=MOUSE_EVENT then OnMouseHook(wParam,lParam);
- if msg=WNDPROC_EVENT then OnWndProcHook(wParam,lParam);
- end;
- procedure Init;
- begin
- hInst:=GetModuleHandle(nil);
- with wClass do
- begin
- Style:= CS_PARENTDC;
- hIcon:= LoadIcon(hInst,'MAINICON');
- lpfnWndProc:= @WindowProc;
- hInstance:= hInst;
- hbrBackground:= COLOR_BTNFACE+1;
- lpszClassName:= 'HackSoft-UoSpy';
- hCursor:= LoadCursor(0,IDC_ARROW);
- end;
- RegisterClass(wClass);
- hmain:=CreateWindowEx(0,wClass.lpszClassName,'UoSpy 2001',WS_OVERLAPPEDWINDOW or WS_VISIBLE,10,10,410,400,0,0,hInst,nil);
- hlist:=CreateWindowEx(WS_EX_CLIENTEDGE,'LISTBOX','hello',WS_VISIBLE or WS_CHILD or WS_VSCROLL,10,10,380,330,hmain,0,hinst,nil);
- //if GetKeyboardState(lpKBS)=true then
- begin
- // if (lpKbs[$14]=$81) or (lpKbs[$14]=1) then cslock:=1;
- // if (lpKbs[$14]=$80) or (lpKbs[$14]=0) then cslock:=0;
- // strcopy(sbuf,pchar(format('%x',[cslock])));
- // sendmessage(hlist,LB_ADDSTRING,0,integer(@sbuf));
- lpKBS[$14]:=0;
- SetKeyboardState(lpKBS);
- cslock:=0;
- skey:='';
- end;
- newtime:=SetTimer(hmain,0,300,nil);
- end;
- procedure Run;
- begin
- while(GetMessage(Msg,hmain,0,0))do
- begin
- TranslateMessage(Msg);
- DispatchMessage(Msg);
- end;
- end;
- end.