Jump to content
Fivewin Brasil

oWndMain() - não fechar por X


oziel

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...