GetWRefCon
GetWRefCon Return a window's reference value
#include <Windows.h> Window Manager
long GetWRefCon(theWindow );
WindowPtr theWindow ; window of interest
returns the current value in theWindow->refCon
This function returns the "reference constant" (WindowRecord.refCon) for a
window.
theWindow is a WindowPtr obtained via NewWindow or GetNewWindow.
Returns: an application- defined long integer.

Notes: The refCon value is initially set when the window is opened (see
NewWindow). Use SetWRefCon to change it. Use GetWRefCon to
obtain its current value, or just read it directly from the window record:
wPeek = (WindowPeek) theWindow;
myRefCon = wPeek -> refCon;
This user- defined value is often used as a good place to store a Handle
leading to additional information about the window. For instance, such a
handle could contain information to help you keep track of the scrolling
position or the name and reference of a file read to obtain the contents of the
window, etc.
Note: if you do maintain such a Handle, be sure to dispose of it before you
close the window.