Page 1 of 1

Problema con ToolBar - IsWindowActive - IsWindowDefined

Posted: Wed May 22, 2013 12:33 am
by Mario Mansilla
Hola Amigos :
Tengo un problema con el funcionamiento del control Toolbar :( .
Este se manifiesta cuando el usuario o bien clickea varias veces sin querer o bien no funciona bien su mouse , provocando que se ejecute varias veces la accion del control .
Esto provoca que me de error de ventana ya definida .
Probe con el uso de las funciones IsWindowDefined y IsWindowActive sin resultados .
Esto solo sucede con el control Toolbar , no con el control Button el cual funciona perfecto .
Estoy usando hmg.3.046 con su respectivo Ide con win xp sp2
Les adjunto un pequeño proyecto para que lo evaluen

Saludos cordiales
Mario Mansilla

Hello Friends:
I have a problem with the Toolbar control operation :( .
This occurs when the user either accidentally click a few times or your mouse is not working properly, causing it to run several times the action of the control.
This causes the error I already defined window.
Probe with using functions and IsWindowActive IsWindowDefined no results.
This only happens with the Toolbar control, not with the Button control which works perfect.
I'm using hmg.3.046 with their respective Ide with win xp sp2
I attached a small project for evaluation

Best Regards
Mario Mansilla

Re: Problema con ToolBar - IsWindowActive - IsWindowDefined

Posted: Wed May 22, 2013 12:47 am
by danielmaximiliano
Fijate esto:

Code: Select all

#include <hmg.ch>

Function Prg1

   If ! IsWindowDefined(Form_1)
        Load Window Form_1
        Form_1.Center
        Form_1.Activate
      	 
   Else
       If IsWindowActive(Form_1)
            Form_1.Setfocus
       Else
            Form_1.Restore	  
       Endif	
      
   Endif
   
Return

Re: Problema con ToolBar - IsWindowActive - IsWindowDefined

Posted: Wed May 22, 2013 2:55 am
by Mario Mansilla
Hola Daniel :
Perfecto funciona correctamente tambien con ventanas child que es el objeto de estas pruebas :) .
Ahora no entiendo porque se manifestaba con el control Toolbar y no el control Button :? .
Saludos .
Mario Mansilla

Re: Problema con ToolBar - IsWindowActive - IsWindowDefined

Posted: Wed May 22, 2013 3:39 am
by Rathinagiri
Very nice Daniel. :)