PDA

Показать полную графическую версию : [решено] Создание GUI с "красивым тулбраром " или графическими кнопками


replerk1334
08-08-2014, 14:24
Здравствуйте уважаемые профи Autoit !
Появилась идея создать окно с красивым тулбаром , но покуда не могу понять как это сделать , пробивал ставить иконки и присваивать им события как в обычной кнопки ,все работает но оформить как на изображении которое я приложил я не смог .Посмотрите изображение(тулбар о котором я говорил выделен красным цветом) и ответьте возможно ли создать такой тулбар ,если возможно то как ???
Заранее спасибо!

madmasles
08-08-2014, 14:46
replerk1334,
Смотрите в справке раздел GuiToolbar Management.

replerk1334
08-08-2014, 15:15
madmasles , Спасибо !!

replerk1334
08-08-2014, 18:52
а как заменить картинку на кнопке созданной через

_GUICtrlToolbar_AddButton

?

madmasles
08-08-2014, 18:56
replerk1334,
Смотрите пример к функции _GUICtrlToolbar_SetButtonBitMap().

replerk1334
08-08-2014, 19:05
madmasles, спасибо!

replerk1334
09-08-2014, 14:39
madmasles, я поискал и узнал много нового в справке , только как загрузить свою иконку , не ту что идет в стандартном системном bitmaps, а именно установить в тулбаре свою иконку к примеру mozilla , я пытался по разному сделать но в итоге либо отображалась системная стандартная иконка или вовсе было пустое место. Приведите пожалуйста пример в котором я наконец таки пойму как это сделать ?
Заранее спасибо .

madmasles
09-08-2014, 14:53
replerk1334,
Завтра или послезавтра сделаю пример, сейчас уезжаю.

madmasles
11-08-2014, 08:12
replerk1334,
Попробуйте с иконками сделать примерно так.#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <WinAPIEx.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <GuiToolbar.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <GUIConstantsEx.au3>

Opt (http://autoit-script.ru/autoit3_docs/functions/Opt.htm)('MustDeclareVars', 1)

_Main()

Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _Main()
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $hGUI, $hToolbar, $i_TB_Btn = 1000, $a_IcoString[4][3] = [[130, '&First'],[132, '&Second'],[134, '&Third'],[136, '&Fourth']], _
$ah_BitMap[4], $a_Info

$hGUI = GUICreate (http://autoit-script.ru/autoit3_docs/functions/GUICreate.htm)(StringTrimRight (http://autoit-script.ru/autoit3_docs/functions/StringTrimRight.htm)(@ScriptName (http://autoit-script.ru/autoit3_docs/macros.htm#@scriptname), 4), 400, 300)
$hToolbar = _GUICtrlToolbar_Create (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_create.htm)($hGUI)
For (http://www.autoitscript.com/autoit3/docs/keywords.htm#For) $i = 0 To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) 3
$a_IcoString[$i][0] = _WinAPI_ShellExtractIcon('shell32.dll', $a_IcoString[$i][0], 16, 16)
$a_Info = _WinAPI_GetIconInfo (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_geticoninfo.htm)($a_IcoString[$i][0])
$ah_BitMap[$i] = _WinAPI_CopyBitmap($a_Info[5])
$a_IcoString[$i][2] = _GUICtrlToolbar_AddBitmap (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_addbitmap.htm)($hToolbar, 1, 0, $ah_BitMap[$i])
$a_IcoString[$i][1] = _GUICtrlToolbar_AddString (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_addstring.htm)($hToolbar, $a_IcoString[$i][1])
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) $i = 3 Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) _GUICtrlToolbar_AddButtonSep (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_addbuttonsep.htm)($hToolbar)
_GUICtrlToolbar_AddButton (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_addbutton.htm)($hToolbar, $i_TB_Btn, $a_IcoString[$i][2], $a_IcoString[$i][1])
$i_TB_Btn += 1
_WinAPI_DestroyIcon (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_destroyicon.htm)($a_IcoString[$i][0])
For (http://www.autoitscript.com/autoit3/docs/keywords.htm#For) $j = 4 To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) 5
_WinAPI_DeleteObject (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_deleteobject.htm)($a_Info[$j])
Next (http://www.autoitscript.com/autoit3/docs/keywords.htm#Next)
Next (http://www.autoitscript.com/autoit3/docs/keywords.htm#Next)
$a_IcoString = 0
$a_Info = 0
GUISetState (http://autoit-script.ru/autoit3_docs/functions/GUISetState.htm)()
Do (http://www.autoitscript.com/autoit3/docs/keywords.htm#Do)
Until (http://www.autoitscript.com/autoit3/docs/keywords.htm#Until) GUIGetMsg (http://autoit-script.ru/autoit3_docs/functions/GUIGetMsg.htm)() = $GUI_EVENT_CLOSE
For (http://www.autoitscript.com/autoit3/docs/keywords.htm#For) $i = 0 To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) 3
_WinAPI_DeleteObject (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_deleteobject.htm)($ah_BitMap[$i])
Next (http://www.autoitscript.com/autoit3/docs/keywords.htm#Next)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_Main

madmasles
11-08-2014, 08:59
replerk1334,
И еще один пример.#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <WinAPIEx.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <GuiToolbar.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <GUIConstantsEx.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <WindowsConstants.au3>

Opt (http://autoit-script.ru/autoit3_docs/functions/Opt.htm)('MustDeclareVars', 1)

Global (http://www.autoitscript.com/autoit3/docs/keywords.htm#Global) $hGUI, $iDummy, $iTB_BtnFirst = Random (http://autoit-script.ru/autoit3_docs/functions/Random.htm)(10000, 15000, 1)

_Main_1()
Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)

Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _Main_1()
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $hToolbar, $a_IcoString[4][3] = [[130, '&First'],[132, '&Second'],[134, '&Third'],[136, '&Fourth']], _
$ah_BitMap[4], $i_ID_TB_Btn, $a_Info, $i_W = 32, $i_H = 32;если 16х16, то не нужна функция _GUICtrlToolbar_SetBitmapSize

$hGUI = GUICreate (http://autoit-script.ru/autoit3_docs/functions/GUICreate.htm)(StringTrimRight (http://autoit-script.ru/autoit3_docs/functions/StringTrimRight.htm)(@ScriptName (http://autoit-script.ru/autoit3_docs/macros.htm#@scriptname), 4), 400, 300)
$iDummy = GUICtrlCreateDummy (http://autoit-script.ru/autoit3_docs/functions/GUICtrlCreateDummy.htm)()
$hToolbar = _GUICtrlToolbar_Create (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_create.htm)($hGUI)
_GUICtrlToolbar_SetBitmapSize (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_setbitmapsize.htm)($hToolbar, $i_W, $i_H)
For (http://www.autoitscript.com/autoit3/docs/keywords.htm#For) $i = 0 To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) 3
$a_IcoString[$i][0] = _WinAPI_ShellExtractIcon('shell32.dll', $a_IcoString[$i][0], $i_W, $i_H)
$a_Info = _WinAPI_GetIconInfo (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_geticoninfo.htm)($a_IcoString[$i][0])
$ah_BitMap[$i] = _WinAPI_CopyBitmap($a_Info[5])
$a_IcoString[$i][2] = _GUICtrlToolbar_AddBitmap (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_addbitmap.htm)($hToolbar, 1, 0, $ah_BitMap[$i])
$a_IcoString[$i][1] = _GUICtrlToolbar_AddString (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_addstring.htm)($hToolbar, $a_IcoString[$i][1])
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) $i = 3 Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) _GUICtrlToolbar_AddButtonSep (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_addbuttonsep.htm)($hToolbar)
_GUICtrlToolbar_AddButton (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_addbutton.htm)($hToolbar, $iTB_BtnFirst + $i, $a_IcoString[$i][2], $a_IcoString[$i][1])
_WinAPI_DestroyIcon (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_destroyicon.htm)($a_IcoString[$i][0])
For (http://www.autoitscript.com/autoit3/docs/keywords.htm#For) $j = 4 To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) 5
_WinAPI_DeleteObject (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_deleteobject.htm)($a_Info[$j])
Next (http://www.autoitscript.com/autoit3/docs/keywords.htm#Next)
Next (http://www.autoitscript.com/autoit3/docs/keywords.htm#Next)
$a_IcoString = 0
$a_Info = 0
GUISetState (http://autoit-script.ru/autoit3_docs/functions/GUISetState.htm)()
GUIRegisterMsg (http://autoit-script.ru/autoit3_docs/functions/GUIRegisterMsg.htm)($WM_COMMAND, 'WM_COMMAND')
While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) GUIGetMsg (http://autoit-script.ru/autoit3_docs/functions/GUIGetMsg.htm)()
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $GUI_EVENT_CLOSE
For (http://www.autoitscript.com/autoit3/docs/keywords.htm#For) $i = 0 To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) 3
_WinAPI_DeleteObject (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_deleteobject.htm)($ah_BitMap[$i])
Next (http://www.autoitscript.com/autoit3/docs/keywords.htm#Next)
_GUICtrlToolbar_Destroy (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_destroy.htm)($hToolbar)
GUIDelete (http://autoit-script.ru/autoit3_docs/functions/GUIDelete.htm)($hGUI)
ExitLoop (http://www.autoitscript.com/autoit3/docs/keywords.htm#ExitLoop)
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $iDummy
$i_ID_TB_Btn = GUICtrlRead (http://autoit-script.ru/autoit3_docs/functions/GUICtrlRead.htm)($iDummy)
MsgBox (http://autoit-script.ru/autoit3_docs/functions/MsgBox.htm)(64, 'Toolbar', 'Button ID: ' & $i_ID_TB_Btn & @LF (http://autoit-script.ru/autoit3_docs/macros.htm#@lf) & 'Button Text: "' & _GUICtrlToolbar_GetButtonText (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_getbuttontext.htm)($hToolbar, $i_ID_TB_Btn) & _
'"' & @LF (http://autoit-script.ru/autoit3_docs/macros.htm#@lf) & ' has been pressed!', 0, $hGUI)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_Main_1

Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $i_ID

Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) $hWnd
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $hGUI
$i_ID = BitAND (http://autoit-script.ru/autoit3_docs/functions/BitAND.htm)($wParam, 0xFFFF)
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) $i_ID
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $iTB_BtnFirst To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) $iTB_BtnFirst + 3
GUICtrlSendToDummy (http://autoit-script.ru/autoit3_docs/functions/GUICtrlSendToDummy.htm)($iDummy, $i_ID)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) $GUI_RUNDEFMSG
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>WM_COMMAND

madmasles
11-08-2014, 09:38
replerk1334,
Или можно сделать все это проще. Смотрите пример к функции _GUICtrlToolbar_SetImageList(). (Почему я сам не посмотрел его, прежде чем писать примеры?) :)

replerk1334
11-08-2014, 10:33
madmasles, спасибо вам большое !!! теперь все понятно !!!!!)))

madmasles
13-08-2014, 08:45
replerk1334,
Так можно сделать с крупными иконками (прикрепленные иконки должны лежать в папке со скриптом).#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <WinAPIEx.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <GuiToolbar.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <GUIConstantsEx.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <WindowsConstants.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <StaticConstants.au3>
#include (http://autoit-script.ru/autoit3_docs/keywords.htm##include) <GuiImageList.au3>

Opt (http://autoit-script.ru/autoit3_docs/functions/Opt.htm)('MustDeclareVars', 1)

Global (http://www.autoitscript.com/autoit3/docs/keywords.htm#Global) $iDummy

_Main_2()
Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)

Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _Main_2()
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $hGUI, $hToolbar, $a_IcoString[4][3] = [['11.ico', '12.ico', '&First'],['21.ico', '22.ico', '&Second'],['31.ico', '32.ico', '&Third'], _
['41.ico', '42.ico', '&Fourth']], $i_ID_TB_Btn, $a_Info, $i_W = 48, $i_H = 48, $hIL_Normal, $hIL_Hot, $i_Btn, _
$iTB_BtnFirst = Random (http://autoit-script.ru/autoit3_docs/functions/Random.htm)(10000, 15000, 1)

$hIL_Normal = _GUIImageList_Create (http://autoit-script.ru/autoit3_docs/libfunctions/_guiimagelist_create.htm)($i_W, $i_H, 5)
$hIL_Hot = _GUIImageList_Create (http://autoit-script.ru/autoit3_docs/libfunctions/_guiimagelist_create.htm)($i_W, $i_H, 5)
$hGUI = GUICreate (http://autoit-script.ru/autoit3_docs/functions/GUICreate.htm)(StringTrimRight (http://autoit-script.ru/autoit3_docs/functions/StringTrimRight.htm)(@ScriptName (http://autoit-script.ru/autoit3_docs/macros.htm#@scriptname), 4), 400, 300)
$iDummy = GUICtrlCreateDummy (http://autoit-script.ru/autoit3_docs/functions/GUICtrlCreateDummy.htm)()
$hToolbar = _GUICtrlToolbar_Create (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_create.htm)($hGUI, 0x00000800, $TBSTYLE_EX_DOUBLEBUFFER)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) @WorkingDir (http://autoit-script.ru/autoit3_docs/macros.htm#@workingdir) <> @ScriptDir (http://autoit-script.ru/autoit3_docs/macros.htm#@scriptdir) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) FileChangeDir (http://autoit-script.ru/autoit3_docs/functions/FileChangeDir.htm)(@ScriptDir (http://autoit-script.ru/autoit3_docs/macros.htm#@scriptdir))
For (http://www.autoitscript.com/autoit3/docs/keywords.htm#For) $i = 0 To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) 3
$a_IcoString[$i][0] = _WinAPI_ShellExtractIcon($a_IcoString[$i][0], 0, $i_W, $i_H)
$a_Info = _WinAPI_GetIconInfo (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_geticoninfo.htm)($a_IcoString[$i][0])
_GUIImageList_Add (http://autoit-script.ru/autoit3_docs/libfunctions/_guiimagelist_add.htm)($hIL_Normal, $a_Info[5]);, $a_Info[4])
For (http://www.autoitscript.com/autoit3/docs/keywords.htm#For) $j = 4 To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) 5
_WinAPI_DeleteObject (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_deleteobject.htm)($a_Info[$j])
Next (http://www.autoitscript.com/autoit3/docs/keywords.htm#Next)
_WinAPI_DestroyIcon (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_destroyicon.htm)($a_IcoString[$i][0])
$a_IcoString[$i][1] = _WinAPI_ShellExtractIcon($a_IcoString[$i][1], 0, $i_W, $i_H)
$a_Info = _WinAPI_GetIconInfo (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_geticoninfo.htm)($a_IcoString[$i][1])
_GUIImageList_Add (http://autoit-script.ru/autoit3_docs/libfunctions/_guiimagelist_add.htm)($hIL_Hot, $a_Info[5]);, $a_Info[4])
For (http://www.autoitscript.com/autoit3/docs/keywords.htm#For) $j = 4 To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) 5
_WinAPI_DeleteObject (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_deleteobject.htm)($a_Info[$j])
Next (http://www.autoitscript.com/autoit3/docs/keywords.htm#Next)
_WinAPI_DestroyIcon (http://autoit-script.ru/autoit3_docs/libfunctions/_winapi_destroyicon.htm)($a_IcoString[$i][1])
_GUICtrlToolbar_AddString (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_addstring.htm)($hToolbar, $a_IcoString[$i][2])
Next (http://www.autoitscript.com/autoit3/docs/keywords.htm#Next)
_GUICtrlToolbar_SetImageList (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_setimagelist.htm)($hToolbar, $hIL_Normal)
_GUICtrlToolbar_SetHotImageList (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_sethotimagelist.htm)($hToolbar, $hIL_Hot)
For (http://www.autoitscript.com/autoit3/docs/keywords.htm#For) $i = 0 To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) 3
_GUICtrlToolbar_AddButton (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_addbutton.htm)($hToolbar, $iTB_BtnFirst + $i, $i, $i)
Next (http://www.autoitscript.com/autoit3/docs/keywords.htm#Next)
$a_Info = _GUICtrlToolbar_GetButtonSize (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_getbuttonsize.htm)($hToolbar)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) @error (http://autoit-script.ru/autoit3_docs/macros.htm#@error) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) _GUICtrlToolbar_SetIndent (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_setindent.htm)($hToolbar, (400 - $a_Info[1] * 4) / 2)
$a_IcoString = 0
$a_Info = ControlGetPos (http://autoit-script.ru/autoit3_docs/functions/ControlGetPos.htm)($hGUI, '', $hToolbar)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) @error (http://autoit-script.ru/autoit3_docs/macros.htm#@error) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) GUICtrlCreateLabel (http://autoit-script.ru/autoit3_docs/functions/GUICtrlCreateLabel.htm)('', 0, $a_Info[3], 405, 3, BitOR (http://autoit-script.ru/autoit3_docs/functions/BitOR.htm)($GUI_SS_DEFAULT_LABEL, $SS_ETCHEDHORZ))
$a_Info = 0
$i_Btn = GUICtrlCreateButton (http://autoit-script.ru/autoit3_docs/functions/GUICtrlCreateButton.htm)('Button', 150, 150, 100, 40)
GUISetState (http://autoit-script.ru/autoit3_docs/functions/GUISetState.htm)()
GUIRegisterMsg (http://autoit-script.ru/autoit3_docs/functions/GUIRegisterMsg.htm)($WM_COMMAND, '_WM_COMMAND_Main_2')
While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) GUIGetMsg (http://autoit-script.ru/autoit3_docs/functions/GUIGetMsg.htm)()
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $GUI_EVENT_CLOSE
ExitLoop (http://www.autoitscript.com/autoit3/docs/keywords.htm#ExitLoop)
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $i_Btn
MsgBox (http://autoit-script.ru/autoit3_docs/functions/MsgBox.htm)(64, 'Info', 'Button $i_Btn has been pressed!', 0, $hGUI)
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $iDummy
$i_ID_TB_Btn = GUICtrlRead (http://autoit-script.ru/autoit3_docs/functions/GUICtrlRead.htm)($iDummy)
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) $i_ID_TB_Btn
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $iTB_BtnFirst To (http://www.autoitscript.com/autoit3/docs/keywords.htm#To) $iTB_BtnFirst + 3
MsgBox (http://autoit-script.ru/autoit3_docs/functions/MsgBox.htm)(64, 'Toolbar', 'Button ID: ' & $i_ID_TB_Btn & @LF (http://autoit-script.ru/autoit3_docs/macros.htm#@lf) & 'Button Text: "' & _GUICtrlToolbar_GetButtonText (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_getbuttontext.htm)($hToolbar, $i_ID_TB_Btn) & _
'"' & @LF (http://autoit-script.ru/autoit3_docs/macros.htm#@lf) & 'has been pressed!', 0, $hGUI)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)
GUIRegisterMsg (http://autoit-script.ru/autoit3_docs/functions/GUIRegisterMsg.htm)($WM_COMMAND, '')
_GUIImageList_Destroy (http://autoit-script.ru/autoit3_docs/libfunctions/_guiimagelist_destroy.htm)($hIL_Normal)
_GUIImageList_Destroy (http://autoit-script.ru/autoit3_docs/libfunctions/_guiimagelist_destroy.htm)($hIL_Hot)
_GUICtrlToolbar_Destroy (http://autoit-script.ru/autoit3_docs/libfunctions/_guictrltoolbar_destroy.htm)($hToolbar)
GUIDelete (http://autoit-script.ru/autoit3_docs/functions/GUIDelete.htm)($hGUI)
$iDummy = 0
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_Main_2

Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _WM_COMMAND_Main_2($hWnd, $iMsg, $wParam, $lParam)
GUICtrlSendToDummy (http://autoit-script.ru/autoit3_docs/functions/GUICtrlSendToDummy.htm)($iDummy, BitAND (http://autoit-script.ru/autoit3_docs/functions/BitAND.htm)($wParam, 0xFFFF))
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) $GUI_RUNDEFMSG
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_WM_COMMAND_Main_2

replerk1334
13-08-2014, 15:14
madmasles, спасибо!!




© OSzone.net 2001-2012