亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? winwordcontrol.cs

?? 在C#中直接打開Word文件并編輯
?? CS
?? 第 1 頁 / 共 2 頁
字號:
/// This code has been changed by Anup Shinde.
/// contact: anup@micromacs.com   ...:)

/// The original code is written by Matthias Haenel
/// contact: www.intercopmu.de
/// Code was received from: http://www.codeproject.com/cs/miscctrl/winwordcontrol.asp
/// 
/// you can use it free of charge, but please 
/// mention my name ;)
/// 
/// WinWordControl utilizes MS-WinWord2000 and 
/// WinWord-XP
/// 
/// It simulates a form element, with simple tricks.
///


using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Runtime.InteropServices;


namespace WinWordControl
{
	/// <summary>
	/// WinWordControl allows you to load doc-Files to your
	/// own application without any loss, because it uses 
	/// the real WinWord.
	/// </summary>
	public class WinWordControl : System.Windows.Forms.UserControl
	{


		#region "API usage declarations"

		[DllImport("user32.dll")]
		public static extern int FindWindow(string strclassName, string strWindowName);

		[DllImport("user32.dll")]
		static extern int SetParent( int hWndChild, int hWndNewParent);

		[DllImport("user32.dll", EntryPoint="SetWindowPos")]
		static extern bool SetWindowPos(
			int hWnd,               // handle to window
			int hWndInsertAfter,    // placement-order handle
			int X,                  // horizontal position
			int Y,                  // vertical position
			int cx,                 // width
			int cy,                 // height
			uint uFlags             // window-positioning options
			);
		
		[DllImport("user32.dll", EntryPoint="MoveWindow")]
		static extern bool MoveWindow(
			int Wnd, 
			int X, 
			int Y, 
			int Width, 
			int Height, 
			bool Repaint
			);

		[DllImport("user32.dll", EntryPoint="DrawMenuBar")]
		static extern Int32 DrawMenuBar(
			Int32 hWnd
			);

		[DllImport("user32.dll", EntryPoint="GetMenuItemCount")]
		static extern Int32 GetMenuItemCount(
			Int32 hMenu
			);

		[DllImport("user32.dll", EntryPoint="GetSystemMenu")]
		static extern Int32 GetSystemMenu(
			Int32 hWnd,
			bool Revert);

		[DllImport("user32.dll", EntryPoint="RemoveMenu")]
		static extern Int32 RemoveMenu(
			Int32 hMenu,
			Int32 nPosition,
			Int32 wFlags
			);

		
		private const int MF_BYPOSITION = 0x400;
		private const int MF_REMOVE = 0x1000;

		
		const int SWP_DRAWFRAME = 0x20;
		const int SWP_NOMOVE = 0x2;
		const int SWP_NOSIZE = 0x1;
		const int SWP_NOZORDER = 0x4;

		#endregion

				

		/* I was testing wheater i could fix some exploid bugs or not.
		 * I left this stuff in here for people who need to know how to 
		 * interface the Win32-API

		[StructLayout(LayoutKind.Sequential)]
			public struct RECT 
		{
			public int left;
			public int top;
			public int right;
			public int bottom;
		}
		
		[DllImport("user32.dll")]
		public static extern int GetWindowRect(int hwnd, ref RECT rc);
		
		[DllImport("user32.dll")]
		public static extern IntPtr PostMessage(
			int hWnd, 
			int msg, 
			int wParam, 
			int lParam
		);
		*/


		/// <summary>
		/// Change. Made the following variables public.
		/// </summary>

		public  Word.Document document;
		public static Word.ApplicationClass wd = null;
		public  static int wordWnd				= 0;
		public static string filename			= null;
		private static bool	deactivateevents	= false;

		/// <summary>
		/// needed designer variable
		/// </summary>
		private System.ComponentModel.Container components = null;

		public WinWordControl()
		{
			InitializeComponent();
		}

		/// <summary>
		/// cleanup Ressources
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			CloseControl();
			if( disposing )
			{
				if( components != null )
					components.Dispose();
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary>
		/// !do not alter this code! It's designer code
		/// </summary>
		private void InitializeComponent()
		{
			// 
			// WinWordControl
			// 
			this.Name = "WinWordControl";
			this.Size = new System.Drawing.Size(440, 336);
			this.Resize += new System.EventHandler(this.OnResize);			
		}
		#endregion


		/// <summary>
		/// Preactivation
		/// It's usefull, if you need more speed in the main Program
		/// so you can preload Word.
		/// </summary>
		public void PreActivate()
		{
			if(wd == null) wd = new Word.ApplicationClass();
		}


		/// <summary>
		/// Close the current Document in the control --> you can 
		/// load a new one with LoadDocument
		/// </summary>
		public void CloseControl()
		{
			/*
			* this code is to reopen Word.
			*/
		
			try
			{
				deactivateevents = true;
				object dummy=null;
				object dummy2=(object)false;
				document.Close(ref dummy, ref dummy, ref dummy);
				// Change the line below.
				wd.Quit(ref dummy2, ref dummy, ref dummy);
				deactivateevents = false;
			}
			catch(Exception ex)
			{
				String strErr = ex.Message;
			}
		}


		/// <summary>
		/// catches Word's close event 
		/// starts a Thread that send a ESC to the word window ;)
		/// </summary>
		/// <param name="doc"></param>
		/// <param name="test"></param>
		private void OnClose(Word.Document doc, ref bool cancel)
		{
			if(!deactivateevents)
			{
				cancel=true;
			}
		}

		/// <summary>
		/// catches Word's open event
		/// just close
		/// </summary>
		/// <param name="doc"></param>
		private void OnOpenDoc(Word.Document doc)
		{
			OnNewDoc(doc);
		}

		/// <summary>
		/// catches Word's newdocument event
		/// just close
		/// </summary>
		/// <param name="doc"></param>
		private void OnNewDoc(Word.Document doc)
		{
			if(!deactivateevents)
			{
				deactivateevents=true;
				object dummy = null;
				doc.Close(ref dummy,ref dummy,ref dummy);
				deactivateevents=false;
			}
		}

		/// <summary>
		/// catches Word's quit event
		/// normally it should not fire, but just to be shure
		/// safely release the internal Word Instance 
		/// </summary>
		private void OnQuit()
		{
			//wd=null;
		}


		/// <summary>
		/// Loads a document into the control
		/// </summary>
		/// <param name="t_filename">path to the file (every type word can handle)</param>
		public void LoadDocument(string t_filename)
		{
			deactivateevents = true;
			filename = t_filename;
		
			if(wd == null) wd = new Word.ApplicationClass();
			try 
			{
				wd.CommandBars.AdaptiveMenus = false;
				wd.DocumentBeforeClose += new Word.ApplicationEvents2_DocumentBeforeCloseEventHandler(OnClose);
				wd.NewDocument += new Word.ApplicationEvents2_NewDocumentEventHandler(OnNewDoc);
				wd.DocumentOpen+= new Word.ApplicationEvents2_DocumentOpenEventHandler(OnOpenDoc);
				wd.ApplicationEvents2_Event_Quit += new Word.ApplicationEvents2_QuitEventHandler(OnQuit);
				
			}
			catch{}

			if(document != null) 
			{
				try
				{
					object dummy=null;
					wd.Documents.Close(ref dummy, ref dummy, ref dummy);
				}
				catch{}
			}

			if( wordWnd==0 ) wordWnd = FindWindow( "Opusapp", null);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久久久久久人人人人传媒 | 国产自产高清不卡| 久久综合给合久久狠狠狠97色69| 麻豆成人91精品二区三区| 日韩一级欧美一级| 国内外精品视频| 国产拍揄自揄精品视频麻豆| 成人视屏免费看| 亚洲欧美视频一区| 欧美日韩一区二区三区四区| 日本免费新一区视频 | 久久你懂得1024| 粉嫩av一区二区三区粉嫩| 成人欧美一区二区三区黑人麻豆| 日本韩国欧美国产| 日本一不卡视频| 国产精品美女久久久久高潮| 色屁屁一区二区| 免费在线观看视频一区| 国产日产欧美精品一区二区三区| 97久久精品人人做人人爽| 婷婷成人综合网| 欧美激情综合在线| 欧美日韩中字一区| 国产一区二区看久久| 亚洲综合另类小说| 精品国一区二区三区| 色综合久久天天| 经典一区二区三区| 亚洲免费资源在线播放| 日韩免费电影网站| 色综合婷婷久久| 国产一区 二区| 亚洲午夜电影在线| 欧美国产一区在线| 欧美精品色综合| 成人av在线播放网站| 日本欧美一区二区在线观看| 中日韩av电影| 欧美r级电影在线观看| 色哟哟一区二区| 国产精品资源在线| 日韩电影一区二区三区四区| 国产精品国产自产拍高清av王其| 欧美一区二区黄色| 在线免费观看不卡av| 国产成人午夜99999| 日韩av高清在线观看| 亚洲欧美另类久久久精品2019| 精品少妇一区二区| 欧美日韩精品一区视频| 99久久久精品| 高清在线不卡av| 精品亚洲成a人| 日韩影院免费视频| 亚洲老妇xxxxxx| 国产精品久久午夜夜伦鲁鲁| 久久免费视频一区| 日韩视频在线你懂得| 欧美日韩不卡一区二区| 一本大道av伊人久久综合| 北条麻妃一区二区三区| 国产伦精一区二区三区| 日本麻豆一区二区三区视频| 亚洲大片免费看| 亚洲最色的网站| 一区二区三区四区不卡视频 | www.欧美.com| 粉嫩aⅴ一区二区三区四区| 久久激情五月激情| 免费在线视频一区| 美女尤物国产一区| 久久av资源站| 国产在线视视频有精品| 韩国理伦片一区二区三区在线播放| 日韩福利视频导航| 麻豆精品精品国产自在97香蕉| 日韩激情av在线| 免费看日韩a级影片| 免费观看日韩av| 久久精品国产一区二区| 精品一区二区三区欧美| 狠狠色伊人亚洲综合成人| 麻豆国产精品777777在线| 久久国产精品色| 国产一区二区伦理片| 国产成人精品一区二区三区四区| 国产乱人伦偷精品视频不卡| 岛国一区二区三区| 99国产精品99久久久久久| 色国产综合视频| 欧美裸体bbwbbwbbw| 日韩一区二区电影在线| 久久综合久久综合久久综合| 国产日韩欧美精品一区| 综合精品久久久| 亚洲va欧美va人人爽午夜| 日本vs亚洲vs韩国一区三区 | 精品国偷自产国产一区| 亚洲国产精品成人久久综合一区| ...xxx性欧美| 亚洲成av人**亚洲成av**| 麻豆精品一区二区综合av| 国产高清久久久| 色成人在线视频| 这里只有精品电影| 国产女人18毛片水真多成人如厕| 亚洲视频在线观看三级| 欧美aa在线视频| 波多野结衣中文字幕一区二区三区| 91污在线观看| 欧美刺激午夜性久久久久久久 | 国产成人精品免费视频网站| 91啦中文在线观看| 欧美一区国产二区| 国产精品污网站| 日韩不卡手机在线v区| 成人精品一区二区三区中文字幕| 欧美视频中文字幕| 久久久777精品电影网影网| 一区二区三区在线视频观看 | 亚洲一区二区三区免费视频| 韩国v欧美v日本v亚洲v| 色8久久人人97超碰香蕉987| 欧美va日韩va| 亚洲国产一区二区视频| 国产精品夜夜嗨| 在线不卡免费av| 亚洲色图20p| 国产一区高清在线| 欧美日韩五月天| 欧美国产精品专区| 欧美aaa在线| 在线中文字幕一区二区| 日本一区二区三区高清不卡| 日韩精品国产欧美| 色综合 综合色| 国产欧美视频在线观看| 六月丁香婷婷久久| 欧美视频在线播放| 日韩毛片高清在线播放| 国产精品资源网| 日韩精品一区二区三区四区 | 日韩中文字幕91| 91麻豆精品秘密| 国产欧美精品在线观看| 久久国产夜色精品鲁鲁99| 欧美色综合天天久久综合精品| 中文字幕av免费专区久久| 久久成人免费网站| 在线综合视频播放| 亚洲一线二线三线视频| 91啪亚洲精品| 国产精品电影院| 大尺度一区二区| 久久精品网站免费观看| 国产一区二区0| 久久亚洲捆绑美女| 黄一区二区三区| wwww国产精品欧美| 久久 天天综合| 欧美xxxx在线观看| 波多野结衣在线一区| 久久久久国产一区二区三区四区| 理论电影国产精品| 欧美成人一区二区三区在线观看 | 免费成人在线观看视频| 欧美精品丝袜中出| 日日摸夜夜添夜夜添精品视频| 精品视频1区2区| 亚洲成人精品在线观看| 精品视频在线视频| 日韩电影在线免费观看| 欧美一级高清大全免费观看| 久久精品国产精品亚洲精品| 精品动漫一区二区三区在线观看| 久久精品国产99国产| 精品第一国产综合精品aⅴ| 国产精品一卡二卡| 国产精品高清亚洲| 在线一区二区三区做爰视频网站| 亚洲成人你懂的| 欧美一区二区精美| 国产盗摄视频一区二区三区| 国产精品久久久久一区二区三区| 94-欧美-setu| 午夜国产精品一区| 精品国产一二三区| 国产91对白在线观看九色| 欧美高清在线精品一区| 色婷婷久久久久swag精品 | 成人av电影观看| 亚洲精品久久久久久国产精华液| 欧美日韩在线三级| 狠狠色综合播放一区二区| 中文字幕一区av| 欧美一区二区三区视频免费播放| 狠狠色狠狠色合久久伊人| 亚洲色图欧洲色图| 日韩欧美一区二区久久婷婷|