Autoit en español
Aplicaciones con Autoit - Juan Antonio Villalpando
-- Tutorial de iniciación a Autoit --
Volver al índice del tutorial
____________________________
103.- Deshabilitar botones del Bloc de notas.
- Código obtenido en: https://gist.github.com/kissgyorgy/4519455
- Abre el Bloc de notas pero no le funciona el botón de cerrar, ni maximizar, ni se puede mover la ventana.
Deshabiliar botones. |
#include <GuiMenu.au3>
Run("Notepad")
WinWait("Sin título: Bloc de notas")
$handle = WinGetHandle("Sin título: Bloc de notas")
ConsoleWrite('+ Window Handle: ' & $handle & @CRLF)
DisableButton($handle, $SC_CLOSE)
; EnableButton($handle, $SC_CLOSE) ; Para habilitarlo quita el primer ;
DisableButton($handle, $SC_MAXIMIZE)
DisableButton($handle, $SC_RESTORE)
DisableButton($handle, $SC_MOVE)
Func DisableButton($hWnd, $iButton)
$hSysMenu = _GUICtrlMenu_GetSystemMenu($hWnd, 0)
_GUICtrlMenu_RemoveMenu($hSysMenu, $iButton, False)
_GUICtrlMenu_DrawMenuBar($hWnd)
EndFunc
Func EnableButton($hWnd, $iButton)
$hSysMenu = _GUICtrlMenu_GetSystemMenu($hWnd, 1)
_GUICtrlMenu_RemoveMenu($hSysMenu, $iButton, False)
_GUICtrlMenu_DrawMenuBar($hWnd)
EndFunc
|
- de https://www.autoitscript.com/forum/topic/57559-monitor-onoff-example/
_____
|