Preciso bloquear a execução do fivewin, caso hwgui esteja rodando.
Alguma idéia de como testar se hwgui tem alguma coisa aberta?
Como testar se hwgui está em uso?
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Como testar se hwgui está em uso?
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Como testar se hwgui está em uso?
Esqueci de uma coisa importante:
O teste normal não serve pra multithread.
Len() de aWindows e aDialogs não serve.
O teste normal não serve pra multithread.
Len() de aWindows e aDialogs não serve.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
-
alxsts
- Colaborador

- Mensagens: 3092
- Registrado em: 12 Ago 2008 15:50
- Localização: São Paulo-SP-Brasil
Como testar se hwgui está em uso?
Olá!
Talvez consiga usando a função Type() do [x]Harbour:
O retorno "UI" indica que a função foi linkeditada na aplicação. Não quer dizer que esteja sendo executada no momento da chamada da função Type().
Talvez consiga usando a função Type() do [x]Harbour:
Código: Selecionar todos
? Type( 'hMainWindow()' ) --> "UI"
? Type( 'hMainWindow():new()' ) --> "UI"
? Type( 'hDialog()' ) --> "UI"
? Type( 'hDialog():new()' ) --> "UI"[]´s
Alexandre Santos (AlxSts)
Alexandre Santos (AlxSts)
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Como testar se hwgui está em uso?
A idéia é boa, mas não dá.
Estou linqueditando hwgui e fivewin, juntos, hwgui e suas funções sempre vão existir.
Acho que não vai ter opção.
Janela aberta é visivel somente na thread, então não dá pra testar janela aberta, porque na thread atual nunca vai ter.
Deixar com erro mesmo, é coisa temporária.
Estou linqueditando hwgui e fivewin, juntos, hwgui e suas funções sempre vão existir.
Acho que não vai ter opção.
Janela aberta é visivel somente na thread, então não dá pra testar janela aberta, porque na thread atual nunca vai ter.
Deixar com erro mesmo, é coisa temporária.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Como testar se hwgui está em uso?
Pronto resolvido.
Usar normal, com controle único de janelas.
Agora a lista volta a ser geral, e não por thread.
Usar normal, com controle único de janelas.
Código: Selecionar todos
PRGFLAGS=-m -n -w3 -es2 -ge1 -DHB_NO_GTGUI=YES
##PRGFLAGS=-m -n -w3 -es2 -ge1 -DMT_EXPERIMENTAL -DHB_NO_GTGUI=YES
Código: Selecionar todos
FUNCTION HWGUIInUse()
IF Len( hWindow():aWindow ) > 0
RETURN .T.
ENDIF
IF Len( hDialog():aDialogs ) > 0
RETURN .T.
ENDIF
IF Len( hDialog():aModalDialogs ) > 0
RETURN .T.
ENDIF
RETURN .F.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/