Página 1 de 1

Botão Iniciar do Windows 7 não invisibiliza

Enviado: 06 Mar 2014 12:42
por Kapiaba
Não funciona mesmo...

Código: Selecionar todos

#include "FiveWin.ch"
#Include "Objects.Ch"

#Define SW_HIDE              0 // &H0
#Define SW_SHOWNA            8 // &H8
#Define SW_SHOW              5 // &H5
#Define SW_SHOWNORMAL        1

static oWnd

//----------------------------------------------------------------//

function Main()

   local oBar

   //para volver a mostrar cambia el valor de 0 a 1
   ShowWindow( FindWindow( "Shell_TrayWnd", "" ), 0 ) // Taskbar
   ShowWindow( FindWindow( "Button", "Start" ), 0 )   // Vista round button
   // EN C:\FWH1306\SAMPLES\GETTIME.PRG

   DEFINE WINDOW oWnd TITLE "Boton Iniciar de Win 7"

   DEFINE BUTTONBAR oBar _3D OF oWnd

   DEFINE BUTTON OF oBar ACTION WIN_INVISIBLE()

   SET MESSAGE OF oWnd TO "Boton Iniciar de Win 7" NOINSET CLOCK DATE KEYBOARD

   ACTIVATE WINDOW oWnd

            /*;
            ON INIT( HIDETASKBAR() )  // DESHABILITA No funciona.
            // By Manuel Mercado.
            */

   ShowWindow( FindWindow( "Shell_TrayWnd", "" ), 1 )
   ShowWindow( FindWindow( "Button", "Start" ), 1 )

//   SHOWTASKBAR()  // HABILITA

return nil

FUNCTION WIN_INVISIBLE()

   ? [boton del windows 7 invisible?]

   ShowWindow( FindWindow( "Shell_TrayWnd", "" ), 0 ) // Taskbar
   ShowWindow( FindWindow( "Button", "Start" ), 0 )   // Vista round button

   //para volver a mostrar cambia el valor de 0 a 1

RETURN NIL


// Tambien no funciona

/*
SHOWTASKBAR()  // habilita
HIDETASKBAR()  // desabilita
TIRA_X()       // DESABILITA O X da janela
PISCA_EXE()    // VAI PISCAR O SEU EXE NA BARRA
*/

#pragma BEGINDUMP

#include "windows.h"
#include "shlobj.h"
#include "hbapi.h"
#include "math.h"
#include "hbvm.h"
#include "hbstack.h"
#include "hbapiitm.h"
#include "hbapigt.h"

HB_FUNC ( SHOWTASKBAR ) //Habilita o botao INICIAR
{
HWND hWnd = FindWindow("Shell_TrayWnd", "");

ShowWindow( hWnd, 1 );
}

HB_FUNC ( HIDETASKBAR ) //Desabilita o botao Iniciar
{
HWND hWnd = FindWindow("Shell_TrayWnd", "");

ShowWindow( hWnd, 0 );
}

HB_FUNC ( PISCA_EXE ) // VAI PISCAR O SEU EXE NA BARRA
{
HWND Handle = GetForegroundWindow();

FlashWindow(Handle,TRUE); // VAI PISCAR O SEU EXE NA BARRA

Sleep(300); // TEMPO DE ESPERA
}

HB_FUNC ( TIRA_X ) // DESABILITA O X da janela

{
HMENU MenuH = GetSystemMenu(GetForegroundWindow(),FALSE);

EnableMenuItem(MenuH,SC_CLOSE,MF_GRAYED);
}

HB_FUNC ( VOLTA_X ) // HABILITA O X da janela

{
HMENU MenuH = GetSystemMenu(GetForegroundWindow(),TRUE);

EnableMenuItem(MenuH,SC_CLOSE,MF_GRAYED);
}

#pragma ENDDUMP

Botão Iniciar do Windows 7 não invisibiliza

Enviado: 05 Jun 2014 01:45
por rochinha
Amiguinho,

Codigo :

Código: Selecionar todos

#include "FiveWin.ch"
#include "dll.ch"

#Define SW_HIDE       0 // &H0
#Define SW_SHOWNA     8 // &H8
#Define SW_SHOW       5 // &H5
#Define SW_SHOWNORMAL 1

static oWnd

//----------------------------------------------------------------------------//
function Main()

   DEFINE WINDOW oWnd TITLE "Boton Iniciar de Win 7"
          DEFINE BUTTONBAR oBar _3D OF oWnd
          DEFINE BUTTON OF oBar ACTION TaskBarInvisivel()
          DEFINE BUTTON OF oBar ACTION TaskBarVisivel()
          DEFINE BUTTON OF oBar ACTION StartButtonInvisivel()
          DEFINE BUTTON OF oBar ACTION StartButtonVisivel()
          SET MESSAGE OF oWnd TO "Boton Iniciar de Win 7" NOINSET CLOCK DATE KEYBOARD
   ACTIVATE WINDOW oWnd //;
      //ON INIT( HIDETASKBAR() )

return nil

//----------------------------------------------------------------------------//
FUNCTION TaskBarInvisivel()
   ShowWindow( FindWindow( "Shell_TrayWnd", "" ), 0 ) // Taskbar
   //ShowWindow( FindWindow( "Button", "Start" ), 0 ) // Vista round button
   RETURN NIL

//----------------------------------------------------------------------------//
FUNCTION TaskBarVisivel()
   ShowWindow( FindWindow( "Shell_TrayWnd", "" ), 1 ) // Taskbar
   //ShowWindow( FindWindow( "Button", "Start" ), 1 ) // Vista round button
   RETURN NIL

//----------------------------------------------------------------------------//
FUNCTION StartButtonInvisivel()
   ShowWindow( FindWindowEx( FindWindow( "Shell_TrayWnd", "" ), 0, "Button", nil ), 0 ) // Taskbar
   ShowWindow( FindWindowEx( FindWindow( "Button", "Start" ), 0, "Button", nil ), 0 ) // Vista round button
   RETURN NIL

//----------------------------------------------------------------------------//
FUNCTION StartButtonVisivel()
   ShowWindow( FindWindowEx( FindWindow( "Shell_TrayWnd", "" ), 0, "Button", nil ), 1 ) // Taskbar
   ShowWindow( FindWindowEx( FindWindow( "Button", "Start" ), 0, "Button", nil ), 1 ) // Vista round button
   RETURN NIL

DLL32 FUNCTION FindWindowEx( hWndParent AS LONG, hWndChildAfter AS LONG, lpszClass AS STRING, lpszWindow AS STRING ) AS LONG PASCAL FROM "FindWindowExA" LIB "user32"
Testei no Windows 2003 Server e no Windows Seven Ultimate.

- Os dois primeiros botões manejam a barra em si, sendo que no W2K3 esconde tudo e mostra tudo. No W7 esconde/mostra somente a barra.
- Os dois segundos botões manejam o botão Iniciar, sendo que no W2K3 esconde/mostra. No W7 voce terá de mesclar os comandos para esconder a barra e o botão junto já que ocorre algo estranho.

Mas o básico é isto ai. Bom trabalho.