Advertisement
Guest User

Untitled

a guest
Jul 12th, 2013
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.10 KB | None | 0 0
  1. //tutorial #1 in series of Paltalk Programming tutorials
  2.  
  3. implementation
  4.  
  5. {$R *.dfm}
  6.  
  7. procedure TForm1.iPickerMouseDown(Sender: TObject; Button: TMouseButton;
  8.   Shift: TShiftState; X, Y: Integer);
  9. begin
  10.   if Button = mbLeft then
  11.    SetCursor(iPicker.Picture.Icon.Handle);
  12. end;
  13.  
  14. procedure TForm1.iPickerMouseUp(Sender: TObject; Button: TMouseButton;
  15.   Shift: TShiftState; X, Y: Integer);
  16. var
  17.  hHwnd: HWND;
  18.  ptCords: TPoint;
  19.  clsStr: String;
  20.  sTitle: String;
  21. begin
  22.   GetCursorPos(ptCords);
  23.   hHwnd:= WindowFromPoint(ptCords);
  24.   lblHandle.Text:= Format('%x : %d', [hHwnd, hHwnd]); //IntToStr(hHwnd);
  25.   //====================================================================
  26.   SetLength(clsStr, 255);
  27.   GetClassName(hHwnd, Pchar(clsStr), 255);
  28.   lblClassName.Text:= Pchar(clsStr);
  29.   //=====================================================================
  30.   lblDlgCtrlId.Text:= IntToStr(GetDlgCtrlId(hHwnd));
  31.   //=====================================================================
  32.   SetLength(sTitle, 255);
  33.   GetWindowText(hHwnd, Pchar(sTitle), 255);
  34.   lblTitle.Text:= Pchar(sTitle);
  35. end;
  36.  
  37. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement