コード例 #1
0
        static public IntPtr FindData(int width, int height, LibLoader2 lib, res_table tdata, ImageType tobyte)
        {
            IntPtr hImage;
            IntPtr res = FindData(lib, tdata);
            IntPtr lr  = LoadResource(lib.hModule, res);
            IntPtr lo  = LockResource(lr);

            using (Mart name = (_isint(tdata._n)) ? new Mart(_i(tdata.name), false) : new Mart(tdata.name, false, true))
            {
                if (tobyte == ImageType.bitmap)
                {
                    hImage = User32.LoadBitmap(lib.hModule, (IntPtr)name);
                }
                else if (tobyte == ImageType.srcbitmap)
                {
                    //hImage = User32.LoadBitmap(lib.hModule,(IntPtr)name);
                    hImage = LoadImage(lib.hModule, (IntPtr)name, (uint)tobyte, width, height, (uint)iflags.LR_COPYFROMRESOURCE);
                }
                else
                {
                    hImage = LoadImage(lib.hModule, (IntPtr)name, (uint)tobyte, 0, 0, (uint)iflags.LR_VGACOLOR);
                }
            }
            FreeResource(lr);
            return(hImage);
        }
コード例 #2
0
        /// attempts to reverse restable to a newly found pointer
        static public IntPtr FindData(LibLoader2 lib, res_table tdata)
        {
            Mart   type, name;
            IntPtr res;

            using (type = (_isres(tdata._t)) ? new Mart(_i(tdata._t), false) : new Mart(tdata.type, false, true))
            {
                using (name = (_isint(tdata._n)) ? new Mart(_i(tdata.name), false) : new Mart(tdata.name, false, true))
                {
//				nam = _isint(tdata._n) ? "#"+tdata.name : tdata.name;
                    res = FindResource(lib.hModule, (IntPtr)name, (IntPtr)type);
//				Global.cstat(ConsoleColor.Green,"{0}:{1}",(IntPtr)type,nam);
                }
            }
            return(res);
        }
コード例 #3
0
        static public byte[] FindData(LibLoader2 lib, res_table tdata, bool tobyte)
        {
            IntPtr res = FindData(lib, tdata);
            int    siz = SizeofResource(lib.hModule, res);

            byte[] newmemory = new byte[siz];
            IntPtr lr        = LoadResource(lib.hModule, res);
            IntPtr lo        = LockResource(lr);

            using (Mart newmem = new Mart(new byte[siz]))
            {
                Kernel32.CopyMemory((IntPtr)newmem, lo, siz);
                newmemory = newmem.GetByteData(siz);
            }
            FreeResource(lr);
            lr = IntPtr.Zero;
//			Global.cstat(ConsoleColor.Green,"{0}:{1}",(IntPtr)type,nam);
            return(newmemory);
        }
コード例 #4
0
//		static public IntPtr FindData(LibLoader2 lib, res_table tdata)
//		{
//			Mart type;
//			string nam;
//			IntPtr res;
//			using (type = (_isres(tdata._t)) ? new Mart(_i(tdata._t),false) : new Mart(tdata.type+"\0",false)) {
//				nam = _isint(tdata._n) ? "#"+tdata.name+"\0": tdata.name+"\0";
//				IntPtr libr = LoadLibrary(lib.LibraryPath);
//				res = FindResource(libr,(IntPtr)type,nam);
//			}
//			return res;
//		}

        static public byte[] GetResData(res_table tdata)
        {
            throw new NotImplementedException();
        }
コード例 #5
0
 public thought(LibLoader2 lib, object typ, object nam, ushort lang)
 {
     loader = lib; table = new res_table(typ, nam, lang);
 }
コード例 #6
0
 public thought(LibLoader2 lib, res_table res)
 {
     loader = lib; table = res;
 }