日期:2014-05-18 浏览次数:21046 次
//attach textbox to client window HwndSourceParameters parameters = new HwndSourceParameters(/*MSG0*/"Parameters", rec.Width, rec.Height); parameters.ParentWindow = parentIntPtr; parameters.SetPosition(rec.Location.X, rec.Location.Y); parameters.WindowClassStyle = 0; parameters.WindowStyle = (int)(WindowStyles.WS_CHILD | WindowStyles.WS_VISIBLE | WindowStyles.WS_CLIPSIBLINGS | WindowStyles.WS_CLIPCHILDREN | WindowStyles.WS_MAXIMIZEBOX); parameters.ExtendedWindowStyle = (int)(WindowExStyles.WS_EX_TOPMOST | WindowExStyles.WS_EX_TRANSPARENT); mHwndSource = new HwndSource(parameters); if (mHwndSource == null) return null; ; mHwndSource.RootVisual = mTextBox; mTextBox.CaptureMouse();