自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

记事本

记录了一些日常中碰到的问题或经验。

  • 博客(9)
  • 资源 (4)
  • 收藏
  • 关注

原创 WPF 路由事件声明及触发

     public class FullScreenEventArgs : RoutedEventArgs { public Boolean Status { get; set; } } [Serializable] [ComVisible(true)] public delegate void FullScree...

2018-08-31 16:49:51 506

原创 WPF MVVM UserControl 的 i:Interaction.Triggers 应用

本例依赖文章 https://blog.csdn.net/Vblegend_2013/article/details/81634020用户控件代码 /// <summary> /// 声明路由事件 /// 参数:要注册的路由事件名称,路由事件的路由策略,事件处理程序的委托类型(可自定义),路由事件的所有者类类型 /...

2018-08-27 17:43:38 8779

原创 WPF 中 ItemsControl 列表的应用

wpf<Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="...

2018-08-24 09:35:48 5024 1

原创 WPF封装控件时 检测是否在设计模式中

   public static bool IsDesignMode(this Control ctl) { return System.ComponentModel.DesignerProperties.GetIsInDesignMode(ctl); }  在控件和窗口的构造函数 或 load 中  this...

2018-08-23 17:34:07 487

原创 WPF窗口默认TextBox焦点

 当WPF窗口显示后 如果想设置某个输入框为默认焦点 使用 FocusManager<Grid FocusManager.FocusedElement="{Binding ElementName=inputbox}"> <TextBox Name="inputbox" HorizontalAlignment="Left" Height="24" Margin...

2018-08-17 09:01:23 4961 2

原创 WPF MVVM 文本框 按回车触发Command

  <TextBox HorizontalAlignment="Left" Height="24" Margin="10,10,0,0" Text="{Binding SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextWrapping="...

2018-08-15 16:19:11 6564

原创 WPF MVC模式下的事件路由和Command

 1.引用DLLC:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries\System.Windows.Interactivity.dll2.建立Command接口 public interface IDefaultCommand { even...

2018-08-13 17:39:32 1742

原创 C# 中 Union的实现

using System;using System.Collections.Generic;using System.Linq;using System.Runtime.InteropServices;using System.Text;namespace ConsoleApplication{ [StructLayout(LayoutKind.Explicit, Size...

2018-08-10 16:45:51 4640

原创 树莓派 cmake 编译HP-Socket

刚到手树莓派不久  对linux也是一知半解所以在编译HPSOCKET组件的时候走了很多弯路 CMakeList文件 保存下 Linux目录建立 Build文件夹 在 Build文件夹1.    cmake ..2.    sudo make -j4  linux目录下 CMakeList.txtPROJECT(HPSocket4C)CMAKE_MINIMU...

2018-08-08 21:10:02 1563 1

C# 优雅的 APIHOOK 支持X86+X64源码

using System; using System.Runtime.InteropServices; namespace NativeHook.Test { public delegate Int32 MessageBoxW(IntPtr hWnd, [MarshalAs(UnmanagedType.LPWStr)] string lpText, [MarshalAs(UnmanagedType.LPWStr)] string lpCaption, UInt32 uType); public class MessageBoxHook : NtAPIHook { [DllHook("user32", EntryPoint = "MessageBoxW")] public Int32 MessageBox(IntPtr owner, string text, string caption, UInt32 options) { //拦截信息 Console.Title = caption; Console.WriteLine(text); //调用源函数 return Origin.Invoke(owner, text, caption, options); } } } [STAThread] static void Main(string[] args) { using (var hook = new MessageBoxHook()) { //绕过Hook直接调用源函数 hook.Origin(IntPtr.Zero, "111", "222", 0); //调用Api 被Hook MessageBox.Show("Hello world", "666", MessageBoxButtons.YesNoCancel); } //Hook解除拦截不到 MessageBox.Show("Hello world", "666", MessageBoxButtons.YesNoCancel); }

2018-09-21

C# 从内存加载动态链接库

纯C# 实现的 从内存加载动态链接库,支持加壳的DLL,使用方便 class Program { public delegate Int32 CompressHandle(ref Byte dest,ref Int32 len, Byte [] source,Int32 sourcelen); static void Main(string[] args) { Byte[] source = new byte[10000]; Byte[] dest = new byte[10000]; Int32 len = source.Length; Byte[] dllBin = File.ReadAllBytes("zlib1.dll"); using (var dll = new DllLoader()) { if (dll.LoadLibrary(dllBin)) { var Compress = dll.GetProcDelegate("compress"); if (Compress != null) { var result = Compress.Invoke(ref dest[0], ref len, source, len); Console.WriteLine(result); } } } } }

2018-09-08

Vb6 InLineHook(通用版)

Vb6 开发的 InLineHook (APIHook) 兼容 XP WIN7 SERVER2003 WIN2000 源码

2013-03-11

Obj文档解析

解析M$的Obj文档,Vb生成的 Obj文档,功能齐全 可编辑 源码

2013-03-10

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除