Posted to tcl by mjanssen at Thu Dec 14 10:55:39 GMT 2006view raw

  1. package require twapi
  2. wm title . hWnd
  3. wm attributes . -topmost 1
  4. wm resizable . 0 0
  5.  
  6. bind all <ButtonPress> { . configure -cursor crosshair ; .td configure -cursor crosshair}
  7. bind all <ButtonRelease> {set ::coords [window %X %Y] ; . configure -cursor {} ; .td configure -cursor {}}
  8. entry .td -textvariable coords
  9. pack .td -expand 1 -fill x
  10.  
  11. proc window {x y} {
  12.  
  13. set xy [::twapi::get_mouse_location]
  14. set handle [::twapi::get_window_at_location [lindex $xy 0] [lindex $xy 1]]
  15. return $handle
  16. }
  17.  
  18. bind . <F5> {console show}