kapiaba Posted March 6, 2014 Report Share Posted March 6, 2014 #Define SW_HIDE 0 // &H0 #Define SW_SHOWNA 8 // &H8 #Define SW_SHOW 5 // &H5 #Define SW_SHOWNORMAL 1 #Define SW_NORMAL 1 #Define SW_MAXIMIZE 3 #Define SW_MINIMIZE 6 #Define SW_RESTORE 9 entrando no modulo... funciona parcialmente some tudo, menos o Botão <Iniciar> // "Escondendo a barra de tarefas" - O botão INICIAR continua visivel... ShowWindow(FindWindow( 'Shell_TrayWnd',nil), SW_HIDE ) saindo do modulo... // "Exibindo a barra de tarefas" ShowWindow(FindWindow( 'Shell_TrayWnd',nil), SW_SHOWNA) // funciona Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 6, 2014 Author Report Share Posted March 6, 2014 Nem seguindo a dica do Daniel funciona: http://forums.fivetechsupport.com/viewtopic.php?f=6&t=13704 Obg. abs. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 6, 2014 Author Report Share Posted March 6, 2014 No funciona mismo... #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 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 6, 2014 Author Report Share Posted March 6, 2014 // \samples\TASKBAR.PRG no funciona #Include "FiveWin.ch" STATIC odlg //-------------------------------------------------------------// FUNCTION Main() // local oDlg DEFINE DIALOG oDlg FROM 6, 6 TO 20, 60 TITLE "Hide and Show Taskbar" @ 2, 2 BUTTON "&Hide" OF oDlg ; ACTION task_bar_on(.f.) @ 4, 2 BUTTON "&Show" OF oDlg ; ACTION task_bar_on(.t.) ACTIVATE DIALOG oDlg ; VALID MsgYesNo( "Want to end ?" ) return(NIL) function task_bar_on(ison) local hwnd hwnd= FindWndByClass("Shell_TrayWnd", "") If ison ShowWindow(hwnd,5) Else ShowWindow(hwnd,0) End If return(NIL) DLL32 Function ShowWindow(hwnd as LONG, nCmdShow as LONG) AS LONG ; PASCAL FROM "ShowWindow" Lib "user32.dll" DLL32 Function FindWndByClass(wndClass AS LPSTR,WndName as LPSTR) AS LONG ; PASCAL FROM "FindWindowA" LIB "user32.dll" Quote Link to comment Share on other sites More sharing options...
rochinha Posted July 27, 2014 Report Share Posted July 27, 2014 Amiguinho, Tempo atrás voce solicitou esta solução no forum PCToledo, mas não deu retorno. E então conseguiu resolver? como resolveu? Codigo : #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. kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 28, 2014 Author Report Share Posted July 28, 2014 Obrigado Rochinha, realmente no rWindows 7, tem algum efeito colateral que eu não entendi. Abs Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 28, 2014 Author Report Share Posted July 28, 2014 Não me funcionou desta maneira também: SetWindowPos( oWin:hWnd, -1, 0, 0, 0, 0, 3 ) rochinha 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.