Compare commits

..

No commits in common. 'master' and 'old' have entirely different histories.
master ... old

  1. 273
      Change_bootloader.au3
  2. 4
      README.md
  3. 537
      include/GUICtrlOnHover.au3
  4. BIN
      sec.ico

273
Change_bootloader.au3

@ -1,19 +1,27 @@
#include <GUIConstantsEx.au3> #include <GUIConstantsEx.au3>
#include <GuiConstants.au3> #include <GuiConstants.au3>
#include <file.au3> #include <file.au3>
#include ".\Include\GUICtrlOnHover.au3"
#NoTrayIcon #NoTrayIcon
#RequireAdmin #RequireAdmin
#pragma compile(Stripper, True) #pragma compile(Stripper, True)
#pragma compile(ProductVersion, 3.0.1) #pragma compile(ProductVersion, 2.0.0)
#pragma compile(ProductName, "Change bootLoader") #pragma compile(ProductName, "Change bootLoader")
#pragma compile(FileDescription, CBL) #pragma compile(FileDescription, CBL)
#pragma compile(LegalCopyright, paravis.ru@2024) #pragma compile(LegalCopyright, paravis.ru@2022)
#pragma compile(CompanyName, paravis.ru@2024) #pragma compile(CompanyName, paravis.ru@2022)
Opt("TrayIconHide", 1)
Opt("ExpandEnvStrings", 1) Opt("ExpandEnvStrings", 1)
$sDisk = StringLeft(@ScriptDir, 2)
$boot = ($sDisk & "\efi\Paravis\Boot") Global $szdrive, $szdir, $szfname, $szext, $img
$bootice = ($sDisk & "\efi\Paravis\Boot\bootice.exe")
$main = GUICreate("Change BootLoader", 390, 125, 318, 213) $testpath = _pathsplit(@ScriptFullPath, $szdrive, $szdir, $szfname, $szext)
$namedisk = ($testpath[1] & "\")
$kitchen = ($namedisk & "efi\Paravis\Boot\kitchen")
$bootice = ($namedisk & "efi\Paravis\Boot\kitchen\bootice.exe")
$main = GUICreate("Change BootLoader", 390, 184, 318, 213)
GUICtrlCreateGroup("Legacy BIOS", 3, 3, 384, 61) GUICtrlCreateGroup("Legacy BIOS", 3, 3, 384, 61)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$xor = GUICtrlCreateButton("Install XorBoot", 8, 20, 121, 33) $xor = GUICtrlCreateButton("Install XorBoot", 8, 20, 121, 33)
@ -29,67 +37,272 @@ $bmgru = GUICtrlCreateButton("Install Bootmgr (SecureBoot ON)", 8, 80, 180, 33)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$xoru = GUICtrlCreateButton("Install Xorboot (SecureBoot OFF)", 200, 80, 180, 33) $xoru = GUICtrlCreateButton("Install Xorboot (SecureBoot OFF)", 200, 80, 180, 33)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
GUICtrlCreateGroup("Xorboot / Grub4dos Theme", 3, 121, 384, 61)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$theme1 = GUICtrlCreateButton("Light Blue Theme", 8, 137, 121, 33)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$theme2 = GUICtrlCreateButton("Dark Violet Theme", 134, 137, 121, 33)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$theme3 = GUICtrlCreateButton("Colorful Theme", 261, 137, 121, 33)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$img1 = GUICreate("", 400, 300, -1, -1, $ws_popup, $ws_ex_composited, $main)
$pic1 = GUICtrlCreatePic($kitchen & "\Legacy\L", 0, 0, 400, 300)
$img2 = GUICreate("", 400, 300, -1, -1, $ws_popup, $ws_ex_composited, $main)
$pic2 = GUICtrlCreatePic($kitchen & "\Legacy\V", 0, 0, 400, 300)
$img3 = GUICreate("", 400, 300, -1, -1, $ws_popup, $ws_ex_composited, $main)
$pic3 = GUICtrlCreatePic($kitchen & "\Legacy\C", 0, 0, 400, 300)
GUISetState(@SW_HIDE, $img1)
GUISetState(@SW_HIDE, $img2)
GUISetState(@SW_HIDE, $img3)
GUISetState(@SW_SHOW, $main) GUISetState(@SW_SHOW, $main)
Func _hide() Func _hide()
GUICtrlSetState($xor, $gui_disable) GUICtrlSetState($xor, $gui_disable)
GUICtrlSetState($bmgr, $gui_disable) GUICtrlSetState($bmgr, $gui_disable)
GUICtrlSetState($g4d, $gui_disable) GUICtrlSetState($g4d, $gui_disable)
GUICtrlSetState($bmgru, $gui_disable) GUICtrlSetState($bmgru, $gui_disable)
GUICtrlSetState($xoru, $gui_disable) GUICtrlSetState($xoru, $gui_disable)
GUICtrlSetState($theme1, $gui_disable)
GUICtrlSetState($theme2, $gui_disable)
GUICtrlSetState($theme3, $gui_disable)
EndFunc EndFunc
Func _show() Func _show()
GUICtrlSetState($xor, $gui_enable) GUICtrlSetState($xor, $gui_enable)
GUICtrlSetState($bmgr, $gui_enable) GUICtrlSetState($bmgr, $gui_enable)
GUICtrlSetState($g4d, $gui_enable) GUICtrlSetState($g4d, $gui_enable)
GUICtrlSetState($bmgru, $gui_enable) GUICtrlSetState($bmgru, $gui_enable)
GUICtrlSetState($xoru, $gui_enable) GUICtrlSetState($xoru, $gui_enable)
GUICtrlSetState($theme1, $gui_enable)
GUICtrlSetState($theme2, $gui_enable)
GUICtrlSetState($theme3, $gui_enable)
EndFunc
Func _onhover1()
GUISetState(@SW_SHOWNOACTIVATE, $img1)
EndFunc
Func _onleave1()
GUISetState(@SW_HIDE, $img1)
EndFunc
Func _onhover2()
GUISetState(@SW_SHOWNOACTIVATE, $img2)
EndFunc
Func _onleave2()
GUISetState(@SW_HIDE, $img2)
EndFunc EndFunc
Func _onhover3()
GUISetState(@SW_SHOWNOACTIVATE, $img3)
EndFunc
Func _onleave3()
GUISetState(@SW_HIDE, $img3)
EndFunc
While 1 While 1
$mp = MouseGetPos()
WinMove($img1, "", $mp[0] + 30, $mp[1] + 30)
$mp = MouseGetPos()
WinMove($img2, "", $mp[0] + 30, $mp[1] + 30)
$mp = MouseGetPos()
WinMove($img3, "", $mp[0] + 30, $mp[1] + 30)
Switch GUIGetMsg() Switch GUIGetMsg()
Case $gui_event_close Case $gui_event_close
ExitLoop ExitLoop
Case $xor Case $xor
_hide() _hide()
FileDelete($sDisk & "\bootmgr") FileDelete($namedisk & "\bootmgr")
FileDelete($sDisk & "\grldr") FileDelete($namedisk & "\grldr")
RunWait($bootice & " /DEVICE=" & $sDisk & " /mbr /restore /file=" & $boot & "\xor\xmbr.bin /keep_dpt /quiet") FileCopy($kitchen & "\13", $namedisk & "efi\Paravis\boot\13", 1)
RunWait($bootice & " /DEVICE=" & $sDisk & " /pbr /restore /file=" & $boot & "\xor\xpbr.bin /keep_bpb /quiet") FileCopy($kitchen & "\1313", $namedisk & "efi\Paravis\boot\1313", 1)
FileCopy($kitchen & "\xbt.bin", $namedisk & "efi\Paravis\boot\Paravis", 1)
RunWait($bootice & " /DEVICE=" & $namedisk & " /mbr /restore /file=xbt.bin /keep_dpt /quiet")
RunWait($bootice & " /DEVICE=" & $namedisk & " /pbr /restore /file=xbt_p.bin /keep_bpb /quiet")
MsgBox(0 + 64 + 262144, "Xorboot", "bootloader successfully changed!") MsgBox(0 + 64 + 262144, "Xorboot", "bootloader successfully changed!")
_show() _show()
Case $bmgr Case $bmgr
_hide() _hide()
FileDelete(@ScriptDir & "Paravis") FileDelete(@ScriptDir & "Paravis")
FileDelete($sDisk & "\bootmgr") FileDelete($namedisk & "bootmgr")
FileDelete($sDisk & "\grldr") FileDelete($namedisk & "grldr")
FileCopy($boot & "\mgr\bootmgr", $sDisk & "\bootmgr") FileCopy($kitchen & "\bootmgr", $namedisk & "bootmgr")
RunWait($bootice & " /DEVICE=" & $sDisk & " /mbr /install /type=nt60 /quiet") FileCopy($kitchen & "\bootmgr", $namedisk & "efi\Paravis\boot\Paravis", 1)
RunWait($bootice & " /DEVICE=" & $sDisk & " /pbr /install /type=bootmgr /quiet") RunWait($bootice & " /DEVICE=" & $namedisk & " /mbr /install /type=nt60 /quiet")
RunWait($bootice & " /DEVICE=" & $namedisk & " /pbr /install /type=bootmgr /quiet")
MsgBox(0 + 64 + 262144, "Bootmgr", "bootloader successfully changed!") MsgBox(0 + 64 + 262144, "Bootmgr", "bootloader successfully changed!")
_show() _show()
Case $g4d Case $g4d
_hide() _hide()
FileDelete($sDisk & "\bootmgr") FileDelete($namedisk & "bootmgr")
FileDelete($sDisk & "\grldr") FileDelete($namedisk & "grldr")
FileCopy($boot & "\g4d\grldr", $sDisk & "\grldr") FileCopy($kitchen & "\grldr", $namedisk & "grldr")
RunWait($bootice & " /DEVICE=" & $sDisk & " /mbr /install /type=GRUB4DOS /quiet") FileCopy($kitchen & "\grldr", $namedisk & "efi\Paravis\boot\Paravis", 1)
RunWait($bootice & " /DEVICE=" & $sDisk & " /pbr /install /type=GRUB4DOS /quiet") RunWait($bootice & " /DEVICE=" & $namedisk & " /mbr /install /type=GRUB4DOS /quiet")
RunWait($bootice & " /DEVICE=" & $namedisk & " /pbr /install /type=GRUB4DOS /quiet")
MsgBox(0 + 64 + 262144, "Grub4Dos", "Bootloader successfully changed!") MsgBox(0 + 64 + 262144, "Grub4Dos", "Bootloader successfully changed!")
_show() _show()
Case $bmgru Case $bmgru
_hide() _hide()
FileDelete($sDisk & "\efi\boot\bootx64.efi") FileDelete($namedisk & "efi\boot\bootx64.efi")
FileDelete($sDisk & "\efi\boot\bootia32.efi") FileDelete($namedisk & "efi\boot\bootia32.efi")
FileCopy($sDisk & "\efi\Paravis\Boot\mgr\UEFI\bootx64.efi", $sDisk & "\efi\boot\bootx64.efi") FileDelete($namedisk & "efi\boot\bx86.pf")
FileCopy($sDisk & "\efi\Paravis\Boot\mgr\UEFI\bootia32.efi", $sDisk & "\efi\boot\bootia32.efi") FileDelete($namedisk & "efi\boot\hx86.pf")
FileDelete($namedisk & "efi\boot\x86.pf")
FileDelete($namedisk & "efi\boot\bx64.pf")
FileDelete($namedisk & "efi\boot\hx64.pf")
FileDelete($namedisk & "efi\boot\x64.pf")
FileCopy($kitchen & "\UEFIx64\mgrx64.efi", $namedisk & "efi\boot\bootx64.efi")
FileCopy($kitchen & "\UEFIx86\mgrx86.efi", $namedisk & "efi\boot\bootia32.efi")
MsgBox(0 + 64 + 262144, "UEFI Bootmgr", "Bootloader successfully changed!") MsgBox(0 + 64 + 262144, "UEFI Bootmgr", "Bootloader successfully changed!")
_show() _show()
Case $xoru Case $xoru
_hide() _hide()
FileDelete($sDisk & "\efi\boot\bootx64.efi") FileDelete($namedisk & "efi\boot\bootx64.efi")
FileDelete($sDisk & "\efi\boot\bootia32.efi") FileDelete($namedisk & "efi\boot\bootia32.efi")
FileCopy($sDisk & "\efi\Paravis\Boot\xor\UEFI\bootx64.efi", $sDisk & "\efi\boot\bootx64.efi") FileDelete($namedisk & "efi\boot\bx86.pf")
FileCopy($sDisk & "\efi\Paravis\Boot\xor\UEFI\bootia32.efi", $sDisk & "\efi\boot\bootia32.efi") FileDelete($namedisk & "efi\boot\hx86.pf")
FileDelete($namedisk & "efi\boot\x86.pf")
FileDelete($namedisk & "efi\boot\bx64.pf")
FileDelete($namedisk & "efi\boot\hx64.pf")
FileDelete($namedisk & "efi\boot\x64.pf")
FileCopy($kitchen & "\UEFIx64\bootx64.efi", $namedisk & "efi\boot\bootx64.efi")
FileCopy($kitchen & "\UEFIx86\bootia32.efi", $namedisk & "efi\boot\bootia32.efi")
FileCopy($kitchen & "\UEFIx86\bx86.pf", $namedisk & "efi\boot\bx86.pf")
FileCopy($kitchen & "\UEFIx86\hx86.pf", $namedisk & "efi\boot\hx86.pf")
FileCopy($kitchen & "\UEFIx86\x86.pf", $namedisk & "efi\boot\x86.pf")
FileCopy($kitchen & "\UEFIx64\bx64.pf", $namedisk & "efi\boot\bx64.pf")
FileCopy($kitchen & "\UEFIx64\hx64.pf", $namedisk & "efi\boot\hx64.pf")
FileCopy($kitchen & "\UEFIx64\x64.pf", $namedisk & "efi\boot\x64.pf")
MsgBox(0 + 64 + 262144, "UEFI Xorboot", "Bootloader successfully changed!") MsgBox(0 + 64 + 262144, "UEFI Xorboot", "Bootloader successfully changed!")
_show() _show()
Case $theme1
_hide()
If NOT FileExists($namedisk & "bootmgr") Then
FileCopy($kitchen & "\UEFIx64\Legacy_L\bx64.pf", $namedisk & "efi\boot\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_L\hx64.pf", $namedisk & "efi\boot\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_L\bx64.pf", $kitchen & "\UEFIx64\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_L\hx64.pf", $kitchen & "\UEFIx64\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_L\Linux\bx64.pf", $kitchen & "\UEFIx64\Linux\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_L\Linux\hx64.pf", $kitchen & "\UEFIx64\Linux\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_L\MSDaRT\bx64.pf", $kitchen & "\UEFIx64\MSDaRT\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_L\MSDaRT\hx64.pf", $kitchen & "\UEFIx64\MSDaRT\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_L\Utilits\bx64.pf", $kitchen & "\UEFIx64\Utilits\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_L\Utilits\hx64.pf", $kitchen & "\UEFIx64\Utilits\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_L\bx86.pf", $namedisk & "efi\boot\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_L\hx86.pf", $namedisk & "efi\boot\hx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_L\bx86.pf", $kitchen & "\UEFIx86\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_L\hx86.pf", $kitchen & "\UEFIx86\hx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_L\Linux\bx86.pf", $kitchen & "\UEFIx86\Linux\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_L\Linux\hx86.pf", $kitchen & "\UEFIx86\Linux\hx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_L\Utilits\bx86.pf", $kitchen & "\UEFIx86\Utilits\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_L\Utilits\hx86.pf", $kitchen & "\UEFIx86\Utilits\hx86.pf", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\G4D\UBCD", $namedisk & "efi\Paravis\UBCD\menus\UBCD", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\G4D\dartt", $kitchen & "\dartt", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\G4D\main", $kitchen & "\main", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\G4D\mintT", $kitchen & "\mintT", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\G4D\strT", $kitchen & "\strT", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\G4D\utilT", $kitchen & "\utilT", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\Xorboot\13", $namedisk & "efi\Paravis\Boot\13", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\Xorboot\1313", $namedisk & "efi\Paravis\Boot\1313", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\Xorboot\14", $namedisk & "efi\Paravis\Boot\14", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\Xorboot\1414", $namedisk & "efi\Paravis\Boot\1414", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\Xorboot\15", $namedisk & "efi\Paravis\Boot\15", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\Xorboot\1515", $namedisk & "efi\Paravis\Boot\1515", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\Xorboot\16", $namedisk & "efi\Paravis\Boot\16", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\Xorboot\1616", $namedisk & "efi\Paravis\Boot\1616", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\Xorboot\17", $namedisk & "efi\Paravis\Boot\17", 1)
FileCopy($kitchen & "\Legacy\Legacy_L\Xorboot\1717", $namedisk & "efi\Paravis\Boot\1717", 1)
MsgBox(0 + 64 + 262144, "Xorboot / Grub4dos Theme", "Theme successfully changed!")
Else
MsgBox(0 + 64 + 262144, "Xorboot / Grub4dos Theme", "First install the Xorboot or Grub4dos!")
EndIf
_show()
Case $theme2
_hide()
If NOT FileExists($namedisk & "bootmgr") Then
FileCopy($kitchen & "\UEFIx64\Legacy_V\bx64.pf", $namedisk & "efi\boot\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_V\hx64.pf", $namedisk & "efi\boot\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_V\bx64.pf", $kitchen & "\UEFIx64\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_V\hx64.pf", $kitchen & "\UEFIx64\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_V\Linux\bx64.pf", $kitchen & "\UEFIx64\Linux\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_V\Linux\hx64.pf", $kitchen & "\UEFIx64\Linux\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_V\MSDaRT\bx64.pf", $kitchen & "\UEFIx64\MSDaRT\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_V\MSDaRT\hx64.pf", $kitchen & "\UEFIx64\MSDaRT\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_V\Utilits\bx64.pf", $kitchen & "\UEFIx64\Utilits\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_V\Utilits\hx64.pf", $kitchen & "\UEFIx64\Utilits\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_V\bx86.pf", $namedisk & "efi\boot\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_V\hx86.pf", $namedisk & "efi\boot\hx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_V\bx86.pf", $kitchen & "\UEFIx86\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_V\hx86.pf", $kitchen & "\UEFIx86\hx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_V\Linux\bx86.pf", $kitchen & "\UEFIx86\Linux\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_V\Linux\hx86.pf", $kitchen & "\UEFIx86\Linux\hx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_V\Utilits\bx86.pf", $kitchen & "\UEFIx86\Utilits\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_V\Utilits\hx86.pf", $kitchen & "\UEFIx86\Utilits\hx86.pf", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\G4D\UBCD", $namedisk & "efi\Paravis\UBCD\menus\UBCD", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\G4D\dartt", $kitchen & "\dartt", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\G4D\main", $kitchen & "\main", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\G4D\mintT", $kitchen & "\mintT", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\G4D\strT", $kitchen & "\strT", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\G4D\utilT", $kitchen & "\utilT", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\Xorboot\13", $namedisk & "efi\Paravis\Boot\13", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\Xorboot\1313", $namedisk & "efi\Paravis\Boot\1313", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\Xorboot\14", $namedisk & "efi\Paravis\Boot\14", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\Xorboot\1414", $namedisk & "efi\Paravis\Boot\1414", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\Xorboot\15", $namedisk & "efi\Paravis\Boot\15", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\Xorboot\1515", $namedisk & "efi\Paravis\Boot\1515", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\Xorboot\16", $namedisk & "efi\Paravis\Boot\16", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\Xorboot\1616", $namedisk & "efi\Paravis\Boot\1616", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\Xorboot\17", $namedisk & "efi\Paravis\Boot\17", 1)
FileCopy($kitchen & "\Legacy\Legacy_V\Xorboot\1717", $namedisk & "efi\Paravis\Boot\1717", 1)
MsgBox(0 + 64 + 262144, "Xorboot / Grub4dos Theme", "Theme successfully changed!")
Else
MsgBox(0 + 64 + 262144, "Xorboot / Grub4dos Theme", "First install the Xorboot or Grub4dos!")
EndIf
_show()
Case $theme3
_hide()
If NOT FileExists($namedisk & "bootmgr") Then
FileCopy($kitchen & "\UEFIx64\Legacy_C\bx64.pf", $namedisk & "efi\boot\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_C\hx64.pf", $namedisk & "efi\boot\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_C\bx64.pf", $kitchen & "\UEFIx64\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_C\hx64.pf", $kitchen & "\UEFIx64\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_C\Linux\bx64.pf", $kitchen & "\UEFIx64\Linux\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_C\Linux\hx64.pf", $kitchen & "\UEFIx64\Linux\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_C\MSDaRT\bx64.pf", $kitchen & "\UEFIx64\MSDaRT\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_C\MSDaRT\hx64.pf", $kitchen & "\UEFIx64\MSDaRT\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_C\Utilits\bx64.pf", $kitchen & "\UEFIx64\Utilits\bx64.pf", 1)
FileCopy($kitchen & "\UEFIx64\Legacy_C\Utilits\hx64.pf", $kitchen & "\UEFIx64\Utilits\hx64.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_C\bx86.pf", $namedisk & "efi\boot\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_C\hx86.pf", $namedisk & "efi\boot\hx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_C\bx86.pf", $kitchen & "\UEFIx86\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_C\hx86.pf", $kitchen & "\UEFIx86\hx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_C\Linux\bx86.pf", $kitchen & "\UEFIx86\Linux\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_C\Linux\hx86.pf", $kitchen & "\UEFIx86\Linux\hx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_C\Utilits\bx86.pf", $kitchen & "\UEFIx86\Utilits\bx86.pf", 1)
FileCopy($kitchen & "\UEFIx86\Legacy_C\Utilits\hx86.pf", $kitchen & "\UEFIx86\Utilits\hx86.pf", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\G4D\UBCD", $namedisk & "efi\Paravis\UBCD\menus\UBCD", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\G4D\dartt", $kitchen & "\dartt", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\G4D\main", $kitchen & "\main", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\G4D\mintT", $kitchen & "\mintT", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\G4D\strT", $kitchen & "\strT", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\G4D\utilT", $kitchen & "\utilT", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\Xorboot\13", $namedisk & "efi\Paravis\Boot\13", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\Xorboot\1313", $namedisk & "efi\Paravis\Boot\1313", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\Xorboot\14", $namedisk & "efi\Paravis\Boot\14", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\Xorboot\1414", $namedisk & "efi\Paravis\Boot\1414", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\Xorboot\15", $namedisk & "efi\Paravis\Boot\15", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\Xorboot\1515", $namedisk & "efi\Paravis\Boot\1515", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\Xorboot\16", $namedisk & "efi\Paravis\Boot\16", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\Xorboot\1616", $namedisk & "efi\Paravis\Boot\1616", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\Xorboot\17", $namedisk & "efi\Paravis\Boot\17", 1)
FileCopy($kitchen & "\Legacy\Legacy_C\Xorboot\1717", $namedisk & "efi\Paravis\Boot\1717", 1)
MsgBox(0 + 64 + 262144, "Xorboot / Grub4dos Theme", "Theme successfully changed!")
Else
MsgBox(0 + 64 + 262144, "Xorboot / Grub4dos Theme", "First install the Xorboot or Grub4dos!")
EndIf
_show()
EndSwitch EndSwitch
WEnd WEnd

4
README.md

@ -2,6 +2,6 @@
Исходник Change bootloader'а (программа установки сборки на флешку). Исходник Change bootloader'а (программа установки сборки на флешку).
Все необходимые файлы для смены загрузчика, находятся уже на установленной флешке. Сама программа может лежать в любой папке на диске с установленной сборкой. Все необходимые файлы для смены загрузчика, а так же превью тем, находятся уже на установленной флешке. Сама программа может лежать в любой папке на диске с установленной сборкой.
НЕ ЗАПУСКАЙТЕ ИСХОДНИК И СКОМПИЛИРОВАННЫЙ EXE НА ДИСКАХ ГДЕ НЕТ СБОРКИ. В лучшем случае получите кучу ошибок. В худшем, угробите загрузочную запись диска. НЕ ЗАПУСКАЙТЕ ИСХОДНИК И СКОМПИЛИРОВАННЫЙ EXE НА ДИСКАХ ГДЕ НЕТ СБОРКИ. В лучшем случае получите кучу ошибок и не рабочие превью тем. В худшем, угробите загрузочную запись диска.

537
include/GUICtrlOnHover.au3

@ -0,0 +1,537 @@
#Region Header
#include-once
#CS UDF Info
Name.........: GUICtrlOnHover.au3
Forum link...: http://www.autoitscript.com/forum/index.php?s=&showtopic=55120
Author.......: G.Sandler a.k.a MrCreatoR (CreatoR's Lab, www.creator-lab.ucoz.ru, www.autoit-script.ru)
Remarks......:
1) TreeView/ListView Items can not be set :(.
2) When the window is not active, the hover/leave hover functions will still called, but not when the window is disabled.
3) The hover/leave hover functions will be called even if the script is paused by such functions as MsgBox().
4) The $sHover_Func/$sLeaveHover_Func functions should not introduce significant delays in the main script,
for example by calling functions like Sleep() or MsgBox().
5) IMPORTANT!
A) Do not call _GUICtrl_OnHoverRegister inside $sHover_Func/$sLeaveHover_Func functions, it's not a good idea.
B) This UDF registering WM_COMMAND and WM_LBUTTONDOWN window messages.
Please ensure that those messages are not used after including this library,
if they do, you will have to call __GUICtrl_SOH_WM_COMMAND and __GUICtrl_SOH_WM_LBUTTONDOWN inside those functions. Example:
Func MY_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
__GUICtrl_SOH_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
...
EndFunc
*** Version History ***
[v2.0] - [09.06.2010]
* Fixed potential issue with calling $sPrimaryDownFunc function (first call was performed only after recieving WM_COMMAND message, wich is the control event).
* Fixed an issue with blocking the OnHover function - the OnLeaveHover function was not called untill the OnHover function was blocked.
* Fixed(?) (again) issue when the UDF is not working under 64-bit OS.
* Optimized internal "__GUICtrl_SOH_Call" function to work faster when calling parameters functions.
[v1.9] - [21.05.2010]
* UDF library now compatible with AutoIt 3.3.6.1.
* UDF library renamed to GUICtrlOnHover.au3.
* Changed the main function name to _GUICtrl_OnHoverRegister, For backwards compatibility reasons, other (old) function names are still supported:
_GUICtrl_SetOnHover, GUICtrl_SetOnHover, GUICtrlSetOnHover, _GUICtrlSetOnHover
* Fixed(?) issue when the UDF is not working under 64-bit OS.
* Global variables and internal functions renaming (for "cosmetic" reasons only).
* UDF's code is more readable now.
[v1.8] - [28.09.2009]
* Few Global variables now have more unique name.
* Fixed an issue with false calling of function on PrimaryDown event.
I.e when the user clicks on other place (not on the hovered control) and drag the cursor to the control, the PrimaryDown function was called.
* Due to (and as a result of) previous issue, the UDF now registering WM_COMMAND and WM_LBUTTONDOWN messages at first UDF call.
[v1.7] - [07.07.2009]
+ Added _GUICtrl_SetHoverOnBackWindow...
Allows to set the hovering mode:
$iSetBackWin = 1 (default) hovering process will proceed even when GUI is not active (in background).
$iSetBackWin <> 1 hovering process will NOT proceed when GUI is not active.
[v1.6] - [12.06.2009]
* Now the UDF compatible with scripts (or other udfs) that uses OnAutoItExit function.
i.e: "OnAutoItExit" function that was *previously* set by user will be called as well.
+ Added new parameter $iKeepCall_Hover_Func. If this parameter = 1,
then the $sHover_Func function *Will* be called constantly untill the control is no longer been hovered
(default is 0, do not call the function constantly).
+ Added new arguments to calling function...
The OnPrimaryDown/Up function now can recieve one more argument:
$iClickMode - Defines the Click mode (1 - Pressed, 2 - Released)
* Changed return value - function will return 2 when $iCtrlID is redefined (ReSet, already exists in the controls list).
* Fixed incorrect documentation parts.
* Fixed "OnClick" handeling. When using multiple GUIs, the active gui was not recognized properly.
* Fixed(?) bug with "dimension range exceeded" when trying to UnSet a Control.
[v1.5]
+ Added AutoIt 3.2.10.0+ support, but 3.2.8.1 or less is dropped :( (due to lack of native CallBack functions).
+ Added Primary Down and Primary Up support. Helping to handle with the buttons pressing.
+ Added new arguments to calling function...
The OnHover function now can recieve two more arguments:
$iHoverMode - Defines the hover mode (1 - Hover, 2 - Leaves Hovering)
$hWnd_Hovered - Control Handle where the mouse is moved to (after hovering).
* Almost all code of this UDF was rewritted.
* Now the main function name is _GUICtrl_SetOnHover(),
but for backwards compatibility reasons, other (old) function names are still supported.
* Fixed bug with hovering controls in other apps.
* Improvements in generaly, the UDF working more stable now.
[v1.?]
* Beta changes, see "Forum link" for more details.
[v1.0]
* First release.
#CE
#EndRegion Header
#Region Internal Global Variables
Global $a__GUICtrl_SOH_Ctrls[1][1]
Global $a__GUICtrl_SOH_LastHoveredElements[2] = [-1, -1]
Global $a__GUICtrl_SOH_LastHoveredElementsMark = -1
Global $h__GUICtrl_SOH_LastClickedElementMark = -1
Global $i__GUICtrl_SOH_CtrlsModified = 0
Global $i__GUICtrl_SOH_HoverOnBackWin = 1
Global $i__GUICtrl_SOH_LastPrimaryDownCtrlID = 0
Global $p__GUICtrl_SOH_TimerProc = 0
Global $i__GUICtrl_SOH_TimerID = 0
Global $s__GUICtrl_SOH_User32_Dll = @SystemDir & "\User32.dll"
Global $s__GUICtrl_SOH_OnExitFunc = ""
If @AutoItVersion < "3.3.2.0" Then
$s__GUICtrl_SOH_OnExitFunc = Execute('Opt("OnExitFunc", "__GUICtrl_SOH_Exit")')
Else
Execute('OnAutoItExitRegister("__GUICtrl_SOH_Exit")')
EndIf
Global Const $n__GUICtrl_SOH_WM_COMMAND = 0x0111
Global Const $n__GUICtrl_SOH_WM_LBUTTONDOWN = 0x0201
#EndRegion Internal Global Variables
#Region Public Functions
; #FUNCTION# ====================================================================================================
; Name...........: _GUICtrl_OnHoverRegister
; Description....: Registers a function to be called when GUI elements been hovered.
; Syntax.........: _GUICtrl_OnHoverRegister($iCtrlID [, $sHover_Func="" [, $sLeaveHover_Func=-1 [, $sPrimaryDownFunc=-1 [, $sPrimaryUpFunc=-1 [, $iKeepCall_PrDn_Func=1 [, $iKeepCall_Hover_Func=0 ]]]]]])
;
; Parameters.....: $iCtrlID - The Ctrl ID to set hovering for (can be a -1 as indication to the last item created).
;
; $sHover_Func - [Optional] Function to call when the mouse is hovering the control.
; If this parameter passed as empty string (""),
; then the specified CtrlID is UnSet from Hovering Handler list.
;
; $sLeaveHover_Func - [Optional] Function to call when the mouse is leaving hovering the control
; (-1 no function used).
; * For both parameters, $sHover_FuncName and $sLeaveHover_FuncName,
; the specified function called with maximum 3 parameters:
; $iCtrlID - CtrlID of hovered control.
; $iHoverMode - Defines the hover mode (1 - Hover, 2 - Leaves Hovering).
; $hWnd_Hovered - Control Handle where the mouse is moved to (after hovering).
;
; $sPrimaryDownFunc - [Optional] Function to call when Primary mouse button is *clicked* on the control.
; (-1 -> function is not called).
;
; $sPrimaryUpFunc - [Optional] Function to call when Primary mouse button is *released* the control.
; (-1 -> function is not called).
;
; * For both parameters, $sPrimaryDownFunc and $sPrimaryUpFunc,
; the specified function called with maximum 2 parameters:
; $iCtrlID - CtrlID of clicked control.
; $iClickMode - Defines the click mode (1 - Pressed, 2 - Released).
;
; $iKeepCall_PrDn_Func - [Optional] If this parameter < 1,
; then the $sPrimaryDownFunc function will *Not* be called constantly untill
; the primary mouse button is released (default behaviour - $iKeepCall_PrDn_Func = 1).
;
; $iKeepCall_Hover_Func - [Optional] If this parameter = 1,
; then the $sHover_Func function *Will* be called constantly untill
; the control is no longer been hovered (default behaviour - $iKeepCall_Hover_Func = 0).
;
; Return values..: Success - Returns 1 if the function registered succesefully.
; When $iCtrlID is redefined (ReSet, already exists in the controls list), the return value is 2.
; Failure - Set @error to 1 and return 0 if $iCtrlID is not a GUI Control Identifier.
;
; Author.........: G.Sandler (a.k.a CreatoR), www.creator-lab.ucoz.ru, www.autoit-script.ru.
; Modified.......:
; Remarks........: 1) TreeView/ListView Items can not be set :(.
; 2) When the window is not active, the hover/leave hover functions will still called, but not when the window is disabled.
; 3) The hover/leave hover functions will be called even if the script is paused by such functions as MsgBox().
; 4) The $sHover_Func/$sLeaveHover_Func functions should not introduce significant delays in the main script,
; for example by calling functions like Sleep() or MsgBox().
; 5) IMPORTANT!
; A) Do not call _GUICtrl_OnHoverRegister inside $sHover_Func/$sLeaveHover_Func functions, it's not a good idea.
;
; B) This UDF registering WM_COMMAND and WM_LBUTTONDOWN window messages.
; Please ensure that those messages are not used after including this library,
; if they do, you will have to call __GUICtrl_SOH_WM_COMMAND and __GUICtrl_SOH_WM_LBUTTONDOWN inside those functions. Example:
;
; Func MY_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
; __GUICtrl_SOH_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
; ...
; EndFunc
;
; Related........:
; Link...........: http://www.autoitscript.com/forum/index.php?s=&showtopic=55120
; Example........: Yes.
; ===============================================================================================================
Func _GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func="", $sLeaveHover_Func=-1, $sPrimaryDownFunc=-1, $sPrimaryUpFunc=-1, $iKeepCall_PrDn_Func=1, $iKeepCall_Hover_Func=0)
Local $hCtrlID = GUICtrlGetHandle($iCtrlID)
If Not $hCtrlID Then
Return SetError(1, 0, 0)
EndIf
If $p__GUICtrl_SOH_TimerProc = 0 Then
$p__GUICtrl_SOH_TimerProc = DllCallbackRegister("__GUICtrl_SOH_CALLBACK", "none", "hwnd;int;uint_ptr;dword")
$i__GUICtrl_SOH_TimerID = DllCall($s__GUICtrl_SOH_User32_Dll, "int", "SetTimer", _
"hwnd", 0, "uint_ptr", Round(TimerInit()), "uint", 30, "ptr", DllCallbackGetPtr($p__GUICtrl_SOH_TimerProc))
GUIRegisterMsg($n__GUICtrl_SOH_WM_COMMAND, "__GUICtrl_SOH_WM_COMMAND")
GUIRegisterMsg($n__GUICtrl_SOH_WM_LBUTTONDOWN, "__GUICtrl_SOH_WM_LBUTTONDOWN")
If IsArray($i__GUICtrl_SOH_TimerID) Then
$i__GUICtrl_SOH_TimerID = $i__GUICtrl_SOH_TimerID[0]
EndIf
EndIf
;UnSet Hovering for specified control (remove control id from hovering checking process)
If $sHover_Func = "" And @NumParams <= 2 Then
Local $a__GUICtrl_SOH_Ctrls_Tmp[1][1]
Local $a__GUICtrl_SOH_Ctrls_Swap = $a__GUICtrl_SOH_Ctrls ;This one prevents a bug with "dimension range exceeded"
For $i = 1 To $a__GUICtrl_SOH_Ctrls_Swap[0][0]
If $hCtrlID <> $a__GUICtrl_SOH_Ctrls_Swap[$i][0] Then
$a__GUICtrl_SOH_Ctrls_Tmp[0][0] += 1
ReDim $a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]+1][7]
$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][0] = $a__GUICtrl_SOH_Ctrls_Swap[$i][0]
$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][1] = $a__GUICtrl_SOH_Ctrls_Swap[$i][1]
$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][2] = $a__GUICtrl_SOH_Ctrls_Swap[$i][2]
$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][3] = $a__GUICtrl_SOH_Ctrls_Swap[$i][3]
$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][4] = $a__GUICtrl_SOH_Ctrls_Swap[$i][4]
$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][5] = $a__GUICtrl_SOH_Ctrls_Swap[$i][5]
$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][6] = $a__GUICtrl_SOH_Ctrls_Swap[$i][6]
EndIf
Next
If $a__GUICtrl_SOH_Ctrls_Tmp[0][0] < 1 Then
__GUICtrl_SOH_ReleaseResources() ;Release the callbacks
Else
$i__GUICtrl_SOH_CtrlsModified = 1
$a__GUICtrl_SOH_Ctrls = $a__GUICtrl_SOH_Ctrls_Tmp
EndIf
Return 1
EndIf
;Check if the hovering process already handle the passed CtrlID, if so, just assign new values (functions)
For $i = 1 To $a__GUICtrl_SOH_Ctrls[0][0]
If $hCtrlID = $a__GUICtrl_SOH_Ctrls[$i][0] Then
$a__GUICtrl_SOH_Ctrls[$i][0] = $hCtrlID
$a__GUICtrl_SOH_Ctrls[$i][1] = $sHover_Func
$a__GUICtrl_SOH_Ctrls[$i][2] = $sLeaveHover_Func
$a__GUICtrl_SOH_Ctrls[$i][3] = $sPrimaryDownFunc
$a__GUICtrl_SOH_Ctrls[$i][4] = $sPrimaryUpFunc
$a__GUICtrl_SOH_Ctrls[$i][5] = $iKeepCall_PrDn_Func
$a__GUICtrl_SOH_Ctrls[$i][6] = $iKeepCall_Hover_Func
Return 2
EndIf
Next
$a__GUICtrl_SOH_Ctrls[0][0] += 1
ReDim $a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]+1][7]
$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][0] = $hCtrlID
$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][1] = $sHover_Func
$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][2] = $sLeaveHover_Func
$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][3] = $sPrimaryDownFunc
$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][4] = $sPrimaryUpFunc
$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][5] = $iKeepCall_PrDn_Func
$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][6] = $iKeepCall_Hover_Func
Return 1
EndFunc
;Set the hovering mode:
; $iSetBackWin = 1 (default) hovering process will proceed even when GUI is not active (in background).
; $iSetBackWin <> 1 hovering process will NOT proceed when GUI is not active.
Func _GUICtrl_SetHoverOnBackWindow($iSetBackWin)
$i__GUICtrl_SOH_HoverOnBackWin = Number($iSetBackWin = 1)
EndFunc
#EndRegion Public Functions
#Region Backwards Compatibility Functions
;Backwards compatibility function #1
Func _GUICtrl_SetOnHover($iCtrlID, $sHover_Func="", $sLeaveHover_Func=-1, $sPrimaryDownFunc=-1, $sPrimaryUpFunc=-1, $iKeepCall_PrDn_Func=1, $iKeepCall_Hover_Func=0)
_GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
EndFunc
;Backwards compatibility function #2
Func GUICtrl_SetOnHover($iCtrlID, $sHover_Func="", $sLeaveHover_Func=-1, $sPrimaryDownFunc=-1, $sPrimaryUpFunc=-1, $iKeepCall_PrDn_Func=1, $iKeepCall_Hover_Func=0)
_GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
EndFunc
;Backwards compatibility function #3
Func GUICtrlSetOnHover($iCtrlID, $sHover_Func="", $sLeaveHover_Func=-1, $sPrimaryDownFunc=-1, $sPrimaryUpFunc=-1, $iKeepCall_PrDn_Func=1, $iKeepCall_Hover_Func=0)
_GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
EndFunc
;Backwards compatibility function #4
Func _GUICtrlSetOnHover($iCtrlID, $sHover_Func="", $sLeaveHover_Func=-1, $sPrimaryDownFunc=-1, $sPrimaryUpFunc=-1, $iKeepCall_PrDn_Func=1, $iKeepCall_Hover_Func=0)
_GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
EndFunc
#EndRegion Backwards Compatibility Functions
#Region Internal Functions
;CallBack function to handle the hovering process
Func __GUICtrl_SOH_CALLBACK($hWnd, $uiMsg, $idEvent, $dwTime)
$i__GUICtrl_SOH_CtrlsModified = 0
If $a__GUICtrl_SOH_Ctrls[0][0] < 1 Then
Return
EndIf
If $i__GUICtrl_SOH_HoverOnBackWin Then
Local $iControl_Hovered = __GUICtrl_SOH_ControlGetHovered()
Else
Local $iControl_Hovered = GUIGetCursorInfo()
If Not IsArray($iControl_Hovered) Then
Return
EndIf
$iControl_Hovered = GUICtrlGetHandle($iControl_Hovered[4])
EndIf
Local $sCheck_LHE = $a__GUICtrl_SOH_LastHoveredElements[1]
Local $iCheck_LCEM = $h__GUICtrl_SOH_LastClickedElementMark
Local $iCtrlID
;Leave Hovering Process and reset variables
If Not $iControl_Hovered Or ($sCheck_LHE <> -1 And $iControl_Hovered <> $sCheck_LHE) Then
If $a__GUICtrl_SOH_LastHoveredElementsMark = -1 Then
Return
EndIf
Local $a__Tmp_GUICtrl_SOH_LastHoveredElements[2] = [$a__GUICtrl_SOH_LastHoveredElements[0], $a__GUICtrl_SOH_LastHoveredElements[1]]
$a__GUICtrl_SOH_LastHoveredElements[0] = -1
$a__GUICtrl_SOH_LastHoveredElements[1] = -1
$a__GUICtrl_SOH_LastHoveredElementsMark = -1
$h__GUICtrl_SOH_LastClickedElementMark = -1
If $a__Tmp_GUICtrl_SOH_LastHoveredElements[0] <> -1 Then
$iCtrlID = DllCall($s__GUICtrl_SOH_User32_Dll, "int", "GetDlgCtrlID", "hwnd", $a__Tmp_GUICtrl_SOH_LastHoveredElements[1])
If IsArray($iCtrlID) Then
$iCtrlID = $iCtrlID[0]
EndIf
;2 is the indicator of OnLeavHover process
__GUICtrl_SOH_Call($a__Tmp_GUICtrl_SOH_LastHoveredElements[0], $iCtrlID, 2, $iControl_Hovered)
EndIf
Else ;Hovering Process, Primary Down/Up handler, and set $a__GUICtrl_SOH_LastHoveredElements
If $i__GUICtrl_SOH_CtrlsModified = 1 Then
$i__GUICtrl_SOH_CtrlsModified = 0
Return
EndIf
Local $iUbound = UBound($a__GUICtrl_SOH_Ctrls)-1
For $i = 1 To $a__GUICtrl_SOH_Ctrls[0][0]
If $i > $iUbound Then
ExitLoop
EndIf
If $a__GUICtrl_SOH_Ctrls[$i][0] = $iControl_Hovered Then
$iCtrlID = DllCall($s__GUICtrl_SOH_User32_Dll, "int", "GetDlgCtrlID", "hwnd", $iControl_Hovered)
If IsArray($iCtrlID) Then
$iCtrlID = $iCtrlID[0]
EndIf
;Primary Down/Up handler
If ($a__GUICtrl_SOH_Ctrls[$i][3] <> "" Or $a__GUICtrl_SOH_Ctrls[$i][4] <> "") And ($iCheck_LCEM = -1 Or $iCheck_LCEM = $iControl_Hovered) Then
Local $aCursorInfo = 0
Local $hParent_Wnd = DllCall($s__GUICtrl_SOH_User32_Dll, "hwnd", "GetParent", "hwnd", $iControl_Hovered)
If Not @error And IsArray($hParent_Wnd) Then
$hParent_Wnd = $hParent_Wnd[0]
$aCursorInfo = GUIGetCursorInfo($hParent_Wnd)
Else
$aCursorInfo = GUIGetCursorInfo()
EndIf
If IsArray($aCursorInfo) Then
;Primary Down...
;* First condition is to prevent function call when holding down m.button from other control
;* Last condition is to Prevent/Allow multiple function call
;(depending on $iKeepCall_PrDn_Func param).
If ($i__GUICtrl_SOH_LastPrimaryDownCtrlID = $iControl_Hovered Or $i__GUICtrl_SOH_LastPrimaryDownCtrlID = 0) And WinActive($hParent_Wnd) And _
$aCursorInfo[2] = 1 And $a__GUICtrl_SOH_Ctrls[$i][3] <> -1 And _
(($a__GUICtrl_SOH_Ctrls[$i][5] < 1 And $iCheck_LCEM <> $iControl_Hovered) Or $a__GUICtrl_SOH_Ctrls[$i][5] > 0) Then
;1 is the indicator of Primary*Down* event
__GUICtrl_SOH_Call($a__GUICtrl_SOH_Ctrls[$i][3], $iCtrlID, 1)
$h__GUICtrl_SOH_LastClickedElementMark = $iControl_Hovered
;Primary Up
ElseIf $aCursorInfo[2] = 0 And $a__GUICtrl_SOH_Ctrls[$i][4] <> -1 And $iCheck_LCEM = $iControl_Hovered Then
;2 is the indicator of Primary*Up* event
__GUICtrl_SOH_Call($a__GUICtrl_SOH_Ctrls[$i][4], $iCtrlID, 2)
$h__GUICtrl_SOH_LastClickedElementMark = -1
EndIf
EndIf
EndIf
If $i__GUICtrl_SOH_CtrlsModified = 1 Then
ExitLoop
EndIf
If $a__GUICtrl_SOH_Ctrls[$i][6] < 1 And $a__GUICtrl_SOH_LastHoveredElementsMark = $a__GUICtrl_SOH_Ctrls[$i][0] Then
ExitLoop
Else
$a__GUICtrl_SOH_LastHoveredElementsMark = $a__GUICtrl_SOH_Ctrls[$i][0]
EndIf
If $a__GUICtrl_SOH_Ctrls[$i][2] <> -1 Then
$a__GUICtrl_SOH_LastHoveredElements[0] = $a__GUICtrl_SOH_Ctrls[$i][2]
$a__GUICtrl_SOH_LastHoveredElements[1] = $iControl_Hovered
EndIf
__GUICtrl_SOH_Call($a__GUICtrl_SOH_Ctrls[$i][1], $iCtrlID, 1, 0) ;1 is the indicator of OnHover process
If $i__GUICtrl_SOH_CtrlsModified = 1 Then
ExitLoop
EndIf
ExitLoop
EndIf
Next
EndIf
$i__GUICtrl_SOH_CtrlsModified = 0
EndFunc
Func __GUICtrl_SOH_WM_COMMAND($hWndGUI, $MsgID, $WParam, $LParam)
$i__GUICtrl_SOH_LastPrimaryDownCtrlID = $LParam
EndFunc
Func __GUICtrl_SOH_WM_LBUTTONDOWN($hWndGUI, $MsgID, $WParam, $LParam)
$i__GUICtrl_SOH_LastPrimaryDownCtrlID = 0
EndFunc
;Thanks to amel27 for that one!!!
Func __GUICtrl_SOH_ControlGetHovered()
Local $iOld_Opt_MCM = Opt("MouseCoordMode", 1)
Local $tPoint = DllStructCreate("int X;int Y")
Local $aMPos = MouseGetPos()
DllStructSetData($tPoint, "x", $aMPos[0])
DllStructSetData($tPoint, "y", $aMPos[1])
Local $tPointCast = DllStructCreate("int64", DllStructGetPtr($tPoint))
Local $aRet = DllCall($s__GUICtrl_SOH_User32_Dll, "hwnd", "WindowFromPoint", "int64", DllStructGetData($tPointCast, 1))
Opt("MouseCoordMode", $iOld_Opt_MCM)
If @error Then
Return SetError(@error, @extended, 0)
EndIf
Return $aRet[0]
EndFunc
;Call() function wrapper
Func __GUICtrl_SOH_Call($sFunction, $sParam1="", $sParam2="", $sParam3="", $sParam4="", $sParam5="")
Local $iRet = Call($sFunction)
If @error <> 0xDEAD Then
Return $iRet
EndIf
$iRet = Call($sFunction, $sParam1)
If @error <> 0xDEAD Then
Return $iRet
EndIf
$iRet = Call($sFunction, $sParam1, $sParam2)
If @error <> 0xDEAD Then
Return $iRet
EndIf
$iRet = Call($sFunction, $sParam1, $sParam2, $sParam3)
If @error <> 0xDEAD Then
Return $iRet
EndIf
$iRet = Call($sFunction, $sParam1, $sParam2, $sParam3, $sParam4)
If @error <> 0xDEAD Then
Return $iRet
EndIf
$iRet = Call($sFunction, $sParam1, $sParam2, $sParam3, $sParam4, $sParam5)
If @error <> 0xDEAD Then
Return $iRet
EndIf
Return SetError(1, 0, 0)
EndFunc
;Release resources function
Func __GUICtrl_SOH_ReleaseResources()
If $p__GUICtrl_SOH_TimerProc > 0 Then
DllCallbackFree($p__GUICtrl_SOH_TimerProc)
EndIf
If $i__GUICtrl_SOH_TimerID > 0 Then
DllCall($s__GUICtrl_SOH_User32_Dll, "int", "KillTimer", "hwnd", 0, "uint_ptr", $i__GUICtrl_SOH_TimerID)
EndIf
GUIRegisterMsg($n__GUICtrl_SOH_WM_COMMAND, "")
GUIRegisterMsg($n__GUICtrl_SOH_WM_LBUTTONDOWN, "")
$p__GUICtrl_SOH_TimerProc = 0
$i__GUICtrl_SOH_TimerID = 0
EndFunc
;Release the CallBack resources when exit
Func __GUICtrl_SOH_Exit()
If $s__GUICtrl_SOH_OnExitFunc <> "" Then
Call($s__GUICtrl_SOH_OnExitFunc)
EndIf
__GUICtrl_SOH_ReleaseResources()
EndFunc
#EndRegion Internal Functions

BIN
sec.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Loading…
Cancel
Save