Jump to content

Search the Community

Showing results for tags 'icon'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum
  • AutoIt

Calendars

  • Community Calendar

Found 29 results

  1. Good evening everyone First, I want to apologize with you for the title not very clear, but I thought a little bit on which title to set at the thread, and this is the one that came in mind. Now, let me explain what I'm trying to understand. I am making an application ( with n clients ), with an SQLite Database, which has a Main form, and n sub-forms... Since these sub-forms are called several times, because they are used to add or update records to the Database, I put the code that generates the GUI of these sub-forms in Functions. There are two sub-forms which are "treated" as two main forms, since even them have n sub-forms, which perform various tasks. Where am I stucked? For the Main form I created a Status Bar, in order to display messages ( add/delete/update/search results ), and it works perfectly with all the forms which don't have other sub-forms. For the two forms, which indeed have n sub-forms, I created two separated Status Bars, which are (re)created everytime I call the function that then displays the form. Practically, I can't set icons to these two Status Bars, and I don't know why. I'm really sorry that I don't feel clear enough, so, here you are an example of what I am saying. I recreated exactly what my script does: #include <GuiButton.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $frmSubForm, _ $txtSubFormField, _ $sbSubFormStatusBar, _ $objSB_IconError = _WinAPI_LoadShell32Icon(109), _ $objSB_IconInformation = _WinAPI_LoadShell32Icon(277) #Region ### START Koda GUI section ### Form= $frmMainForm = GUICreate("Main Form", 300, 300, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitApplication") $sbMainStatusBar = _GUICtrlStatusBar_Create($frmMainForm) $btnCreateSubForm = GUICtrlCreateButton("Create Sub Form", 105, 110, 75, 41, BitOR($BS_CENTER,$BS_VCENTER,$BS_MULTILINE)) GUICtrlSetOnEvent(-1, "GenerateSubForm") GUICtrlSetFont(-1, 10, 400, 0, "Arial") _GUICtrlStatusBar_SetSimple($sbMainStatusBar) _GUICtrlStatusBar_SetText($sbMainStatusBar, "") GUISetState(@SW_SHOW, $frmMainForm) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func ExitApplication() Exit EndFunc Func GenerateSubForm() #Region ### START Koda GUI section ### Form= $frmSubForm = GUICreate("Sub-Form", 300, 300, -1, -1, -1, -1, $frmMainForm) GUISetOnEvent($GUI_EVENT_CLOSE, "DeleteSubForm") $txtSubFormField = GUICtrlCreateInput("", 0, 0, 100, 20) $btnCheckSubFormField = GUICtrlCreateButton("Check Field", 105, 110, 75, 41, BitOR($BS_CENTER,$BS_VCENTER,$BS_MULTILINE)) GUICtrlSetOnEvent(-1, "CheckSubFormField") GUICtrlSetFont(-1, 10, 400, 0, "Arial") $sbSubFormStatusBar = _GUICtrlStatusBar_Create($frmSubForm) _GUICtrlStatusBar_SetSimple($sbSubFormStatusBar) _GUICtrlStatusBar_SetText($sbSubFormStatusBar, "") GUISetState(@SW_SHOW, $frmSubForm) GUISetState(@SW_DISABLE, $frmMainForm) #EndRegion ### END Koda GUI section ### EndFunc Func DeleteSubForm() ; Declared Globally => $frmSubForm GUIDelete($frmSubForm) GUISetState(@SW_ENABLE, $frmMainForm) EndFunc Func WriteToStatusBar($sbStatusBar, $objSB_Icon, $strText) _GUICtrlStatusBar_SetIcon($sbStatusBar, 0, $objSB_Icon) _GUICtrlStatusBar_SetText($sbStatusBar, $strText) ConsoleWrite("Icon Handle: " & $objSB_Icon & @CRLF) EndFunc Func CheckSubFormField() ; Declared Globally => $txtSubFormField If GUICtrlRead($txtSubFormField) = "" Then ; Declared Globally => $sbStatusBar WriteToStatusBar($sbSubFormStatusBar, $objSB_IconError, "Field NOK.") Else WriteToStatusBar($sbSubFormStatusBar, $objSB_IconInformation, "Field OK.") EndIf EndFunc The text is set, but icon is not. Could someone please tell me why? Thanks everyone in advance Best Regards.
  2. Hi all, I'm trying to create a listview with subitem icons and I achieved this by simply rearranging the order of the columns, so that the first column is in the middle, thus appearing as a subitem with an icon - this method prevents the "icon clipping" that happens when using subitem icons in a listview. My issue is that when I select a row that does not have an icon, the space where the icon would be is white. Is there a way to make this transparent, so it looks like the entire row is selected? Here's an example - click the second listview item/row to see a blank space where the icon would be. #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <WindowsConstants.au3> _Main() Func _Main() Local $hGui, $listview, $hImage Local $iLV_EXStyle_NoChecks = BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES, $LVS_EX_DOUBLEBUFFER, $LVS_EX_HEADERDRAGDROP) $hGui = GUICreate("Listview Test With Icons", 400, 300) $listview = GUICtrlCreateListView("Col 1|Col 2|Col 3", 2, 2, 394, 268, BitOR($LVS_REPORT, $LVS_SHAREIMAGELISTS)) _GUICtrlListView_SetExtendedListViewStyle($listview, $iLV_EXStyle_NoChecks) GUISetState() ; Create the image list $hImage = _GUIImageList_Create(16, 16, 5, 3) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 165) _GUICtrlListView_SetImageList($listview, $hImage, 1) ; Set the order so the first column is moved to the middle, ; acting like a subitem with an icon _GUICtrlListView_SetColumnOrder($listview, "1|0|2") ; Add the items GUICtrlCreateListViewItem("Item1|Item2|Item3", $listview) GUICtrlCreateListViewItem("Item4|Item5|Item6", $listview) ; Set an icon for just the first item _GUICtrlListView_SetItemImage($listview, 0, 0) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main
  3. Hi, i searched some topics but cannot found a simple way to do that: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 192, 124) GUISetState(@SW_SHOW) ; I tried this but user reported that it work in 2006, not seems work actually $filemenu = GUICtrlCreateMenu ("&File") $fileitem = GUICtrlCreateMenuitem ("Open",$filemenu) GuiCtrlSetImage($fileitem, "shell32.dll", 4) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Also tried: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 192, 124) GUISetState(@SW_SHOW) $filemenu = TrayCreateMenu("&File") $fileitem = TrayCreateItem("Open",$filemenu) ;GuiCtrlSetImage($fileitem, "shell32.dll", 4) ;GuiCtrlSetImage(TrayItemGetHandle($fileitem), "shell32.dll", 4) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Well.. thanks in advance! Ok. I found this working example from Yashied. If i cannot find a simple then i will go with it #Include <GUIConstantsEx.au3> #Include <GUIMenu.au3> #Include <Constants.au3> #Include <WinAPI.au3> #Include <WindowsConstants.au3> Opt('MustDeclareVars', 1) Global $hMenu, $hForm, $hFile = 1000, $idNew, $idExit $hForm = GUICreate('Menu', 400, 300) $hFile = _GUICtrlMenu_CreateMenu() _GUICtrlMenu_InsertMenuItem ($hFile, 0, ' &Favorites', $idNew) _GUICtrlMenu_InsertMenuItem ($hFile, 1, '', 0) _GUICtrlMenu_InsertMenuItem($hFile, 2, ' E&xit', $idExit) $hMenu = _GUICtrlMenu_CreateMenu() _GUICtrlMenu_InsertMenuItem($hMenu, 0, '&File', 0, $hFile) _GUICtrlMenu_SetMenu($hForm, $hMenu) _GUICtrlMenu_SetItemBmp($hFile, 0, _CreateBitmapFromIcon(_WinAPI_GetSysColor($COLOR_MENU), @SystemDir & '\shell32.dll', 43, 16, 16)) _GUICtrlMenu_SetItemBmp($hFile, 2, _CreateBitmapFromIcon(_WinAPI_GetSysColor($COLOR_MENU), @SystemDir & '\shell32.dll', 27, 16, 16)) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _CreateBitmapFromIcon($iBackground, $sIcon, $iIndex, $iWidth, $iHeight) Local $hDC, $hBackDC, $hBackSv, $hIcon, $hBitmap $hDC = _WinAPI_GetDC(0) $hBackDC = _WinAPI_CreateCompatibleDC($hDC) $hBitmap = _WinAPI_CreateSolidBitmap(0, $iBackground, $iWidth, $iHeight) $hBackSv = _WinAPI_SelectObject($hBackDC, $hBitmap) $hIcon = _WinAPI_PrivateExtractIcon($sIcon, $iIndex, $iWidth, $iHeight) If Not @error Then _WinAPI_DrawIconEx($hBackDC, 0, 0, $hIcon, 0, 0, 0, 0, $DI_NORMAL) _WinAPI_DestroyIcon($hIcon) EndIf _WinAPI_SelectObject($hBackDC, $hBackSv) _WinAPI_ReleaseDC(0, $hDC) _WinAPI_DeleteDC($hBackDC) Return $hBitmap EndFunc ;==>_CreateBitmapFromIcon Func _WinAPI_PrivateExtractIcon($sIcon, $iIndex, $iWidth, $iHeight) Local $hIcon, $tIcon = DllStructCreate('hwnd'), $tID = DllStructCreate('hwnd') Local $Ret = DllCall('user32.dll', 'int', 'PrivateExtractIcons', 'str', $sIcon, 'int', $iIndex, 'int', $iWidth, 'int', $iHeight, 'ptr', DllStructGetPtr($tIcon), 'ptr', DllStructGetPtr($tID), 'int', 1, 'int', 0) If (@error) Or ($Ret[0] = 0) Then Return SetError(1, 0, 0) EndIf $hIcon = DllStructGetData($tIcon, 1) If ($hIcon = Ptr(0)) Or (Not IsPtr($hIcon)) Then Return SetError(1, 0, 0) EndIf Return $hIcon EndFunc ;==>_WinAPI_PrivateExtractIcon Ok, i noticed that is a pain create submenu with _GUICtrlMenu_CreatePopup to do like in Tray, and Tray better located, then i need images/icon with Tray functions, some workaround??
  4. Hi All, I'm using UseTraySetIcon("shell32.dll", xx) to set my tray icon to a specific icon while running, is there a way I can specify this icon when I compile my script into an exe so my exe icon is the same? Thanks!
  5. Hi guys I have an inquiry please I want an example of how to add an icon file to the compiled autoit file and how to use it in GUICtrlCreateIcon Preferably in a separate list within the resourceFor example myIcons I hope my request is clear and I hope you will help me solve this problem Because I found an example in the help files but I did not understand the method well
  6. I have a simple script that switches between IE and Chrome for the default browser, I even made a custom half chrome half ie icon for it. Question is, can I have the script toggle between two icons to signify the last browser it changed to? I would have the active browser's half of the icon in color, and inactive half grey scale. As a workaround, I put link next to it, and refresh the icon cache after it runs. #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\..\Icons\IE_Chrome.ico #AutoIt3Wrapper_Outfile=..\..\..\..\Users\dmking\Desktop\Browser Switcher.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** $sCurrentDefault = RegRead('HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice',"ProgId") if $sCurrentDefault = "IE.HTTP" Then     ChromeDefault() Else     IEDefault() EndIf ;~ Run("ie4uinit.exe -ClearIconCache") Run("C:\Windows\System32\ie4uinit.exe -ClearIconCache") Func IEDefault()     RegWrite("HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice","Progid","REG_SZ","IE.FTP")     RegWrite("HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice","Progid","REG_SZ","IE.HTTP")     RegWrite("HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice","Progid","REG_SZ","IE.HTTPS")     RegWrite("HKCU\Software\Clients\StartMenuInternet","","REG_SZ","IEXPLORE.EXE") EndFunc Func ChromeDefault()     RegWrite("HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice","Progid","REG_SZ","ChromeHTML")     RegWrite("HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice","Progid","REG_SZ","ChromeHTML")     RegWrite("HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice","Progid","REG_SZ","ChromeHTML")     RegWrite("HKCU\Software\Clients\StartMenuInternet","","REG_SZ","Google Chrome") EndFunc
  7. Hi all, Can the default Koda icon for forms be changed? If so, how? Thanks
  8. This is the info of the interface: Window Title: Password Safe Class: #32770 Control Class: ToolbarWindow32 Instance: 2 ClassnameNN: ToolbarWindow322 Name: Advanced (Class): [CLASS:ToolbarWindow32; INSTANCE:2] ToolsBar 1: 32003 Make New Database 2: 32002 Open Another Database 3: 32004 Close Database 4: 32005 Save Database 5: 0 6: 32066 Copy Password to Clipboard 7: 32068 Copy Username to Clipboard 8: 32069 Copy Notes to Clipboard 9: 32065 Clear the clipboard contents 10: 0 I wanted to click on 1: 32003 Make New Database. But unfortunately, I'm unable to click on that. Any help is much appreciated. Below are the code I tried: $Title = "Password Safe" $Class = "[CLASS:ToolbarWindow32; INSTANCE:2]" WinWaitActive($Title) Sleep(500) Dim $hWnd = WinGetHandle($Title,"") Dim $hToolBar = ControlGetHandle($hWnd, '', $Class) ConsoleWrite($hWnd & @TAB & $hToolBar & @LF) _GUICtrlToolbar_ClickIndex($hToolBar, 32003)
  9. Hi friends! I making a listview who displays files and i need set correct icon example: If computer have installed WinRAR zip files will have winrar icon, if have installed adobe reader pdf files have adobe reader icon. I trying to find a way to get icon associated with a extension on the computer, to after put in my listview. Thanks in advance.
  10. Hello, I need a basic script, but I dont know how to create it. Firstyl I upload a my vision create in Paint Ok let's explain. I need script who create a active button always on screen (on screen it's that red rectangle). If I open ex. Google Chrome, thats button shows on screen and If I click one of them, Autoit script type any words or buttons in active window (ex. Google Chrome). I think everybody's understand what I need. Sorry for english Who know how to make that script, or know where is done script ?. Thanks
  11. FavIcons Screensaver

    A little Screensaver based on FavIcons Like this screenshot Most websites use 16x16 Icons, so for a better display i used only those who have a 32x32 format. Thanks to : Ward for his BinaryCall UDF ( for call in memory lzma.dll and titchisid.dll ) and trancexx for his ResourcesViewerAndCompiler ( for create the huge icons resource dll ) If you have some time to loose, you can get files in the Download Section Edit 1 : Config is available via right click on compiled version. Edit 2 : Last version do not use lzma.dll and icons resource dll but an ImageList from a jpg for store the 730 "icons"
  12. FavIcons Screensaver

    Version 1.1.7

    186 downloads

    A little animated Screensaver based on FavIcons
  13. Hi All, I have a custom icon for the tray menu icon, which was working until I copied in the example code for a custom menu when clicking on the tray icon, now it just displays the default AutoIt tray icon. The menu works fine, but the tray icon initiates as the AutoIt default icon and the icon won't change on event. Can anyone advise what I need to do to use my custom icon while retaining the tray custom menu? Thanks! Also, the While 1 ... WEnd makes me nervous, how does this not lock up the system? If anyone would like to comment on that - thanks. Opt("TrayMenuMode", 3) #include <TrayConstants.au3> Local $idAbout = TrayCreateItem("About") Local $idExit = TrayCreateItem("Exit") TraySetState($TRAY_ICONSTATE_SHOW) While 1 Switch TrayGetMsg() Case $idAbout MsgBox(1,"test","test msg") Case $idExit Exit EndSwitch WEnd If Not FileExists (@TempDir & "\MyIcons") Then DirCreate(@TempDir & "\MyIcons") FileInstall(".\Grey-1.ico", @TempDir & "\MyIcons\Grey-1.ico", 1) FileInstall(".\Yellow-1.ico", @TempDir & "\MyIcons\Yellow-1.ico", 1) TraySetIcon(@TempDir & "\MyIcons\Grey-1.ico");Change icon to grey initially ; If X happens then change tray icon to yellow ; If Y happens then change tray icon to grey
  14. Hi all, Where i can get the SciTE4 AutoIt3 's icon ?
  15. I tried to come up with a simple toolbar which displays the plain icons (without a button frame) but also shows a button effect when hovered or clicked on. My approach was to create a button, add an icon and hide the icon button again. Then place the icon without the button on top of it. When the mouse is moved over the icon I hide the icon (which leaves button displayed) giving me the hover effect for hover and clicks (using GUIGetCursorInfo() to get the icon ID). It seem to work ... but sometimes the hover effect does not show as expected especially when the mouse is moved slowly to the edge of the icon. While the icon ID is being read and action triggered (see Mouse OVER text) the icon itself is not being hidden (and button displayed). I found that the effect is more likely to occur when the GUI is freshly loaded. Can anyone reproduce this effect? I wonder what may causes this effect or is anything wrong in my coding? Any hint and support would be appreciated! Many thanks #include <StaticConstants.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) f_toolbar() Func f_toolbar() Local $id_button_1_a, $id_button_2_a, $id_button_3_a Local $id_button_1_b, $id_button_2_b, $id_button_3_b Local $id_button_close Local $h_toolbar_gui, $msg_pop, $id_output_lbl ; -- Declare and set mouse over variables Local $last_tool_b_id = 0 ; ID of last button/icon visited Local $a_cursor_b_info ; GUIGetCursorInfo() array Local $win_w = 400 ; GUI width Local $win_h = 400 ; GUI height Local $icon_file = @SystemDir & "\shell32.dll" ; -- Create the GUI ------------------------------------------------------------------------------------------------------- $h_toolbar_gui = GUICreate("Toolbar hover - Test ...", $win_w, $win_h) ; -- A frame for the toolbar GUICtrlCreateLabel("", 3, 3, $win_w-3, 44, $SS_ETCHEDFRAME ) GUICtrlSetState(-1, $GUI_DISABLE) ; -- The Toolbar ; -- 1. Toolbar button ----------------------------------------------------------------------------------------------------- $id_button_1_a = GUICtrlCreateButton("1", 4, 4, 40, 40, $BS_ICON) ; Create BUTTON GUICtrlSetImage(-1, $icon_file, -71, 1) ; Add ICON to button GUICtrlSetState(-1, $GUI_HIDE) ; Hide ICON BUTTON again $id_button_1_b = GUICtrlCreateIcon($icon_file, -71, 4, 4, 40, 40, $BS_CENTER) ; Create ICON to display ; -- 2. Toolbar button ----------------------------------------------------------------------------------------------------- $id_button_2_a = GUICtrlCreateButton("2", 44, 4, 40, 40, $BS_ICON) ; Create BUTTON GUICtrlSetImage(-1, $icon_file, -5, 1) ; Add ICON to button GUICtrlSetState(-1, $GUI_HIDE) ; Hide ICON BUTTON again $id_button_2_b = GUICtrlCreateIcon($icon_file, -5, 44, 4, 40, 40, $BS_CENTER) ; Create ICON to display ; -- 3. Toolbar button ----------------------------------------------------------------------------------------------------- $id_button_3_a = GUICtrlCreateButton("3", 84, 4, 40, 40, $BS_ICON) GUICtrlSetImage(-1, $icon_file, -28, 1) ; Add ICON to button GUICtrlSetState(-1, $GUI_HIDE) ; Hide ICON BUTTON again $id_button_3_b = GUICtrlCreateIcon($icon_file, -28, 84, 4, 40, 40, $BS_CENTER) ; Create ICON to display ; -- Lable CTRL for feedback $id_output_lbl = GUICtrlCreateLabel("Move mouse over toolbar ...", 4, 100, $win_w-8, 16) ; Lable for feedback GUICtrlSetBkColor($id_output_lbl, 0xFFFFFF) ; -- The Close button $id_button_close = GUICtrlCreateButton("Close", $win_w/2-40, $win_h-40, 80, 24, $BS_DEFPUSHBUTTON) GUISetState(@SW_SHOW) While 1 $msg_pop = GUIGetMsg() Select Case $msg_pop = $GUI_EVENT_CLOSE ExitLoop Case $msg_pop = $id_button_close ExitLoop Case $msg_pop = $id_button_1_a Or $msg_pop = $id_button_1_b GUICtrlSetState($id_button_1_a, $GUI_SHOW) ; Show BUTTON MsgBox(32, "DEBUG", "Button 1 pressed ...", 0, $h_toolbar_gui) Case $msg_pop = $id_button_2_a Or $msg_pop = $id_button_2_b GUICtrlSetState($id_button_2_a, $GUI_SHOW) ; Show BUTTON MsgBox(32, "DEBUG", "Button 2 pressed ...", 0, $h_toolbar_gui) Case $msg_pop = $id_button_3_a Or $msg_pop = $id_button_3_b GUICtrlSetState($id_button_3_a, $GUI_SHOW) ; Show BUTTON MsgBox(32, "DEBUG", "Button 3 pressed ...", 0, $h_toolbar_gui) Case Else $a_cursor_b_info = GUIGetCursorInfo($h_toolbar_gui) ; - $aArray[4] = ID of the control that the mouse cursor is hovering over (or 0 if none) Select ; -- Button 1 - Cursor ------------------------------------------------------------------------------------- Case $a_cursor_b_info[4] = $id_button_1_b And $last_tool_b_id <> $id_button_1_b And $last_tool_b_id = 0 ; MOUSE OVER GUICtrlSetState($id_button_1_a, $GUI_SHOW) ; Show BUTTON GUICtrlSetData($id_output_lbl, "Mouse OVER - Ctrl ID:" & @TAB & $a_cursor_b_info[4]) GUICtrlSetBkColor($id_output_lbl, 0xFFFF00) $last_tool_b_id = $id_button_1_b ; -- DEBUG ----------------------------------------------------------------- ConsoleWrite("> ... " & "$last_tool_b_id - Ctrl ID:" & @TAB & $last_tool_b_id & @CRLF) ; -- DEBUG ----------------------------------------------------------------- Case $a_cursor_b_info[4] <> $id_button_1_b And $last_tool_b_id = $id_button_1_b ; NO MOUSE OVER GUICtrlSetState($id_button_1_a, $GUI_HIDE) ; Hide BUTTON $a_cursor_b_info[4] = 0 GUICtrlSetData($id_output_lbl, "Mouse AWAY - Ctrl ID:" & @TAB & $a_cursor_b_info[4]) GUICtrlSetBkColor($id_output_lbl, 0x99CCFF) $last_tool_b_id = 0 ; -- DEBUG ----------------------------------------------------------------- ConsoleWrite("> ... " & "$last_tool_b_id - Ctrl ID:" & @TAB & $last_tool_b_id & @CRLF) ; -- DEBUG ----------------------------------------------------------------- ; -- Button 2 - Cursor ------------------------------------------------------------------------------------- Case $a_cursor_b_info[4] = $id_button_2_b And $last_tool_b_id <> $id_button_2_b And $last_tool_b_id = 0 ; MOUSE OVER GUICtrlSetState($id_button_2_a, $GUI_SHOW) ; Show BUTTON GUICtrlSetData($id_output_lbl, "Mouse OVER - Ctrl ID:" & @TAB & $a_cursor_b_info[4]) GUICtrlSetBkColor($id_output_lbl, 0xFFFF00) $last_tool_b_id = $id_button_2_b ; -- DEBUG ----------------------------------------------------------------- ConsoleWrite("> ... " & "$last_tool_b_id - Ctrl ID:" & @TAB & $last_tool_b_id & @CRLF) ; -- DEBUG ----------------------------------------------------------------- Case $a_cursor_b_info[4] <> $id_button_2_b And $last_tool_b_id = $id_button_2_b ; NO MOUSE OVER GUICtrlSetState($id_button_2_a, $GUI_HIDE) ; Hide BUTTON $a_cursor_b_info[4] = 0 GUICtrlSetData($id_output_lbl, "Mouse AWAY - Ctrl ID:" & @TAB & $a_cursor_b_info[4]) GUICtrlSetBkColor($id_output_lbl, 0x99CCFF) $last_tool_b_id = 0 ; -- DEBUG ----------------------------------------------------------------- ConsoleWrite("> ... " & "$last_tool_b_id - Ctrl ID:" & @TAB & $last_tool_b_id & @CRLF) ; -- DEBUG ----------------------------------------------------------------- ; -- Button 3 - Cursor ------------------------------------------------------------------------------------- Case $a_cursor_b_info[4] = $id_button_3_b And $last_tool_b_id <> $id_button_3_b And $last_tool_b_id = 0 ; MOUSE OVER GUICtrlSetState($id_button_3_a, $GUI_SHOW) ; Show BUTTON GUICtrlSetData($id_output_lbl, "Mouse OVER - Ctrl ID:" & @TAB & $a_cursor_b_info[4]) GUICtrlSetBkColor($id_output_lbl, 0xFFFF00) $last_tool_b_id = $id_button_3_b ; -- DEBUG ----------------------------------------------------------------- ConsoleWrite("> ... " & "$last_tool_b_id - Ctrl ID:" & @TAB & $last_tool_b_id & @CRLF) ; -- DEBUG ----------------------------------------------------------------- Case $a_cursor_b_info[4] <> $id_button_3_b And $last_tool_b_id = $id_button_3_b ; NO MOUSE OVER GUICtrlSetState($id_button_3_a, $GUI_HIDE) ; Hide BUTTON $a_cursor_b_info[4] = 0 GUICtrlSetData($id_output_lbl, "Mouse AWAY - Ctrl ID:" & @TAB & $a_cursor_b_info[4]) GUICtrlSetBkColor($id_output_lbl, 0x99CCFF) $last_tool_b_id = 0 ; -- DEBUG ----------------------------------------------------------------- ConsoleWrite("> ... " & "$last_tool_b_id - Ctrl ID:" & @TAB & $last_tool_b_id & @CRLF) ; -- DEBUG ----------------------------------------------------------------- EndSelect EndSelect WEnd GUIDelete() EndFunc ;==> f_toolbar()
  16. Shell icons...

    Hi all ! I'm looking for arrow icons in the Windows Explorer : (The 2 similar ones in this pic) I think they're in a system DLL... but which one ? (Not in shell32, nor in user32) Any help appreciated !
  17. I've just updated to Autoit v3.3.10.2 and the compiling seems a bit odd - My compiled programs are now twice the size they were before (one script went from 8kB compiled to 15 kB compiled with new version) Also my compiled exe's have no icons. When I compile in the SciteLite version that ships with the AutoIt installer, there is no verbose text telling me what happened in the compilation, It just says the time taken to run in the standard blue text output. I was running "Scite for AutoIt" yesterday, but installed it before installing the new Autoit version. The version of AutoIt I was running up until today was v3.3.8.1 If anybody can help or has seen similar behaviour could let me know I'd appreciate it sincerely
  18. Hi i have some problemes in gettings my Lables and icons to be transperent, i can make my labels transperent with guictrlsetbgkcolor(-1,"-2") but then the texts look weird. As it is to thick i can't get my icons to be transpent either Plz Plz Plz some help me Ps. is there any way i can change the default push button to the currenly active button? #cs***************************************** Proxy_Switch.au3 by Krabbe Created with ISN AutoIt Studio v. 0.94 BETA Created with ISN Form Studio 2 for ISN AutoIt Studio Script Version: 1.0 Last Modified: 21-11-2013 Script Function: Enable and Disable proxy settings in IE as user don't normaly know the path #ce***************************************** #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstants.au3> #include <Constants.au3> #Include <GuiButton.au3> #include <GDIPlus.au3> #include <WinAPI.au3> #include <Array.au3> #include <IE.au3> Global $WlanInf[7] Global $LanInf[7] Global $PXYSVR = "proxy.intranet.ap" Global $PXYPRT = "80" Global $RegKeyLoc = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" Global $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20 Global $objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2") Global $hImage = @Scriptdir& "\Images\hGUI1.png" Global $cImage = @Scriptdir& "\Images\cGUI.gif" Global $hGUI, $cGUI, $BtnEnableDisable, $BtnExit Global $LblCurrentConnect, $LblCurrentState, $LblSuggestSetting Global $RegGetProxyCurAdr, $RegGetProxyState #cs==========$WlanInf============ #cs==========$LanInf============= | [0] = Name | | [0] = Name | | [1] = MacAdress | | [1] = MacAdress | | [2] = Connect True/False | | [2] = Connect True/False | | [3] = Connected 2 Domain name | | [3] = Connected 2 Domain name | | [4] = Your Computer Domain | | [4] = Your Computer Domain | | [5] = IpAdress | | [5] = IpAdress | | [6] = Gateway | | [6] = Gateway | #ce============================== #ce============================== ;====================================== Start GDI Magic ================================ _GDIPlus_Startup() ; Initialize GDI+ library $hImage = _GDIPlus_ImageLoadFromFile($hImage) ; Main GUI Bckg Img $width = _GDIPlus_ImageGetWidth($hImage) ; Img Width | GUI Width $height = _GDIPlus_ImageGetHeight($hImage) ; Img Height | GUI Height _MainUI() Func _MainUI() Global $hGUI = GUICreate("MSI Recovery Image Finder", $width, $height, -1, -1, $WS_POPUP,$WS_EX_LAYERED) GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") GUISetState(@SW_SHOW,$hGUI) For $i = 0 To 240 Step 10 SetBitmap($hGUI, $hImage, $i) Sleep(10) Next Global $cGUI = GUICreate('childgui', $width, $height, 4, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD,$GUI_WS_EX_PARENTDRAG), $hGUI) $ChildBckg = GUICtrlCreatePic($cImage, 0, 0, $width, $height) GUICtrlSetBkColor($ChildBckg, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetState($ChildBckg, $GUI_DISABLE) Global $BtnEnable = GUICtrlCreateButton("Enable",75,85,60,20,$BS_DEFPUSHBUTTON,-1) GUICtrlSetFont(-1,8,400,0,"Constantia") Global $BtnDisable = GUICtrlCreateButton("Disable",165,85,60,20,$BS_DEFPUSHBUTTON,-1) GUICtrlSetFont(-1,8,400,0,"Constantia") Global $LblCurrentSetting = GUICtrlCreateLabel("",226,35,42,15,-1,-1) GUICtrlSetFont($LblCurrentSetting,8,400,0,"Constantia") Global $LblSuggestSetting = GUICtrlCreateLabel("",226,50,42,15,-1,-1) GUICtrlSetFont($LblSuggestSetting,8,400,0,"Constantia") Global $LblCurrentConnect = GUICtrlCreateLabel("proxy.intranet.ap:80",173,65,95,15,-1,-1) GUICtrlSetFont($LblCurrentConnect,8,100,0,"Constantia") ;~ GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) Global $IcnExit = GUICtrlCreateIcon("imageres.dll",98,267,10,16,16,-1,-1) GUICtrlSetBkColor($IcnExit,$GUI_BKCOLOR_TRANSPARENT) Global $IcnHelp = GUICtrlCreateIcon("imageres.dll",99,249,10,16,16,-1,-1) GUICtrlSetBkColor($IcnHelp,0x373737) _GetCurrentProxyState() _GetActiveSSID() GUISetState(@SW_SHOW,$cGUI) While 1 _ChkIfProxyStateChanged() $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $IcnExit Exit Case $IcnHelp MsgBox(16,"Help","Coming Soon") Case $BtnEnable $RegWriteProxyEnable = RegWrite($RegKeyLoc, "ProxyEnable", "REG_DWORD", "1") DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0) $RegGetProxyCurAdr = RegRead($RegKeyLoc,"ProxyServer") If BitOr($RegGetProxyCurAdr = -1,@error > 0,$RegGetProxyCurAdr = "") Then ConsoleWrite('RegRead($RegKeyLoc,"ProxyServer") = Failed >Error code: ' & @error & @crlf) ;### Debug Console BitAND(GUICtrlSetState($BtnDisable,$GUI_ENABLE),GUICtrlSetState($BtnEnable,$GUI_DISABLE)) BitAND(GUICtrlSetData($LblCurrentConnect,$RegGetProxyCurAdr),GUICtrlSetData($LblCurrentSetting,"Enabled")) Case $BtnDisable $RegWriteProxyDisable = RegWrite($RegKeyLoc, "ProxyEnable", "REG_DWORD", "0") DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0) $RegGetProxyCurAdr = RegRead($RegKeyLoc,"ProxyServer") If BitOr($RegGetProxyCurAdr = -1,@error > 0,$RegGetProxyCurAdr = "") Then ConsoleWrite('RegRead($RegKeyLoc,"ProxyServer") = Failed >Error code: ' & @error & @crlf) ;### Debug Console BitAND(GUICtrlSetState($BtnDisable,$GUI_DISABLE),GUICtrlSetState($BtnEnable,$GUI_ENABLE)) BitAND(GUICtrlSetData($LblCurrentConnect,$RegGetProxyCurAdr),GUICtrlSetData($LblCurrentSetting,"Disabled")) EndSwitch WEnd EndFunc Func _GetCurrentProxyState() $RegGetProxyCurAdr = RegRead($RegKeyLoc,"ProxyServer") If BitOr($RegGetProxyCurAdr = -1,@error > 0,$RegGetProxyCurAdr = "") Then ConsoleWrite('RegRead($RegKeyLoc,"ProxyServer") = Failed >Error code: ' & @error & @crlf) ;### Debug Console ConsoleWrite('$RegGetProxyCurAdr = ' & $RegGetProxyCurAdr & ' >Error code: ' & @error & @crlf) ;### Debug Console ;~ If $RegGetProxyCurAdr <> "proxy.intranet.ap:80" Then ;~ $RegWriteProxyAdr = RegWrite($RegKeyLoc, "ProxyServer", "REG_SZ", $PXYSVR & ":" & $PXYPRT) ;~ DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0) ;~ $RegGetProxyCurAdr = RegRead($RegKeyLoc,"ProxyServer") ;~ GUICtrlSetData($LblCurrentConnect,$RegGetProxyCurAdr) ;~ Else ;~ $RegGetProxyCurAdr = RegRead($RegKeyLoc,"ProxyServer") ;~ GUICtrlSetData($LblCurrentConnect,$RegGetProxyCurAdr) ;~ EndIf $RegGetProxyState = RegRead($RegKeyLoc,"ProxyEnable") ConsoleWrite('$RegGetProxyState = ' & $RegGetProxyState & ' >Error code: ' & @error & @crlf) ;### Debug Console If $RegGetProxyState = 0 Then BitAND(GUICtrlSetData($LblCurrentState,"Disabled"),GUICtrlSetState($BtnEnable,$GUI_ENABLE),GUICtrlSetState($BtnDisable,$GUI_DISABLE)) If $RegGetProxyState = 1 Then BitAND(GUICtrlSetData($LblCurrentState,"Enabled"),GUICtrlSetState($BtnEnable,$GUI_DISABLE),GUICtrlSetState($BtnDisable,$GUI_ENABLE)) EndFunc Func _ChkIfProxyStateChanged() $RegGetProxyState = RegRead($RegKeyLoc,"ProxyEnable") ConsoleWrite('Current Proxy State = ' & $RegGetProxyState & ' >Error code: ' & @error & @crlf) ; If user changes proxy manualy while the prg is running If GUICtrlRead($LblCurrentSetting)="Enabled" And $RegGetProxyState = 0 Then GUICtrlSetState($BtnDisable,$GUI_DISABLE) GUICtrlSetState($BtnEnable,$GUI_ENABLE) GUICtrlSetData($LblCurrentConnect,$RegGetProxyCurAdr) GUICtrlSetData($LblCurrentSetting,"Disabled") EndIf ; If user changes proxy manualy while the prg is running If GUICtrlRead($LblCurrentSetting)="Disabled" And $RegGetProxyState = 1 Then GUICtrlSetState($BtnDisable,$GUI_ENABLE) GUICtrlSetState($BtnEnable,$GUI_DISABLE) GUICtrlSetData($LblCurrentConnect,$RegGetProxyCurAdr) GUICtrlSetData($LblCurrentSetting,"Enabled") EndIf EndFunc Func _GetActiveSSID() Global $Output = "", $colItems = "", $colItems1 = "" $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems If StringInStr($objItem.Caption,"Intel") Then If $objItem.NetConnectionID = "Wireless Network Connection" Then $WlanInf[0] = $objItem.Description $WlanInf[1] = $objItem.MACAddress $WlanInf[2] = $objItem.NetEnabled ElseIf $objItem.NetConnectionID = "Local Area Connection" Then $LanInf[0] = $objItem.Description $LanInf[1] = $objItem.MACAddress $LanInf[2] = $objItem.NetEnabled EndIf $Output="" EndIf Next Else Msgbox(0,"WMI Output ERROR","No WMI Objects Found for class: " & "Win32_NetworkAdapter",2) SetError(1,0,"Error in WMI Win32_NetworkAdapter") Endif $colItems1 = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration", "WQL",$wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems1) then For $objItem In $colItems1 If StringInStr($objItem.Caption,"Intel") <> 0 Then If BitAND($WlanInf[1] = $objItem.MACAddress, $WlanInf[0] = $objItem.Description) Then $WlanInf[3] = $objItem.DNSDomain $WlanInf[4] = $objItem.DNSDomainSuffixSearchOrder(0) $WlanInf[5] = $objItem.IPAddress(0) $WlanInf[6] = $objItem.DefaultIPGateway(0) ElseIf BitAND($LanInf[1] = $objItem.MACAddress, $LanInf[0] = $objItem.Description) Then $LanInf[3] = $objItem.DNSDomain $LanInf[4] = $objItem.DNSDomainSuffixSearchOrder(0) $LanInf[5] = $objItem.IPAddress(0) $LanInf[6] = $objItem.DefaultIPGateway(0) EndIf EndIf Next Else Msgbox(0,"WMI Output ERROR","No WMI Objects Found for class: " & "Win32_NetworkAdapterConfiguration",2) SetError(2,0,"Error in WMI Win32_NetworkAdapterConfiguration") Endif If $LanInf[3] <> "intranet.ap" Then GUICtrlSetData($LblSuggestSetting,"Disabled") Else GUICtrlSetData($LblSuggestSetting,"Enabled") EndIf EndFunc Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) If ($hWnd = $hGUI) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION EndFunc Func SetBitmap($hGUI, $hImage, $iOpacity) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", 1) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc
  19. I'm trying to put an icon in the top of the GUI window using _GDIPlus.au3. I've tried using the Sleep(20) that has been suggested to no avail. Thank you for any and all help. Func GUI() Local $hImageGreen, $hImageRed, $hGraphic, $CheckRunning, $Parent, $ButtonInstall, $buttonUninstall, $ButtonStart, $ButtonStop, $ButtonConfigure _GDIPlus_Startup() $hImageRed = _GDIPlus_ImageLoadFromFile(@UserProfileDir & "\Desktop\SRRS\console\Red.png") $hImageGreen = _GDIPlus_ImageLoadFromFile(@UserProfileDir & "\Desktop\SRRS\console\Green.png") $Parent = GUICreate("Console", 345, 225) ConsoleWrite($hImageRed & "<-red green->" & $hImageGreen) $CheckRunning = ProcessExists("test.exe") If $CheckRunning <> 0 Then GUICtrlCreateLabel("its running!", 110, 40) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($Parent) Sleep(20) _GDIPlus_GraphicsDrawImage($hGraphic, $hImageGreen, 110, 40) Else GUICtrlCreateLabel("not running!", 108, 40) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($Parent) Sleep(20) _GDIPlus_GraphicsDrawImage($hGraphic, $hImageRed, 110, 40) EndIf $ButtonInstall = GUICtrlCreateButton("Install", 55, 85, 70) $ButtonUninstall = GUICtrlCreateButton("Uninstall", 55, 125, 70) $ButtonStart = GUICtrlCreateButton("Start", 210, 85) $ButtonStop = GUICtrlCreateButton("Stop", 210, 125) $ButtonConfigure = GUICtrlCreateButton("Configure", 131, 165, 70) GUICtrlCreateLabel("Is it Running?", 110, 10) GUISetState(@SW_SHOW) ;shows the GUI window
  20. I am trying to add a specific icon or image to a specific ListView Item . I add the items in the ListView control with this command : _GUICtrlListView_AddItem . Right now what I only managed to do is to add an icon for ALL the items in the control, BUT, if I try to add an icon to only one item , its just impossible Atleast for me >_< I have tried GUICtrlSetImage(-1, "C:icon.ico") tried with creating _GUIImageList_Create , icons not transparent , 16x16 pixels, tried many other icons, tried with .bmp, .png - nothing worked so far O_O ! Anyone yet managed to do something with this problem so far? Thanks
  21. I was helping another user the other day And decided To make a UDF so here it is. Let me know what ya think. #include-once #include <GuiListView.au3> Global Const $SW_HIDENA = 2, $SW_HIDENOACTIVE = 2 ; Examples are below. ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ToggleSystemTrayState ; Description ...: Hide/Show System Tray Icons by Name or Set the State for all Icons ; Syntax ........: _ToggleSystemTrayState([$vTrayItems = ""[, $iStartSearchIndex = 0[, $iSystemTrayState = 0[, $iDebug = 0]]]]) ; Parameters ....: $vTrayItems - [optional] A variant value. Default is "". ; $iStartSearchIndex - [optional] An integer value. Default is 0. Set this to -1 to search from end to start. ; $iSystemTrayState - [optional] An integer value. Default is 0. ; $iDebug - [optional] An integer value. Default is 0. Set this to either @SW_SHOW or 1 to see dialogs and debug information. ; Return values .: None ; Author ........: Decipher ; Modified ......: ; Remarks .......: Tested only on XP ; ; $iSystemTrayState can be one of the following: ; @SW_SHOW == ALWAYS_SHOW == 5 ; @SW_HIDE == ALWAYS_HIDE == 0 ; $SW_HIDENA == HIDE WHEN INACTIVE == 2 ; ; $vTrayItems can be a string for a specific icon or an array for multiple icons ; There is no error checking implemented but feel free to change it to your needs. ; ; Related .......: ; Link ..........: ; Example .......: Yes, The examples need to be uncommented to run. Remove the ( ;- ) prefix on the example to be ran. ; =============================================================================================================================== ;;;; Set all icons to hide when inactive. ;;;; ;- _ToggleSystemTrayState($SW_HIDENA) ; Example #1 ;;;; Hide all system tray icons. ;;;; ;- _ToggleSystemTrayState(@SW_HIDE) ; Example #2 ;;;; Show two specific icons. ;;;; ;- Local $aIcons[2] = ["Local Area Connection", "Volume"] ; Example #3 ;- _ToggleSystemTrayState($aIcons, 0, @SW_SHOW) ;;;; Hide a specific icon. ;;;; ;- _ToggleSystemTrayState("Volume", 0, @SW_HIDE) ; Example #4 ;;;; Show all system tray icons. ;;;; ;- _ToggleSystemTrayState(@SW_SHOW) ; Example #5 ;;;; Hide all system tray icons but show the dialogs aka debug mode and log the names of the icons hidden. ;;;; ;- _ToggleSystemTrayState("", 0, @SW_HIDE, 1) ; Example #6 Func _ToggleSystemTrayState($vTrayItems = "", $iStartSearchIndex = 0, $iSystemTrayState = 0, $iDebug = 0) If IsInt($vTrayItems) Then $iSystemTrayState = $vTrayItems $vTrayItems = "" EndIf Local Const $sOPTIONS_DIALOG_PROCESS = "rundll32.exe shell32.dll, Options_RunDLL 1" Local Const $sTASKBAR_PROPERTIES_TITLE = "[TITLE:Taskbar and Start Menu Properties; CLASS:#32770; INSTANCE:1]" Local Const $sCUSTOMIZE_BUTTON = "[ClassnameNN:Button10]", $sSENDKEYS = "!c" Local Const $sTASKBAR_CUSTOMIZE_TITLE = "[TITLE:Customize Notifications; CLASS:#32770; INSTANCE:1]" Local Const $sTRAYICONS_LISTVIEW = "[CLASS:SysListView32; INSTANCE:1]" Local Const $sLISTVIEW_COMBOX_CONTROL = "[CLASS:ComboBox; INSTANCE:1]" Local Const $sTASKBAR_CHILD_OK_BUTTON = "[CLASS:Button; INSTANCE:2]" Local Const $iRUNDLL32 = Run($sOPTIONS_DIALOG_PROCESS) WinWait($sTASKBAR_PROPERTIES_TITLE, "", 2000) Local Const $hTASKBAR_DIALOG = WinGetHandle($sTASKBAR_PROPERTIES_TITLE) WinSetState($hTASKBAR_DIALOG, "", $iDebug) ControlSend($hTASKBAR_DIALOG, "", ControlGetHandle($hTASKBAR_DIALOG, "", $sCUSTOMIZE_BUTTON), $sSENDKEYS) WinWait($sTASKBAR_CUSTOMIZE_TITLE, "", 2000) $hTASKBAR_CHILD_DIALOG = WinGetHandle($sTASKBAR_CUSTOMIZE_TITLE) WinSetState($hTASKBAR_CHILD_DIALOG, "", $iDebug) Local Const $hDIALOG_LISTVIEW = ControlGetHandle($hTASKBAR_CHILD_DIALOG, "", $sTRAYICONS_LISTVIEW) Local $iListViewItem = 0, $hComboBox_Instance = 0, $aTrayIcon[1], $iTrayIcon, $iSkipTask = False, $sTrayItemText If IsArray($vTrayItems) Or $vTrayItems <> "" Then If Not IsArray($vTrayItems) Then $aTrayIcon[0] = $vTrayItems Else $aTrayIcon = $vTrayItems EndIf For $i = 0 To UBound($aTrayIcon, 1) - 1 Step 1 $iTrayIcon = _GUICtrlListView_FindInText($hDIALOG_LISTVIEW, $aTrayIcon[$i], $iStartSearchIndex) If $iDebug Then ConsoleWrite("Tray Icon: " & @TAB & _GUICtrlListView_GetItemText($hDIALOG_LISTVIEW, $iTrayIcon) & @CRLF) EndIf _GUICtrlListView_SetItemFocused($hDIALOG_LISTVIEW, $iTrayIcon) $hComboBox_Instance = ControlGetHandle($hTASKBAR_CHILD_DIALOG, "", $sLISTVIEW_COMBOX_CONTROL) ControlSend($hTASKBAR_CHILD_DIALOG, "", $hDIALOG_LISTVIEW, "{SPACE}") For $iLoopIndex = 1 To 3 Step 1 ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{DOWN}") Next If $iSystemTrayState <> 5 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") If $iSystemTrayState = 2 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") EndIf EndIf Next $iSkipTask = True EndIf While WinExists($hTASKBAR_CHILD_DIALOG) If $iSkipTask Then ExitLoop EndIf If $iListViewItem >= _GUICtrlListView_GetItemCount($hDIALOG_LISTVIEW) + 1 Then ExitLoop EndIf $iListViewItem += 1 ControlFocus($hTASKBAR_CHILD_DIALOG, "", $hDIALOG_LISTVIEW) If $iDebug Then $sTrayItemText = _GUICtrlListView_GetItemText($hDIALOG_LISTVIEW, $iListViewItem) If $sTrayItemText <> "" Then ConsoleWrite("Tray Icon: " & @TAB & $sTrayItemText & @CRLF) EndIf EndIf $hComboBox_Instance = ControlGetHandle($hTASKBAR_CHILD_DIALOG, "", $sLISTVIEW_COMBOX_CONTROL) For $i = 1 To 3 Step 1 ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{DOWN}") Next If $iSystemTrayState <> 5 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") If $iSystemTrayState = 2 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") EndIf EndIf ControlSend($hTASKBAR_CHILD_DIALOG, "", $hDIALOG_LISTVIEW, "{DOWN}") WEnd ControlSend($hTASKBAR_CHILD_DIALOG, "", $sTASKBAR_CHILD_OK_BUTTON, "{ENTER}") WinClose($hTASKBAR_DIALOG) If ProcessExists($iRUNDLL32) Then ProcessClose($iRUNDLL32) EndIf EndFunc ;==>_ToggleSystemTrayState
  22. Hi, Here is an UDF to create, delete, set the icon and state, tooltip and tip for your notify icons. The main advantage is that you can handle mouse events as you want, there is no default events. You can create fully customised notifyicons/tooltips. Thanks to Holger Kotsch for his ModernMenu UDF. Note : Breaking changes ! Please use the 1.2+ version. Functions : Attachments : Example + UDF : AutoIt v3.3.10.0+ NotifyIcon_1.2.zip TrayIconEx_1.1.zip AutoIt v3.3.8.0+ TrayIconEx.zip & Requirements : >WinAPIEx UDF. As usual, enjoy !
  23. The script below demonstrates my problem. If I run this script all icon buttons save the one created before the tab control are placed behind the tab and only the icon shows. I've tried everything I could think of, setting different styles, states etc. to the GUI, tab, button, icon... Well you get the picture. Nothing has worked thusfar and I'm at a complete loss here. Any help would be much appreciated. This will create a GUI with two tabs and four buttons of which three are behind the tab control. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> Local $iExit, $iGUIMsg GUICreate('Problem...', 180, 150, -1, -1, $GUI_SS_DEFAULT_GUI, $WS_EX_TOPMOST) ; This button will show correctly. $iExit = _IconOnButton('Close', 10, 120, 160, 20, 200) ; Create tab. GUICtrlCreateTab(5, 5, 120, 140) ; First item and button with missing text and borders. GUICtrlCreateTabItem('One') _IconOnButton('First', 10, 30, 160, 20, 3) ; Second item and button with missing text and borders. GUICtrlCreateTabItem('Two') _IconOnButton('Second', 10, 60, 160, 20, 24) ; Close tab control. GUICtrlCreateTabItem('') ; Another button with missing text and borders. _IconOnButton('Third', 10, 90, 160, 20, 1001) GUISetState(@SW_SHOW) While 1 $iGUIMsg = GUIGetMsg() Switch $iGUIMsg Case $iExit, $GUI_EVENT_CLOSE ; Exit Exit EndSwitch WEnd ; By Valuater Func _IconOnButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = 'shell32.dll') GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16) GUICtrlSetState( -1, $GUI_DISABLE) Local $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS) Return $XS_btnx EndFunc
  24. I've been having some problems adding a icon from a .dll into a treeview, Does the function _GUICtrlTreeView_SetIcon only allow you to use Shell icons or am i doing something wrong? My main script is way to large to post up so I've created a short example to illustrate my problem the resource file is attatched #include <GUITreeView.au3> #include <TreeViewConstants.au3> #include <GUIConstants.au3> Global $GUITree, $hTree $hGUI = GUICreate("Example", 500, 500, -1, -1) GUICtrlCreateLabel("Add Item Type ( 1 - 22 )", 220, 20) $hCombo = GUICtrlCreateCombo("", 220, 40, 50, 22, 0x0003) GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22", "1") $hCreate = GUICtrlCreateButton("Create Tree Item", 280, 39, 100, 22) $hTree = GUICtrlCreateTreeView( 10, 10, 200, 480, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS)) GUISetState() _GUICtrlTreeView_BeginUpdate($hTree) $GUITree = _GUICtrlTreeView_Add($hTree, 0, "hGUI") _GUICtrlTreeView_SetIcon($GUITree, $GUITree, @ScriptDir&"\Resources.dll", 119) _GUICtrlTreeView_EndUpdate($hTree) While 1 $hMsg = GUIGetMsg() Switch $hMsg Case -3 Exit Case $hCreate $hTreeItem = _AddTreeItem("Control Type "&GUICtrlRead($hCombo), GUICtrlRead($hCombo)) _GUICtrlTreeView_Expand($hTree) EndSwitch WEnd Func _AddTreeItem($aName, $aType) _GUICtrlTreeView_BeginUpdate($hTree) $hItem = _GUICtrlTreeView_AddChild($hTree, $GUITree, $aName) _GUICtrlTreeView_SetIcon($hTree, $hItem, @ScriptDir&"\Resources.dll", _GetIcon($aType)) _GUICtrlTreeView_EndUpdate($hTree) ConsoleWrite("+ _AddTreeItem("&$aName&", "&$aType&") Icon # "&_GetIcon($aType)&@CRLF) Return $hItem EndFunc Func _GetIcon($Type) If $Type = 1 Then Return 122 ElseIf $Type = 2 Then Return 102 ElseIf $Type = 3 Then Return 121 ElseIf $Type = 4 Then Return 114 ElseIf $Type = 5 Then Return 105 ElseIf $Type = 6 Then Return 129 ElseIf $Type = 7 Then Return 107 ElseIf $Type = 8 Then Return 123 ElseIf $Type = 9 Then Return 111 ElseIf $Type = 10 Then Return 127 ElseIf $Type = 11 Then Return 120 ElseIf $Type = 12 Then Return 128 ElseIf $Type = 13 Then Return 135 ElseIf $Type = 14 Then Return 138 ElseIf $Type = 15 Then Return 126 ElseIf $Type = 16 Then Return 136 ElseIf $Type = 17 Then Return 133 ElseIf $Type = 18 Then Return 124 ElseIf $Type = 19 Then Return 116 ElseIf $Type = 20 Then Return 113 ElseIf $Type = 21 Then Return 118 ElseIf $Type = 22 Then Return 104 EndIf EndFunc Any help would be appreciated Resources.zip
  25. Hi I am trying to embed an icon control and an AVI control in the status bar but the problem is they won't retain their transparency. An example: #include <GuiStatusBar.au3> #include <GUIConstantsEx.au3> Global $WindowMain = GUICreate("Example", 351, 176, -1, -1) GUISetBkColor( 0xDDDDDD, $WindowMain ) Global $Statusbar = _GUICtrlStatusBar_Create($WindowMain) Global $Statusbar_PartsWidth[2] = [324, -1] _GUICtrlStatusBar_SetParts($Statusbar, $Statusbar_PartsWidth) _GUICtrlStatusBar_SetText($Statusbar, "", 0) _GUICtrlStatusBar_SetText($Statusbar, "", 1) _GUICtrlStatusBar_SetMinHeight($Statusbar, 20) GUISetState(@SW_SHOW) $Icon = GUICtrlCreateIcon('ico.ico',-1,300,130,16,16) ;Icon on GUI ;Without this the icon will not be tranparent. No idea why. GUICtrlSetState($icon, $GUI_SHOW) $Icon2 = GUICtrlCreateIcon('ico.ico',-1,10,10,16,16) _GUICtrlStatusBar_EmbedControl($Statusbar, 1, GUICtrlGetHandle($Icon2), 1+2) ; This has no effect. Icon has a white square around it GUICtrlSetState($icon2, $GUI_SHOW) $AVI = GUICtrlCreateAvi( 'avi.avi',0,250,130,16,16) GUICtrlSetState( $AVI, 1 ) $AVI2 = GUICtrlCreateAvi( 'avi.avi',0,250,130,16,16) GUICtrlSetState( $AVI2, 1 ) _GUICtrlStatusBar_EmbedControl($Statusbar, 0, GUICtrlGetHandle($AVI2), 1+2) Global $GuiMsg Do $GuiMsg = GUIGetMsg() Until $GuiMsg = $GUI_EVENT_CLOSE I've tried a couple of things like using _GUICtrlStatusBar_SetIcon() or GDIplus for icons and that works and the icons are transparent. As for the AVI, I tried faking a status bar by drawing some lines at the buttom of the window and that worked ok too, But I'd love to be able to use it with a real status bar. example.zip
×