114 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			114 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| /*********************************************************************************************
 | |
|  * Copyright 2004 - Volian Enterprises, Inc. All rights reserved.
 | |
|  * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
 | |
|  * ------------------------------------------------------------------------------
 | |
|  * $Workfile: VEMessage.cs $     $Revision: 1 $
 | |
|  * $Author: Kathy $   $Date: 7/27/04 8:24a $
 | |
|  *
 | |
|  * $History: VEMessage.cs $
 | |
|  * 
 | |
|  * *****************  Version 1  *****************
 | |
|  * User: Kathy        Date: 7/27/04    Time: 8:24a
 | |
|  * Created in $/LibSource/VEMessage
 | |
|  *********************************************************************************************/
 | |
| using System;
 | |
| using System.Collections.Specialized;
 | |
| using System.Runtime.InteropServices;
 | |
| using System.Windows.Forms;
 | |
| 
 | |
| namespace VEMessageNS
 | |
| {
 | |
| 	// messages for communication between this app & vfw.
 | |
| 	public enum MessageOps 
 | |
| 	{
 | |
| 		WM_USER = 0x0400,
 | |
| 		MSG_COMMAND_TERMINATE = WM_USER + 200 + 4,
 | |
| 		POSQUERY =	WM_USER+0x015, //21,
 | |
| 		POSUPDATE	=	WM_USER+0x016, //22,
 | |
| 		GETANSWER	=	WM_USER+0x017, //23,
 | |
| 		RQSTATTACH	=	WM_USER+0x018, //24,
 | |
| 		RQSTFILEOFFSET =	WM_USER+0x19, //25,
 | |
| 		RQSTFILEMODE =	WM_USER+0x01a, //26,
 | |
| 		RQSTFILEOWNER =	WM_USER+0x01b, //27,
 | |
| 		RQSTFILESEEK =	WM_USER+0x01c, //28,
 | |
| 		RQSTFILECLOSE =	WM_USER+0x01d, //29,
 | |
| 		RQSTFILEOPEN =	WM_USER+0x01e, //30,
 | |
| 		RQSTFILEREAD =	WM_USER+0x01f, //31,
 | |
| 		RQSTFILEWRITE =	WM_USER+0x020, //32,
 | |
| 		RQSTPROCESSRECORD =	WM_USER+0x021, //33,
 | |
| 		GETPROCESSREC =	WM_USER+0x022, //34,
 | |
| 		SETLOCKBYUSER =	WM_USER+0x023, // 35
 | |
| 	};
 | |
| 	
 | |
| 
 | |
| 	public class Win32
 | |
| 	{	
 | |
| 		[DllImport("wow32.dll")]
 | |
| 		public static extern Int16 WOWHandle16(IntPtr x, int xx);
 | |
| 	}
 | |
| 
 | |
| 	public class VEMessage
 | |
| 	{
 | |
| 		public HybridDictionary dicMessage;
 | |
| 		static int m_Handle_16bit;
 | |
| 		static IntPtr m_Handle_vfw;
 | |
| 		public VEMessage()
 | |
| 		{
 | |
| 			dicMessage = new HybridDictionary();
 | |
| 			dicMessage.Add(0x415,MessageOps.POSQUERY);
 | |
| 			dicMessage.Add(0x416,MessageOps.POSUPDATE);
 | |
| 			dicMessage.Add(0x417,MessageOps.GETANSWER);
 | |
| 			dicMessage.Add(0x418,MessageOps.RQSTATTACH);
 | |
| 			dicMessage.Add(0x419,MessageOps.RQSTFILEOFFSET);
 | |
| 			dicMessage.Add(0x41a,MessageOps.RQSTFILEMODE);
 | |
| 			dicMessage.Add(0x41b,MessageOps.RQSTFILEOWNER);
 | |
| 			dicMessage.Add(0x41c,MessageOps.RQSTFILESEEK);
 | |
| 			dicMessage.Add(0x41d,MessageOps.RQSTFILECLOSE);
 | |
| 			dicMessage.Add(0x41e,MessageOps.RQSTFILEOPEN);
 | |
| 			dicMessage.Add(0x41f,MessageOps.RQSTFILEREAD);
 | |
| 			dicMessage.Add(0x420,MessageOps.RQSTFILEWRITE);
 | |
| 			dicMessage.Add(0x421,MessageOps.RQSTPROCESSRECORD);
 | |
| 			dicMessage.Add(0x422,MessageOps.GETPROCESSREC);
 | |
| 			dicMessage.Add(0x423,MessageOps.SETLOCKBYUSER);
 | |
| 		}
 | |
| 
 | |
| 		public bool Exists(int msg)
 | |
| 		{
 | |
| 			return(dicMessage.Contains(msg));
 | |
| 		}
 | |
| 		public static int Handle_16bit
 | |
| 		{
 | |
| 			set
 | |
| 			{
 | |
| 				m_Handle_16bit=value;
 | |
| 			}
 | |
| 			get
 | |
| 			{
 | |
| 				return m_Handle_16bit;
 | |
| 			}
 | |
| 		}
 | |
| 
 | |
| 		public static IntPtr Handle_Vfw
 | |
| 		{
 | |
| 			set
 | |
| 			{
 | |
| 				m_Handle_vfw=value;
 | |
| 			}
 | |
| 			get
 | |
| 			{
 | |
| 				return m_Handle_vfw;
 | |
| 			}
 | |
| 		}
 | |
| 
 | |
| 		public int GetMessageOp(int m)
 | |
| 		{
 | |
| 			return ((int) dicMessage[m]);
 | |
| 		}
 | |
| 
 | |
| 		public void SetReceiveHandle(Message m)
 | |
| 		{
 | |
| 			Handle_Vfw = m.WParam;
 | |
| 		}
 | |
| 	}
 | |
| }
 |