oziel Posted March 19, 2014 Report Share Posted March 19, 2014 Olá. Estou com um problema em meu sistema de RH, pois vários usuários estão fechando o programa no X da tela inicial, isso provoca o não fechamento dos arquivos, o problema surge depois. Em uma Dialog é só desabilitar o Caption - mas não sei como fazer na tela inicial. Abraços. OZIEL LOPES Quote Link to comment Share on other sites More sharing options...
Theotokos Posted March 19, 2014 Report Share Posted March 19, 2014 Tente assim: lSair := .F. DEFINE WINDOWS .... ACTIVATE WINDOW oWndMain Valid (lSair) **** Ai no botão ou rotina que vc utiliza para sair vc coloca : lSair := .T. Quote Link to comment Share on other sites More sharing options...
oziel Posted March 20, 2014 Author Report Share Posted March 20, 2014 Obrigado. Vou testar e depois dou o retorno. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 20, 2014 Report Share Posted March 20, 2014 Ola, voce tambem pode TIRAR O X desta forma: ACTIVATE WINDOW oWnd MAXIMIZED ; ON INIT( TIRA_X() ) ; VALID ENCERRA( oWnd ) /* SHOWTASKBAR() // Habilita HIDETASKBAR() // Desabilita TIRA_X() // Desabilita o X da Janela PISCA_EXE() // Vai Piscar o Seu EXE na Barra do Windows */ #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 ) // HABILUTA O X da janela { HMENU MenuH = GetSystemMenu(GetForegroundWindow(),TRUE); EnableMenuItem(MenuH,SC_CLOSE,MF_GRAYED); } #pragma ENDDUMP abs Quote Link to comment Share on other sites More sharing options...
Eduardo Bilato Posted March 21, 2014 Report Share Posted March 21, 2014 Boa tarde Oziel Você poderia tentar também modificar a classe. Altere o método END() da classe tWindow de: METHOD End() BLOCK ; // It has to be Block { | Self, lEnd | If( lEnd := ::lValid(), ::PostMsg( WM_CLOSE ),), lEnd } Para: METHOD End() BLOCK ; // It has to be Block { | Self, lEnd | If( lEnd := ::lValid(),( ::PostMsg( WM_CLOSE ), CLOSE ALL ),), lEnd } Não testei pra saber se o CLOSE ALL daria certo, é uma sugestão Quote Link to comment Share on other sites More sharing options...
joaosolution Posted March 21, 2014 Report Share Posted March 21, 2014 Boa tarde Não é só colocar DbCloseAll() após a MDI principal? Att João Bosco 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.