资源简介
Winform窗体嵌入WPF程序并发送消息
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Security;
using System.Diagnostics;
using System.Windows.Forms;
namespace WindowsFormsDemo
{
public class AppContainer
{
#region 注册API函数
[DllImport(“user32.dll“ EntryPoint = “GetWindowThreadProcessId“ SetLastError = true
CharSet = CharSet.Unicode ExactSpelling = true CallingConvention = CallingConvention.StdCall)]
private static extern long GetWindowThreadProcessId(long hWnd long lpdwProcessId);
[DllImport(“user32.dll“)]
private static extern IntPtr FindWindow(string lpClassName string lpWindowName);
[DllImport(“user32.dll“ SetLastError = true)]
public static extern IntPtr SetParent(IntPtr hWndChild IntPtr hWndNewParent);
[DllImport(“user32.dll“ EntryPoint = “GetWindowLongA“ SetLastError = true)]
private static extern long GetWindowLong(IntPtr hwnd int nIndex);
[DllImport(“user32.dll“ EntryPoint = “SetWindowLong“ CharSet = CharSet.Auto)]
private static extern IntPtr SetWindowLongPtr32(HandleRef hWnd int nIndex int dwNewLong);
[DllImport(“user32.dll“ EntryPoint = “SetWindowLongPtr“ CharSet = CharSet.Auto)]
internal static extern IntPtr SetWindowLongPtr64(HandleRef hWnd int nIndex int dwNewLong);
[DllImport(“user32.dll“ SetLastError = true)]
private static extern long SetWindowPos(IntPtr hwnd long hWndInsertAfter long x long y long cx long cy long wFlags);
[DllImport(“user32.dll“ SetLastError = true)]
private static extern bool MoveWindow(IntPtr hwnd int x int y int cx int cy bool repaint);
[DllImport(“user32.dll“ EntryPoint = “PostMessageA“ SetLastError = true)]
private static extern bool PostMessage(IntPtr hwnd uint Msg uint wParam uint lParam);
[DllImport(“user32.dll“ SetLastError = true)]
private static extern IntPtr GetParent(IntPtr hwnd);
[DllImport(“user32.dll“ EntryPoint = “ShowWindow“ SetLastError = true)]
static extern bool ShowWindow(IntPtr hWnd int nCmdShow);
[DllImport(“user32.dll“)]
private static extern int SendMessage(IntPtr hWnd uint Msg int wParam int lParam);
private const int SWP_NOOWNERZORDER = 0x200;
private const int SWP_NOREDRAW = 0x8;
private const int SWP_NOZORDER = 0x4;
private const int SWP_SHOWWINDOW = 0x0040;
private const int WS_EX_MDICHILD = 0x40;
private const int SWP_frameCHANGED = 0x20;
private const int SWP_NOACTIVATE = 0x10;
private const int SWP_ASYNCWINDOWPOS = 0x4000;
private const int SWP_NOMOVE = 0x2;
private const int SWP_NOSIZE = 0x1;
private const int GWL_style = (-16);
private const int WS_VISIBLE = 0x10000000;
private const int WM_CLOSE = 0x10;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-08-22 21:41 WindowsFormsDemo\
目录 0 2016-08-19 22:33 WindowsFormsDemo\Bin\
文件 12288 2016-08-19 23:32 WindowsFormsDemo\Bin\WindowsFormsDemo.exe
文件 30208 2016-08-19 23:32 WindowsFormsDemo\Bin\WindowsFormsDemo.pdb
文件 24224 2016-08-22 21:41 WindowsFormsDemo\Bin\WindowsFormsDemo.vshost.exe
文件 12800 2016-08-22 22:15 WindowsFormsDemo\Bin\WpfApp.exe
文件 40448 2016-08-22 22:15 WindowsFormsDemo\Bin\WpfApp.pdb
文件 24224 2016-08-22 22:19 WindowsFormsDemo\Bin\WpfApp.vshost.exe
文件 490 2015-10-30 15:19 WindowsFormsDemo\Bin\WpfApp.vshost.exe.manifest
目录 0 2016-08-22 22:40 WindowsFormsDemo\WindowsFormsDemo\
文件 5159 2016-08-19 21:50 WindowsFormsDemo\WindowsFormsDemo\AppContainer.cs
文件 2060 2016-08-19 21:59 WindowsFormsDemo\WindowsFormsDemo\MainForm.Designer.cs
文件 4196 2016-08-22 22:40 WindowsFormsDemo\WindowsFormsDemo\MainForm.cs
文件 5817 2016-08-19 21:59 WindowsFormsDemo\WindowsFormsDemo\MainForm.resx
文件 500 2016-08-19 21:21 WindowsFormsDemo\WindowsFormsDemo\Program.cs
目录 0 2016-08-19 21:20 WindowsFormsDemo\WindowsFormsDemo\Properties\
文件 1364 2016-08-19 21:20 WindowsFormsDemo\WindowsFormsDemo\Properties\AssemblyInfo.cs
文件 2884 2016-08-19 21:20 WindowsFormsDemo\WindowsFormsDemo\Properties\Resources.Designer.cs
文件 5612 2016-08-19 21:20 WindowsFormsDemo\WindowsFormsDemo\Properties\Resources.resx
文件 1103 2016-08-19 21:20 WindowsFormsDemo\WindowsFormsDemo\Properties\Settings.Designer.cs
文件 249 2016-08-19 21:20 WindowsFormsDemo\WindowsFormsDemo\Properties\Settings.settings
文件 3830 2016-08-19 22:02 WindowsFormsDemo\WindowsFormsDemo\WindowsFormsDemo.csproj
目录 0 2016-08-19 21:21 WindowsFormsDemo\WindowsFormsDemo\bin\
目录 0 2016-08-19 22:02 WindowsFormsDemo\WindowsFormsDemo\bin\Debug\
文件 490 2015-10-30 15:19 WindowsFormsDemo\WindowsFormsDemo\bin\Debug\WindowsFormsDemo.vshost.exe.manifest
目录 0 2016-08-22 22:40 WindowsFormsDemo\WindowsFormsDemo\bin\Release\
目录 0 2016-08-19 21:20 WindowsFormsDemo\WindowsFormsDemo\obj\
目录 0 2016-08-19 21:20 WindowsFormsDemo\WindowsFormsDemo\obj\x86\
目录 0 2016-08-19 23:32 WindowsFormsDemo\WindowsFormsDemo\obj\x86\Debug\
文件 2867 2016-08-19 21:20 WindowsFormsDemo\WindowsFormsDemo\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7021 2016-08-22 21:41 WindowsFormsDemo\WindowsFormsDemo\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
............此处省略54个文件信息
相关资源
- SignalR 2.0 Winform版
- WPF翻页照片特效浏览源代码
- C# winform Socket大文件传输
- [源代码] 《领域驱动设计 (C# 2008 实
- C#将Excel导入到Access数据库表(winFor
- winform图片标尺,画矩形
- C# WPF扫描仪调用Twain
- C# 斑马标签打印 WEBWINFORM
- Wpf生成word文档
- C#动画控件超炫
- WeifenLuo.WinFormsUI.Docking3.1.0
- Bunifu_Ui_WinForms_v1.10.0.0_Downloadly.ir.rar
- Winform可视化打印模板设计
- WPF 基础视频教程共50集---27.资源字典
- 最新9个C# .NET Winform的多线程进度条源
- WPF动画 窗体跳转过渡动画 包含大量窗
- 24652561RevitWPFAddin.zip
- WPF圆润的TabItem和TabControl
- Winform绘制圆形和椭圆形图章
- c#影院系统大作业,班评第一名
- c# 图像旋转 winform 窗体 图片转动
- C#实现将WPF字体呈现到OpenGL 支持汉字
- 优化C# WinForm从中国银行网站抓取汇率
- wpf 搜集整理demo源码(都是c#写的,惊
- C#项目 网吧管理系统
- WPF滚动相册+图文介绍
- 原创WPF卫生相关文档编辑器
- HelixToolkitWPF中文手册.rar
- 深入浅出WPF_含源码
- Winform通用经典快速开发CS框架-outloo
评论
共有 条评论