Leudassdf Posted April 29, 2012 at 10:35 AM Report #452016 Posted April 29, 2012 at 10:35 AM Boas pessoal Estou a tentar colocar o meu form em tela cheia, ou seja preencher totalmente o ecra ocultando tambem o menu iniciar... No entanto so consigo coloca-lo como maximizado. Sera possivel ocultar a barra do iniciar?
Lukas S. Posted April 29, 2012 at 11:07 AM Report #452021 Posted April 29, 2012 at 11:07 AM http://www.dreamincode.net/forums/topic/100681-to-hide-taskbar-when-my-application-runs/ tenta isso E o Impossível foi criado por pessoas fracas pra acabar com o sonho das pessoas fortes. Não deixes que acabem com o teu. Sonha , luta , ambiciona e realiza. Se amas , se gostas tu vais conseguir. Cala todas as pessoas que um dia duvidaram de ti e prova que foste mais forte de qualquer outro.
Leudassdf Posted April 29, 2012 at 11:29 AM Author Report #452022 Posted April 29, 2012 at 11:29 AM http://www.dreamincode.net/forums/topic/100681-to-hide-taskbar-when-my-application-runs/ tenta isso no windows 7 nao funciona! obrigada a mesma
Lukas S. Posted April 29, 2012 at 11:55 AM Report #452025 Posted April 29, 2012 at 11:55 AM bem se esse não funcionou eu encontrei um código em C++ sendo que basta só converteres em qualquer ferramenta online /* * Copyright (c) 2008..11 by Simon Baer * * You may use this code for whatever you want. */ using System; using System.Text; using System.Runtime.InteropServices; using System.Diagnostics; namespace TaskbarHide { /// <summary> /// Helper class for hiding/showing the taskbar and startmenu on /// Windows XP and Vista. /// </summary> public static class Taskbar { [DllImport("user32.dll")] private static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count); [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern bool EnumThreadWindows(int threadId, EnumThreadProc pfnEnum, IntPtr lParam); [DllImport("user32.dll", SetLastError = true)] private static extern System.IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll", SetLastError = true)] private static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle); [DllImport("user32.dll")] private static extern IntPtr FindWindowEx(IntPtr parentHwnd, IntPtr childAfterHwnd, IntPtr className, string windowText); [DllImport("user32.dll")] private static extern int ShowWindow(IntPtr hwnd, int nCmdShow); [DllImport("user32.dll")] private static extern uint GetWindowThreadProcessId(IntPtr hwnd, out int lpdwProcessId); private const int SW_HIDE = 0; private const int SW_SHOW = 5; private const string VistaStartMenuCaption = "Start"; private static IntPtr vistaStartMenuWnd = IntPtr.Zero; private delegate bool EnumThreadProc(IntPtr hwnd, IntPtr lParam); /// <summary> /// Show the taskbar. /// </summary> public static void Show() { SetVisibility(true); } /// <summary> /// Hide the taskbar. /// </summary> public static void Hide() { SetVisibility(false); } /// <summary> /// Sets the visibility of the taskbar. /// </summary> public static bool Visible { set { SetVisibility(value); } } /// <summary> /// Hide or show the Windows taskbar and startmenu. /// </summary> /// <param name="show">true to show, false to hide</param> private static void SetVisibility(bool show) { // get taskbar window IntPtr taskBarWnd = FindWindow("Shell_TrayWnd", null); // try it the WinXP way first... IntPtr startWnd = FindWindowEx(taskBarWnd, IntPtr.Zero, "Button", "Start"); if (startWnd == IntPtr.Zero) { // try an alternate way, as mentioned on CodeProject by Earl Waylon Flinn startWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, (IntPtr)0xC017, "Start"); } if (startWnd == IntPtr.Zero) { // ok, let's try the Vista easy way... startWnd = FindWindow("Button", null); if (startWnd == IntPtr.Zero) { // no chance, we need to to it the hard way... startWnd = GetVistaStartMenuWnd(taskBarWnd); } } ShowWindow(taskBarWnd, show ? SW_SHOW : SW_HIDE); ShowWindow(startWnd, show ? SW_SHOW : SW_HIDE); } /// <summary> /// Returns the window handle of the Vista start menu orb. /// </summary> /// <param name="taskBarWnd">windo handle of taskbar</param> /// <returns>window handle of start menu</returns> private static IntPtr GetVistaStartMenuWnd(IntPtr taskBarWnd) { // get process that owns the taskbar window int procId; GetWindowThreadProcessId(taskBarWnd, out procId); Process p = Process.GetProcessById(procId); if (p != null) { // enumerate all threads of that process... foreach (ProcessThread t in p.Threads) { EnumThreadWindows(t.Id, MyEnumThreadWindowsProc, IntPtr.Zero); } } return vistaStartMenuWnd; } /// <summary> /// Callback method that is called from 'EnumThreadWindows' in 'GetVistaStartMenuWnd'. /// </summary> /// <param name="hWnd">window handle</param> /// <param name="lParam">parameter</param> /// <returns>true to continue enumeration, false to stop it</returns> private static bool MyEnumThreadWindowsProc(IntPtr hWnd, IntPtr lParam) { StringBuilder buffer = new StringBuilder(256); if (GetWindowText(hWnd, buffer, buffer.Capacity) > 0) { Console.WriteLine(buffer); if (buffer.ToString() == VistaStartMenuCaption) { vistaStartMenuWnd = hWnd; return false; } } return true; } } } E o Impossível foi criado por pessoas fracas pra acabar com o sonho das pessoas fortes. Não deixes que acabem com o teu. Sonha , luta , ambiciona e realiza. Se amas , se gostas tu vais conseguir. Cala todas as pessoas que um dia duvidaram de ti e prova que foste mais forte de qualquer outro.
Leudassdf Posted April 29, 2012 at 12:09 PM Author Report #452027 Posted April 29, 2012 at 12:09 PM bem se esse não funcionou eu encontrei um código em C++ sendo que basta só converteres em qualquer ferramenta online /* * Copyright (c) 2008..11 by Simon Baer * * You may use this code for whatever you want. */ using System; using System.Text; using System.Runtime.InteropServices; using System.Diagnostics; namespace TaskbarHide { /// <summary> /// Helper class for hiding/showing the taskbar and startmenu on /// Windows XP and Vista. /// </summary> public static class Taskbar { [DllImport("user32.dll")] private static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count); [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern bool EnumThreadWindows(int threadId, EnumThreadProc pfnEnum, IntPtr lParam); [DllImport("user32.dll", SetLastError = true)] private static extern System.IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll", SetLastError = true)] private static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle); [DllImport("user32.dll")] private static extern IntPtr FindWindowEx(IntPtr parentHwnd, IntPtr childAfterHwnd, IntPtr className, string windowText); [DllImport("user32.dll")] private static extern int ShowWindow(IntPtr hwnd, int nCmdShow); [DllImport("user32.dll")] private static extern uint GetWindowThreadProcessId(IntPtr hwnd, out int lpdwProcessId); private const int SW_HIDE = 0; private const int SW_SHOW = 5; private const string VistaStartMenuCaption = "Start"; private static IntPtr vistaStartMenuWnd = IntPtr.Zero; private delegate bool EnumThreadProc(IntPtr hwnd, IntPtr lParam); /// <summary> /// Show the taskbar. /// </summary> public static void Show() { SetVisibility(true); } /// <summary> /// Hide the taskbar. /// </summary> public static void Hide() { SetVisibility(false); } /// <summary> /// Sets the visibility of the taskbar. /// </summary> public static bool Visible { set { SetVisibility(value); } } /// <summary> /// Hide or show the Windows taskbar and startmenu. /// </summary> /// <param name="show">true to show, false to hide</param> private static void SetVisibility(bool show) { // get taskbar window IntPtr taskBarWnd = FindWindow("Shell_TrayWnd", null); // try it the WinXP way first... IntPtr startWnd = FindWindowEx(taskBarWnd, IntPtr.Zero, "Button", "Start"); if (startWnd == IntPtr.Zero) { // try an alternate way, as mentioned on CodeProject by Earl Waylon Flinn startWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, (IntPtr)0xC017, "Start"); } if (startWnd == IntPtr.Zero) { // ok, let's try the Vista easy way... startWnd = FindWindow("Button", null); if (startWnd == IntPtr.Zero) { // no chance, we need to to it the hard way... startWnd = GetVistaStartMenuWnd(taskBarWnd); } } ShowWindow(taskBarWnd, show ? SW_SHOW : SW_HIDE); ShowWindow(startWnd, show ? SW_SHOW : SW_HIDE); } /// <summary> /// Returns the window handle of the Vista start menu orb. /// </summary> /// <param name="taskBarWnd">windo handle of taskbar</param> /// <returns>window handle of start menu</returns> private static IntPtr GetVistaStartMenuWnd(IntPtr taskBarWnd) { // get process that owns the taskbar window int procId; GetWindowThreadProcessId(taskBarWnd, out procId); Process p = Process.GetProcessById(procId); if (p != null) { // enumerate all threads of that process... foreach (ProcessThread t in p.Threads) { EnumThreadWindows(t.Id, MyEnumThreadWindowsProc, IntPtr.Zero); } } return vistaStartMenuWnd; } /// <summary> /// Callback method that is called from 'EnumThreadWindows' in 'GetVistaStartMenuWnd'. /// </summary> /// <param name="hWnd">window handle</param> /// <param name="lParam">parameter</param> /// <returns>true to continue enumeration, false to stop it</returns> private static bool MyEnumThreadWindowsProc(IntPtr hWnd, IntPtr lParam) { StringBuilder buffer = new StringBuilder(256); if (GetWindowText(hWnd, buffer, buffer.Capacity) > 0) { Console.WriteLine(buffer); if (buffer.ToString() == VistaStartMenuCaption) { vistaStartMenuWnd = hWnd; return false; } } return true; } } } Em c++ isso funciona mas a conversao para vb e comlicada. pelo meno spara mim que nunca trabalhei com c++. E os conversores online nao funcionam na perfeiçao
cmd Posted April 29, 2012 at 01:10 PM Report #452029 Posted April 29, 2012 at 01:10 PM Com a pesquisa encontravas 😄 http://www.portugal-a-programar.pt/forums/topic/0-find-topic/?do=findComment&comment=446621 Cumps.cmd
Leudassdf Posted April 29, 2012 at 03:55 PM Author Report #452052 Posted April 29, 2012 at 03:55 PM Com a pesquisa encontravas 😄 http://www.portugal-a-programar.pt/forums/topic/0-find-topic/?do=findComment&comment=446621 A pesquisa fiz-la! principalmente no google. mas tudo o que encontrei nao resultava no windows 7. no link que me passas-te eu coloquei la uma pergunta pois nao entendi como funciona. Se puderes tentar explicar como devo fazer agradecia.
cmd Posted April 29, 2012 at 03:58 PM Report #452053 Posted April 29, 2012 at 03:58 PM Já lá fui e expliquei-te como era 😄 A declaração fazes na form que queres que fique em fullscreen. Esse formstate.maxime(me) deves colocar no evento do botão, ou outro controlo, quando quiseres que a form fique grande. Cumps.cmd
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now