Sign in to follow this  
Followers 0
morrison0586

GIF in GUI makes keyboard not operational

2 posts in this topic

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=beta
#AutoIt3Wrapper_Icon=Scripts\TEST.ico
#AutoIt3Wrapper_Outfile_x64=Restore.exe
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#Region
#EndRegion ;**** CREATED BY Morrison0586 ****
#include
#include
#include
#include
#include

#include "ExtMsgBox.au3"



Func TEST()
Local $Button_1, $Button_2, $Button_3, $Button_4, $msg, $font
$Form1 = GUICreate("RESTORE", 400, 400, -1, -1)
$menu = GUICtrlCreateGraphic(0, 0, 400, 400,$WS_CLIPSIBLINGS)

GUICtrlSetBkColor(-1, 0x000000)
GUISetFont(14, 400, 2, $font)
GUICtrlSetColor(1, 0x000099)
$oObj = ObjCreate("Shell.Explorer.2")
$oObj_ctrl = GUICtrlCreateObj($oObj, 325, 325, 75, 75)
GUICtrlSetBkColor(-1, 0x000000)
;resize control when the window resizes
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
;restrict right click

GUICtrlSetBkColor(-1, 0x000000)
$sGIF = @ScriptDir&"\test.gif"
;show the gif
$URL = "about:[img]"&$sGIF&[/img]"
$oObj.Navigate($URL)
GUISetState(@SW_SHOW)


$font = "Arial" ;***Note Primary Partition will be considered the "D" drive while running WINPE recovery unless you change it***
$FreeofC = DriveSpaceFree("c:\") ;Total Free Space of Recovery Partition
$RestoreSize = FileGetSize ("c:\urecovery.gho") / 1048576 ;This is needed to find the size of the recovery image if it exists
$String = ($FreeofC + $RestoreSize) ; This is the total free space of the Recovery Partition plus the file size of the recovery if it exists.
$TotalofD = DriveSpaceTotal( "d:\" ) ;Total Drive Size of Primary Partition
$FreeofD = DriveSpaceFree( "d:\" ) ;Free Space on Primary Partition
$UsedofD = $TotalofD - $FreeofD ;Total Drive Space used by Primary Partition
$String2 = $UsedofD / 1.5 ;1.5 is the ratio for the ghost image being created to the total size of the image it is creating it from
$fAgain = True




Opt("GUICoordMode", 1)

GUISetFont(14, 400, 2, $font)
$Button_1 = GUICtrlCreateButton("FACTORY RESET ", 50, 70, 300, 40)
GUICtrlSetBkColor(-1, 0x000099)
GUICtrlSetColor (-1,0xFFCC33)
GUISetFont(14, 400, 2, $font)
$Button_2 = GUICtrlCreateButton("RESTORE USER IMAGE", 50, 136, 300, 40)
GUICtrlSetBkColor(-1, 0x000099)
GUICtrlSetColor (-1,0xFFCC33)
GUISetFont(14, 400, 2, $font)
$Button_3 = GUICtrlCreateButton("CREATE USER IMAGE", 50, 202, 300, 40)
GUICtrlSetBkColor(-1, 0x000099)
GUICtrlSetColor (-1,0xFFCC33)
GUISetFont(14, 400, 2, $font)
$Button_4 = GUICtrlCreateButton("EXIT AND RESTART", 50, 270, 300, 40)
GUICtrlSetBkColor(-1, 0x000099)
GUICtrlSetColor (-1,0xFFCC33)
GUISetFont(14, 400, 2, $font)
GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
_ExtMsgBoxSet(3, 0, 0x000099, 0xFFCC33, 13, $font)
$nTest = _ExtMsgBox(48, "Restore|&Cancel", "WARNING!!!", "ALL UNSAVED WORK WILL BE LOST ARE YOU SURE YOU WANT TO CONTINUE?", 0)
If $nTest = 1 Then Run ("restore.bat") ;Will launch bat to start ghost to restore the original image on the recovery partition
If $nTest = 1 Then _ExtMsgBox(0, "OK", "IMAGE RESTORE", "FACTORY IMAGE IS NOW BEING RESTORED", 0)
Case $msg = $Button_2
_ExtMsgBoxSet(3, 0, 0x000099, 0xFFCC33, 13, $font)
$test123 = _ExtMsgBox(48, "Restore|&Cancel", "WARNING!!!", "ALL UNSAVED WORK WILL BE LOST ARE YOU SURE YOU WANT TO CONTINUE?", 0)
If $test123 = 1 Then Run ('u_restore.bat') ;Will launch bat to start ghost to restore the user image
If $test123 = 1 Then _ExtMsgBox(0, "OK", 'IMAGE RESTORE', 'USER IMAGE IS NOW BEING RESTORED', 0)
Case $msg = $Button_3

_ExtMsgBoxSet(3, 0, 0x000099, 0xFFCC33, 13, $font)
$nTest = _ExtMsgBox(48, "Create|&Cancel", "***Warning***", "***Creating the user image is not intended as a back-up method. It is designed soley to create a point where Windows Updates do not need to be downloaded again. There is not enough space to create a user image if your Hard Drive is full. Do you wish to Continue?***", 0)
If $nTest = 1 Then
Local $String
Local $String2
If $String > $String2 Then
Run('u_create.bat') ; Will run bat to create user image
_ExtMsgBox(0, "OK", 'IMAGE CREATION', 'USER IMAGE IS NOW BEING CREATED', 0)
EndIf
If $String < $String2 Then
_ExtMsgBox (16, "OK", 'Warning', 'There is not enough free space', 0)
EndIf
EndIf
Case $msg = $Button_4
_ExtMsgBoxSet(3, 0, 0x000099, 0xFFCC33, 13, $font)
$test123 = _ExtMsgBox(48, "Restart|&Cancel", "RESTART", "WOULD YOU LIKE TO RESTART?", 0)
If $test123 = 1 Then Run ('restart.bat')

EndSelect
WEnd
EndFunc
Hello All,

I am fairly new at this and I am having some issues. I know that this script is probably pretty sloppy so I appologize. Basically when I add the gif to my gui I can no longer use the keyboard to select my buttons, however mouse click works fine. If I take the gif entirely out of the script then everything works as it should. My problem is I do not know enough about this to make it work with the gif in it. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites



I got help from another thread please close.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0