Skip to content

Commit dfc6279

Browse files
committed
* **V7.7.6**
* Added start, stop, pause, resume and photo buttons to bot thumbnail preview window * Added Android adb.exe replace option under Bot/Android to solve adb.exe issues * Fixed forum authentication * Fixed queued troops (removed old and updated balloon and wall breaker) * Fixed stuck situation when android emulator was restarted on builder base * Fixed inconsistent adb state on error initializing adb connection * Fixed rare "error launching ADB shell for minitouch" when mouse device not correctly identified * Fixed pull/push of shared_prefs when bot profile name contains umlauts * Fixed Clash of Clans crash right after launching the game by clearing cache when shared_prefs are available * Fixed Unbreakable Mode not using standard CoC close function by @mitzu * Fixed bot not account switching when all barracks upgrading by @mika * Updated Persian lang file by @MohamamdKhan
1 parent 2b539e6 commit dfc6279

72 files changed

Lines changed: 1716 additions & 311 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
* **V7.7.5**
1+
* **V7.7.6**
2+
* Added start, stop, pause, resume and photo buttons to bot thumbnail preview window
3+
* Added Android adb.exe replace option under Bot/Android to solve adb.exe issues
4+
* Fixed forum authentication
5+
* Fixed queued troops (removed old and updated balloon and wall breaker)
6+
* Fixed stuck situation when android emulator was restarted on builder base
7+
* Fixed inconsistent adb state on error initializing adb connection
8+
* Fixed rare "error launching ADB shell for minitouch" when mouse device not correctly identified
9+
* Fixed pull/push of shared_prefs when bot profile name contains umlauts
10+
* Fixed Clash of Clans crash right after launching the game by clearing cache when shared_prefs are available
11+
* Fixed Unbreakable Mode not using standard CoC close function by @mitzu
12+
* Fixed bot not account switching when all barracks upgrading by @Mika
13+
* Updated Persian lang file by @MohamamdKhan
14+
15+
* **V7.7.5**
216
* April Update Fixed collect treasury
317
* April Update Fixed boost potion thx @mitzu
418
* Added new conditions "50%", "AQ", "BK", "GW" and "AQ+BK" to csv WAIT command

COCBot/GUI/MBR GUI Control Child Misc.au3

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,15 @@ Func ChkTreasuryCollect()
590590
EndIf
591591
EndFunc ;==>ChkTreasuryCollect
592592

593+
Func ChkFreeMagicItems()
594+
If $g_iTownHallLevel >= 8 Then ; Must be Th8 or more to use the Trader
595+
GUICtrlSetState($g_hChkFreeMagicItems, $GUI_ENABLE)
596+
Else
597+
GUICtrlSetState($g_hChkFreeMagicItems, $GUI_DISABLE)
598+
EndIf
599+
EndFunc ;==>ChkFreeMagicItems
600+
601+
593602
Func chkStartClockTowerBoost()
594603
If GUICtrlRead($g_hChkStartClockTowerBoost) = $GUI_CHECKED Then
595604
GUICtrlSetState($g_hChkCTBoostBlderBz, $GUI_ENABLE)

COCBot/GUI/MBR GUI Design Bottom.au3

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ Func CreateBottomPanel()
4343
GUICtrlCreateGroup("https://mybot.run " & GetTranslatedFileIni("MBR GUI Design Bottom", "Group_01", "- freeware bot -"), $x - 5, $y - 10, 190, 108)
4444
$g_hBtnStart = GUICtrlCreateButton(GetTranslatedFileIni("MBR GUI Design Bottom", "BtnStart", "Start Bot"), $x, $y + 2 +5, 90, 40-5)
4545
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Bottom", "BtnStart_Info_01", "Use this to START the bot."))
46-
GUICtrlSetOnEvent(-1, "btnStart")
4746
If $g_bBtnColor then GUICtrlSetBkColor(-1, 0x5CAD85)
4847
GUICtrlSetState(-1, $GUI_DISABLE)
4948
$g_hBtnStop = GUICtrlCreateButton(GetTranslatedFileIni("MBR GUI Design Bottom", "BtnStop", "Stop Bot"), -1, -1, 90, 40-5)

COCBot/GUI/MBR GUI Design Child Attack - Troops.au3

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,9 +823,8 @@ Func CreateBoostSubTab()
823823
_GUICtrlSetTip(-1, $sTxtTip)
824824

825825
$y += 25
826-
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnWallW, $x - 10, $y - 2, 24, 24)
827-
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnBattleB, $x + 19, $y - 2, 24, 24)
828-
GUICtrlCreateLabel(GetTranslatedFileIni("MBR GUI Design Child Attack - Troops_Boost", "LblWorkshopBoost", "Workshop") & " " & $sTextBoostLeft, $x + 20 + 29, $y + 4, -1, -1)
826+
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnWorkshopBoost, $x + 5, $y - 2, 24, 24)
827+
GUICtrlCreateLabel(GetTranslatedFileIni("MBR GUI Design Child Attack - Troops_Boost", "LblWorkshopBoost", "Workshop") & " " & $sTextBoostLeft, $x + 20 +29, $y + 4, -1, -1)
829828
$sTxtTip = GetTranslatedFileIni("MBR GUI Design Child Attack - Troops_Boost", "LblWorkshopBoost_Info_01", "Use this to boost your Workshop with GEMS! Use with caution!")
830829
_GUICtrlSetTip(-1, $sTxtTip)
831830
$g_hCmbBoostWorkshop = GUICtrlCreateCombo("", $x + 185, $y, 60, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))

COCBot/GUI/MBR GUI Design Child Bot - Android.au3

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Global $g_hCmbCOCDistributors = 0, $g_hCmbAndroidBackgroundMode = 0, $g_hCmbAndroidZoomoutMode = 0, $g_hCmbSuspendAndroid = 0, $g_hChkAndroidAdbClick = 0, _
1818
$g_hChkAndroidAdbClickDragScript = 0, $g_hBtnAndroidAdbShell = 0, $g_hBtnAndroidHome = 0, $g_hBtnAndroidBack = 0, $g_hTxtAndroidRebootHours = 0, _
1919
$g_hChkAndroidCloseWithBot = 0, $g_hChkUpdateSharedPrefs = 0, $g_hBtnAndroidEnableTouch = 0, $g_hBtnAndroidDisableTouch = 0, $g_lblHelpBot = 0, _
20-
$g_hLblAdditionalClickDelay = 0, $g_hSldAdditionalClickDelay = 0, $g_hChkUseDedicatedAdbPort = 0
20+
$g_hLblAdditionalClickDelay = 0, $g_hSldAdditionalClickDelay = 0, $g_hChkUseDedicatedAdbPort = 0, $g_hCmbAndroidReplaceAdb = 0
2121

2222
Func CreateBotAndroid()
2323

@@ -49,7 +49,7 @@ Func CreateBotAndroid()
4949
$y += $h + 5
5050
$y2 = $y
5151
$w = $g_iSizeWGrpTab2 - 2
52-
$h = 21 + 6 * 25
52+
$h = 9 * 25
5353
GUICtrlCreateGroup(GetTranslatedFileIni("Android", "Android_Options", "Android Options"), $x - 20, $y - 20, $w, $h)
5454
GUICtrlCreateLabel(GetTranslatedFileIni("Android", "LblBackgroundMode", "Screencapture Background Mode"), $x - 8, $y + 5, 180, 22, $SS_RIGHT)
5555
$g_hCmbAndroidBackgroundMode = GUICtrlCreateCombo("", $x - 8 + 180 + 5, $y, 200, -1, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
@@ -63,6 +63,19 @@ Func CreateBotAndroid()
6363
GUICtrlSetData(-1, GetTranslatedFileIni("Android", "CmbZoomoutMode", "Default|Use Minitouch script|Use dd script|WinAPI|Update shared_prefs"))
6464
_GUICtrlSetTip(-1, GetTranslatedFileIni("Android", "CmbZoomoutMode_Info", 'Control how the zoomout is done. Default chooses usually Minitouch script, which is most stable.'))
6565
_GUICtrlComboBox_SetCurSel(-1, $g_iAndroidZoomoutMode)
66+
$y += 25
67+
GUICtrlCreateLabel(GetTranslatedFileIni("MBR Distributors", "LblAdvanced_Android_Options", "Suspend/Resume Android"), $x - 8, $y + 5, 180, 22, $SS_RIGHT)
68+
$g_hCmbSuspendAndroid = GUICtrlCreateCombo("", $x - 8 + 180 + 5, $y, 200, -1, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
69+
GUICtrlSetData(-1, GetTranslatedFileIni("MBR Distributors", "CmbSuspendAndroid_Item_01", "Disabled|Only during Search/Attack|For every Image processing call"))
70+
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR Distributors", "CmbSuspendAndroid_Info_01", 'Specify if Android will be suspended for brief time only during search and attack or\r\nfor every ImgLoc/Image processing call. If you experience more frequent network issues\r\ntry to use "Only during Search/Attack" option or disable this feature.'))
71+
_GUICtrlComboBox_SetCurSel(-1, AndroidSuspendFlagsToIndex($g_iAndroidSuspendModeFlags))
72+
GUICtrlSetOnEvent(-1, "cmbSuspendAndroid")
73+
$y += 25
74+
GUICtrlCreateLabel(GetTranslatedFileIni("Android", "LblReplaceAdb", "Replace ADB"), $x - 8, $y + 5, 180, 22, $SS_RIGHT)
75+
$g_hCmbAndroidReplaceAdb = GUICtrlCreateCombo("", $x - 8 + 180 + 5, $y, 200, -1, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
76+
GUICtrlSetData(-1, GetTranslatedFileIni("Android", "CmbReplaceAdb", "Don't replace adb.exe|With My Bot adb.exe|With dummy exe"))
77+
_GUICtrlSetTip(-1, GetTranslatedFileIni("Android", "CmbReplaceAdb_Info", 'Configure if Android Emulator adb.exe should be replaced with My Bot adb.exe or a dummy.exe to solve adb issues.'))
78+
_GUICtrlComboBox_SetCurSel(-1, $g_iAndroidAdbReplace)
6679
$y += 25
6780
$g_hChkAndroidAdbClick = GUICtrlCreateCheckbox(GetTranslatedFileIni("Android", "ChkAdbClick", "Use minitouch for Click"), $x, $y, -1, -1)
6881
_GUICtrlSetTip(-1, GetTranslatedFileIni("Android", "ChkAdbClick_Info", "Use minitouch for Android clicks.\r\nIf unchecked use WinAPI control messages."))
@@ -77,7 +90,7 @@ Func CreateBotAndroid()
7790
_GUICtrlSetTip(-1, GetTranslatedFileIni("Android", "ChkAndroidCloseWithBot_Info", "Close also Android Emulator when bot exists."))
7891
GUICtrlSetState(-1, (($g_bAndroidCloseWithBot) ? ($GUI_CHECKED) : ($GUI_UNCHECKED)))
7992

80-
$g_hChkUseDedicatedAdbPort = GUICtrlCreateCheckbox(GetTranslatedFileIni("Android", "ChkUseDedicatedAdbPort", "Use dedicated ADB port"), $x + 217, $y, -1, -1)
93+
$g_hChkUseDedicatedAdbPort = GUICtrlCreateCheckbox(GetTranslatedFileIni("Android", "ChkUseDedicatedAdbPort", "Use dedicated ADB port"), $x + 227, $y, -1, -1)
8194
_GUICtrlSetTip(-1, GetTranslatedFileIni("Android", "ChkUseDedicatedAdbPort_Info", "Use dedicated ADB instance on unique port. Disable can fix ""device offline"" issues."))
8295
GUICtrlSetState(-1, (($g_bAndroidAdbPortPerInstance) ? ($GUI_CHECKED) : ($GUI_UNCHECKED)))
8396

@@ -86,7 +99,7 @@ Func CreateBotAndroid()
8699
_GUICtrlSetTip(-1, GetTranslatedFileIni("Android", "ChkUpdateSharedPrefs_Info", "Pull and push shared_prefs to reset zoom,\nset language to English, disable snow and rate popup."))
87100
GUICtrlSetState(-1, (($g_bUpdateSharedPrefs) ? ($GUI_CHECKED) : ($GUI_UNCHECKED)))
88101

89-
GUICtrlCreateLabel(GetTranslatedFileIni("Android", "LblAndroidRebootHours", "Reboot Android in") & ":", $x + 217, $y + 2, -1, -1)
102+
GUICtrlCreateLabel(GetTranslatedFileIni("Android", "LblAndroidRebootHours", "Reboot Android in") & ":", $x + 227, $y + 2, -1, -1)
90103
$sTxtTip = GetTranslatedFileIni("Android", "LblAndroidRebootHours_Info", "Enter hours when Android will be automatically rebooted after specified run-time.")
91104
_GUICtrlSetTip(-1, $sTxtTip)
92105
$g_hTxtAndroidRebootHours = GUICtrlCreateInput($g_iAndroidRebootHours, $x + 327, $y + 1, 30, 16, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER))
@@ -96,19 +109,6 @@ Func CreateBotAndroid()
96109
GUICtrlCreateGroup("", -99, -99, 1, 1)
97110

98111
$y = $y2 + $h + 5
99-
$w = $g_iSizeWGrpTab2 - 2
100-
$h = 50
101-
GUICtrlCreateGroup(GetTranslatedFileIni("MBR Distributors", "Group_02", "Advanced Android Options"), $x - 20, $y - 20, $w, $h)
102-
$y -= 2
103-
GUICtrlCreateLabel(GetTranslatedFileIni("MBR Distributors", "LblAdvanced_Android_Options", "Suspend/Resume Android"), $x - 8, $y + 5, 180, 22, $SS_RIGHT)
104-
$g_hCmbSuspendAndroid = GUICtrlCreateCombo("", $x - 8 + 180 + 5, $y, 200, -1, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
105-
GUICtrlSetData(-1, GetTranslatedFileIni("MBR Distributors", "CmbSuspendAndroid_Item_01", "Disabled|Only during Search/Attack|For every Image processing call"))
106-
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR Distributors", "CmbSuspendAndroid_Info_01", 'Specify if Android will be suspended for brief time only during search and attack or\r\nfor every ImgLoc/Image processing call. If you experience more frequent network issues\r\ntry to use "Only during Search/Attack" option or disable this feature.'))
107-
_GUICtrlComboBox_SetCurSel(-1, AndroidSuspendFlagsToIndex($g_iAndroidSuspendModeFlags))
108-
GUICtrlSetOnEvent(-1, "cmbSuspendAndroid")
109-
GUICtrlCreateGroup("", -99, -99, 1, 1)
110-
111-
$y += $h + 5
112112
$y2 = $y
113113
$w = 240
114114
$h = 120
@@ -145,7 +145,7 @@ Func CreateBotAndroid()
145145
GUICtrlSetOnEvent(-1, "OpenPlayStoreNovaLauncher")
146146
GUICtrlCreateGroup("", -99, -99, 1, 1)
147147

148-
$y += 105
148+
$y += $h
149149
$x -= 60
150150
$g_lblHelpBot = GUICtrlCreateLabel("Command line Help ?", $x - 20, $y - 20, 220, 24, $SS_RIGHT)
151151
GUICtrlSetOnEvent($g_lblHelpBot, "ShowControlHelp")

COCBot/GUI/MBR GUI Design Child Village - Misc.au3

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,11 @@ Func CreateMiscNormalVillageSubTab()
252252
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Village - Misc", "ChkGemsBox_Info_01", "Check this to automatically clear GemBox."))
253253
GUICtrlSetState(-1, $GUI_UNCHECKED)
254254

255-
$g_hChkFreeMagicItems = GUICtrlCreateCheckbox(GetTranslatedFileIni("MBR GUI Design Child Village - Misc", "ChkFreeMagicItems", "Collect Free Magic Items"), $x + 250, $y + 4, -1, -1)
256-
$y -= 64
257-
Local const $icon = @ScriptDir & "\images\Potion.bmp"
258-
GUICtrlCreatePic($icon, $x + 300, $y + 20, 36, 47, $SS_BITMAP)
255+
_GUICtrlCreateIcon($g_sLibIconPath, $eIcnPowerPotion, $x + 230, $y + 1 , 24, 24)
256+
$g_hChkFreeMagicItems = GUICtrlCreateCheckbox(GetTranslatedFileIni("MBR GUI Design Child Village - Misc", "ChkFreeMagicItems", "Collect Free Magic Items"), $x + 270, $y + 4, -1, -1)
257+
_GUICtrlSetTip(-1, GetTranslatedFileIni("MBR GUI Design Child Village - Misc", "ChkFreeMagicItems_Info", "Check this to automatically collect free magic items.\r\nMust be at least Th8."))
258+
GUICtrlSetOnEvent(-1, "ChkFreeMagicItems")
259+
GUICtrlSetColor ( -1, $COLOR_ERROR )
259260

260261
GUICtrlCreateGroup("", -99, -99, 1, 1)
261262

COCBot/MBR GUI Action.au3

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Func BotStart($bAutostartDelay = 0)
3737
$g_bIsClientSyncError = False
3838
$g_bZoomoutFailureNotRestartingAnything = False
3939
$g_bRestart = False
40+
$g_bStayOnBuilderBase = False
4041

4142
EnableControls($g_hFrmBotBottom, False, $g_aFrmBotBottomCtrlState)
4243
;$g_iFirstAttack = 0
@@ -69,6 +70,12 @@ Func BotStart($bAutostartDelay = 0)
6970
GUICtrlSetState($g_hBtnSearchMode, $GUI_HIDE)
7071
GUICtrlSetState($g_hChkBackgroundMode, $GUI_DISABLE)
7172

73+
; update task bar buttons
74+
_ITaskBar_UpdateTBButton($g_hTblStop, $THBF_ENABLED)
75+
_ITaskBar_UpdateTBButton($g_hTblStart, $THBF_DISABLED)
76+
_ITaskBar_UpdateTBButton($g_hTblPause, $THBF_ENABLED)
77+
_ITaskBar_UpdateTBButton($g_hTblResume, $THBF_DISABLED)
78+
7279
; update try items
7380
TrayItemSetText($g_hTiStartStop, GetTranslatedFileIni("MBR GUI Design - Loading", "StatusBar_Item_Stop", "Stop bot"))
7481
TrayItemSetState($g_hTiPause, $TRAY_ENABLE)
@@ -178,6 +185,12 @@ Func BotStop()
178185
GUICtrlSetState($g_hBtnSearchMode, $GUI_SHOW)
179186
;GUICtrlSetState($g_hBtnMakeScreenshot, $GUI_ENABLE)
180187

188+
; update task bar buttons
189+
_ITaskBar_UpdateTBButton($g_hTblStart, $THBF_ENABLED)
190+
_ITaskBar_UpdateTBButton($g_hTblStop, $THBF_DISABLED)
191+
_ITaskBar_UpdateTBButton($g_hTblPause, $THBF_DISABLED)
192+
_ITaskBar_UpdateTBButton($g_hTblResume, $THBF_DISABLED)
193+
181194
; hide attack buttons if show
182195
GUICtrlSetState($g_hBtnAttackNowDB, $GUI_HIDE)
183196
GUICtrlSetState($g_hBtnAttackNowLB, $GUI_HIDE)

COCBot/MBR GUI Control.au3

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,11 +502,13 @@ Func GUIControl_WM_COMMAND($hWind, $iMsg, $wParam, $lParam)
502502
Case $g_hLblDonate
503503
; Donate URL is not in text nor tooltip
504504
ShellExecute("https://mybot.run/forums/index.php?/donate/make-donation/")
505-
Case $g_hBtnStop
505+
Case $g_hBtnStart, $g_hTblStart
506+
btnStart()
507+
Case $g_hBtnStop, $g_hTblStop
506508
btnStop()
507-
Case $g_hBtnPause
509+
Case $g_hBtnPause, $g_hTblPause
508510
btnPause()
509-
Case $g_hBtnResume
511+
Case $g_hBtnResume, $g_hTblResume
510512
btnResume()
511513
Case $g_hBtnHide
512514
btnHide()
@@ -520,7 +522,7 @@ Func GUIControl_WM_COMMAND($hWind, $iMsg, $wParam, $lParam)
520522
btnAttackNowTS()
521523
;Case $idMENU_DONATE_SUPPORT
522524
; ShellExecute("https://mybot.run/forums/index.php?/donate/make-donation/")
523-
Case $g_hBtnMakeScreenshot
525+
Case $g_hBtnMakeScreenshot, $g_hTblMakeScreenshot
524526
If $g_bRunState Then
525527
; call with flag when bot is running to execute on _sleep() idle
526528
btnMakeScreenshot()
@@ -2059,7 +2061,7 @@ Func Bind_ImageList($nCtrl, ByRef $hImageList)
20592061
Local $aIconIndex = [$eIcnTrain, $eIcnGem, $eIcnReOrder, $eIcnOptions]
20602062

20612063
Case $g_hGUI_MISC_TAB
2062-
Local $aIconIndex = [$eIcnTH1, $eIcnBuilderHall]
2064+
Local $aIconIndex = [$eIcnTH1, $eIcnBuilderHall, $eIcnStrongMan]
20632065

20642066
Case $g_hGUI_DONATE_TAB
20652067
; the icons for donate tab
@@ -2283,4 +2285,4 @@ Func ConsoleWindow($bShow = Default)
22832285
_WinAPI_FreeConsole()
22842286
$bConsoleAllocated = False
22852287
EndIf
2286-
EndFunc
2288+
EndFunc

COCBot/MBR GUI Design Mini.au3

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ MBR GUI Design.au3; CreateMainGUI()
7171
#include-once
7272

7373
#include "Functions\Other\AppUserModelId.au3"
74+
#include "Functions\Other\ITaskBarList.au3"
7475
#include "Functions\GUI\_GUICtrlSetTip.au3"
7576
#include "functions\GUI\_GUICtrlCreatePic.au3"
7677
#include "functions\GUI\GUI_State.au3"
@@ -111,6 +112,7 @@ Global $g_aFrmBotPosInit[8] = [0, 0, 0, 0, 0, 0, 0, 0]
111112
Global $g_hFirstControlToHide = 0, $g_hLastControlToHide = 0, $g_aiControlPrevState[1]
112113
Global $g_bFrmBotMinimized = False ; prevents bot flickering
113114
Global $g_lblHepNotify = 0, $g_lblHelpBot = 0
115+
Global $g_hTblStart = 0, $g_hTblStop = 0, $g_hTblPause = 0, $g_hTblResume = 0, $g_hTblMakeScreenshot = 0 ; TaskBarList buttons
114116

115117
Global $g_oCtrlIconData = ObjCreate("Scripting.Dictionary")
116118

@@ -147,6 +149,10 @@ Func CreateMainGUI()
147149
$g_hFrmBot = GUICreate($g_sBotTitle, $_GUI_MAIN_WIDTH, $_GUI_MAIN_HEIGHT + $_GUI_MAIN_TOP, ($g_iFrmBotPosX = $g_WIN_POS_DEFAULT ? -1 : $g_iFrmBotPosX), ($g_iFrmBotPosY = $g_WIN_POS_DEFAULT ? -1 : $g_iFrmBotPosY), _
148150
BitOR($WS_MINIMIZEBOX, $WS_POPUP, $WS_SYSMENU, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $iStyle))
149151

152+
; see https://github.com/Microsoft/Windows-classic-samples/blob/master/Samples/Win7Samples/winui/shell/appshellintegration/TaskbarThumbnailToolbar/ThumbnailToolbar.cpp
153+
_WinAPI_ChangeWindowMessageFilterEx($g_hFrmBot, $g_WM_TaskbarButtonCreated, $MSGFLT_ALLOW)
154+
_WinAPI_ChangeWindowMessageFilterEx($g_hFrmBot, $WM_COMMAND, $MSGFLT_ALLOW)
155+
150156
; update $g_iFrmBotPosX and $g_iFrmBotPosY for default position
151157
If $g_iFrmBotPosX = $g_WIN_POS_DEFAULT Or $g_iFrmBotPosY = $g_WIN_POS_DEFAULT Then
152158
Local $a = WinGetPos($g_hFrmBot)
@@ -337,6 +343,24 @@ Func ShowMainGUI()
337343
;_WinAPI_SetWindowLong($g_hAndroidWindow, $GWL_EXSTYLE, $lCurExStyle)
338344
EndIf
339345

346+
; create task bar object
347+
If IsObj($g_ITBL_oTaskBar) = 0 Then
348+
_ITaskBar_CreateTaskBarObj(True, False)
349+
If @error Then
350+
SetLog("Cannot create Taskbar icons, error: " & @error, $COLOR_ERROR)
351+
EndIf
352+
EndIf
353+
354+
; add taskbar buttons
355+
If IsObj($g_ITBL_oTaskBar) And $g_hTblStart = 0 Then
356+
$g_hTblStart = _ITaskBar_CreateTBButton(GetTranslatedFileIni("MBR GUI Design Bottom", "BtnStart", "Start Bot"), @ScriptDir & '\images\Icons\TaskBar_start.ico')
357+
$g_hTblStop = _ITaskBar_CreateTBButton(GetTranslatedFileIni("MBR GUI Design Bottom", "BtnStop", "Stop Bot"), @ScriptDir & '\images\Icons\TaskBar_stop.ico', -1, -1, $THBF_DISABLED)
358+
$g_hTblPause = _ITaskBar_CreateTBButton(GetTranslatedFileIni("MBR GUI Design Bottom", "BtnPause", "Pause"), @ScriptDir & '\images\Icons\TaskBar_pause.ico', -1, -1, $THBF_DISABLED)
359+
$g_hTblResume = _ITaskBar_CreateTBButton(GetTranslatedFileIni("MBR GUI Design Bottom", "BtnResume", "Resume"), @ScriptDir & '\images\Icons\TaskBar_resume.ico', -1, -1, $THBF_DISABLED)
360+
$g_hTblMakeScreenshot = _ITaskBar_CreateTBButton(GetTranslatedFileIni("MBR GUI Design Bottom", "BtnMakeScreenshot", "Photo"), @ScriptDir & '\images\Icons\TaskBar_photo.ico')
361+
_ITaskBar_AddTBButtons($g_hFrmBot)
362+
EndIf
363+
340364
GUISetState(@SW_SHOWNOACTIVATE, $g_hFrmBotButtons)
341365
If $g_hFrmBotEx Then GUISetState(@SW_SHOWNOACTIVATE, $g_hFrmBotEx)
342366
GUISetState(@SW_SHOWNOACTIVATE, $g_hFrmBotBottom)

0 commit comments

Comments
 (0)