教程集 www.jiaochengji.com
教程集 >  操作系统  >  windows  >  正文 Window Hiding with C#(ZT)

Window Hiding with C#(ZT)

发布时间:2019-12-16   编辑:jiaochengji.com
教程集为您提供Window Hiding with C#(ZT)等资源,欢迎您收藏本站,我们将为您提供最新的Window Hiding with C#(ZT)资源
Introduction
Ever wanted to completely hide all the crap on your machine that you're not supposed to be looking at when your boss walks by? Try this handy Window Hider utility and all you will have to do is press a customizable hotkey.    
This source project will demonstrate the implementation of hot keys, enumerable collections, enums, binary serialization, DllImports of Win32 API, Window Enumeration, CallBacks/Delegates, Custom Events and Event Handlers, and more. It's quite a bit of code to look through but some of you may find it interesting.
The guts of the application is based in the Window and Windows classes that enumerate and hide the open windows your choose: using System;using System.Text;using System.Collections;using System.Runtime.InteropServices; namespace WindowHider{    /// <summary>    /// Object used to control a Windows Form.    /// </summary>    public class Window    {        /// <summary>        /// Win32 API Imports        /// </summary>        [DllImport("user32.dll")] private static extern       bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);        [DllImport("user32.dll")] private static extern       bool SetForegroundWindow(IntPtr hWnd);        [DllImport("user32.dll")] private static extern       bool IsIconic(IntPtr hWnd);        [DllImport("user32.dll")] private static extern       bool IsZoomed(IntPtr hWnd);        [DllImport("user32.dll")] private static extern       IntPtr GetForegroundWindow();        [DllImport("user32.dll")] private static extern       IntPtr GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId);        [DllImport("user32.dll")] private static extern       IntPtr AttachThreadInput(IntPtr idAttach, IntPtr idAttachTo, int fAttach);     /// <summary>        /// Win32 API Constants for ShowWindowAsync()        /// </summary>        private const int SW_HIDE = 0;        private const int SW_SHOWNORMAL = 1;        private const int SW_SHOWMINIMIZED = 2;        private const int SW_SHOWMAXIMIZED = 3;        private const int SW_SHOWNOACTIVATE = 4;        private const int SW_RESTORE = 9;        private const int SW_SHOWDEFAULT = 10;     /// <summary>        /// Private Fields        /// </summary>        private IntPtr m_hWnd;        private string m_Title;        private bool m_Visible = true;        private string m_Process;        private bool m_WasMax = false;     /// <summary>        /// Window Object's Public Properties        /// </summary>        public IntPtr hWnd        {       get{return m_hWnd;}        }    &nbs

您可能感兴趣的文章:
Window Hiding with C#(ZT)
javascript with用法分享
Form Tooltip
整理的40个有用的jQuery技术和教程
A Study of WebRTC Security
如何用Visual C#来创建、修改注册信息 <zt>
jquery插件ScrollTo
Visual C#资源文件编程--使用资源文件 <zt>-Windows开发-.NET
js 可拖动层
javascript事件 pageshow和pagehide事件的实例详解

[关闭]
~ ~