A Class To Hide Show Task Bar (Works With XP)
2012-04-01 14:49
375 查看
using System; using System.Runtime.InteropServices; /// /// This class will show or hide windows taskbar for full screen mode. /// internal class HandleTaskBar { private const int SWP_HIDEWINDOW = 0x0080; private const int SWP_SHOWWINDOW = 0x0040; /// /// Default Constructor. /// public HandleTaskBar() { } [DllImport("User32.dll", EntryPoint="FindWindow")] private static extern int FindWindow(string lpClassName, string lpWindowName); [DllImport("User32.dll")] private static extern int SetWindowPos(int hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags); /// /// Show the TaskBar. /// public static void showTaskBar() { int hWnd = FindWindow("Shell_TrayWnd", ""); SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW); } /// /// Hide the TaskBar. /// public static void hideTaskBar() { int hWnd = FindWindow("Shell_TrayWnd", ""); SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW); } }
相关文章推荐
- unable to dequeue a cell with identifier cell - must register a nib or a class for the identifier or
- How to solve the problem "A project with an Output Type of Class Library cannot be started directly "
- p/invoke SendMessage to Control scroll bar, and implement a simple compare windows with RichTextBox
- How to hide and show elements based on a Content Control value change?
- 启动Spring Boot 项目 报错:Application failed to start with classpath
- unable to dequeue a cell with identifier - must register a nib or a class for the identifier...问题
- Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005
- java.lang.ClassCastException: android.app.ActionBar$LayoutParams cannot be cast to android.widget.Ab
- Excution failed for task ':app:transformClassWithDexForDebug'
- Retrieving the COM class factory for component with CLSID … failed due to the following error: 80070005.
- Attempt to invoke virtual method 'void android.app.ActionBar.hide()' on a null object reference
- Narrowing proxy to class org.jbpm.graph.node.TaskNode
- 网易云课堂 - Class Two and Three - How to make your works professional.
- Function is used to Show/Hide the TaskBar
- Showing progress bar with class
- Execution failed for task ':app:compileDebugJavaWithJavac'. Failed to create MD5 hash for file ...
- 解决Error:Execution failed for task ':show_entry:transformResourcesWithMergeJavaResForDebug'. > com.an
- Failed to load AppCompat ActionBar with unknown error
- 使用sqoop连接oracle 出的异常, Imported Failed: Attempted to generate class with no columns? 附解决方案
- Add reference count capability to your class with a template class