Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/18/2012 in all areas

  1. Or you could pass the URL at startup: Run("C:Program FilesGoogleChromeApplicationchrome.exe www.google.com")
    1 point
  2. In addition to the functions you added, i suggest to add these two ones ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GUICtrlComboBox_AutoFillSetContent ; Description ...: Set the content of a ComboBox ; Syntax ........: _GUICtrlComboBox_AutoFillSetContent($hWnd, $vData) ; Parameters ....: $hWnd - Control ID/Handle to the control. ; $vData - Either an 1-Based array of items, or a pipe "|" delimited string of items. ; Return values .: Success - Items count ; Failure - -1 ; Author ........: Matwachich ; =============================================================================================================================== Func _GUICtrlComboBox_AutoFillSetContent($hWnd, $vData) Local $iIndex, $iCount $iIndex = __CBA_GetHWndIndex($hWnd) If Not $iIndex Then Return -1 _GUICtrlComboBox_ResetContent($hWnd) If Not IsArray($vData) Then $vData = StringSplit($vData, "|") $iCount = $vData[0] _GUICtrlComboBox_BeginUpdate($hWnd) For $i = 1 To $vData[0] _GUICtrlComboBox_InsertString($hWnd, $vData[$i]) Next _GUICtrlComboBox_EndUpdate($hWnd) $avCBA_MSGIDS[$iIndex][2] = $iCount $avCBA_MSGIDS[$iIndex][3] = $vData Return $iCount EndFunc ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GUICtrlComboBox_AutoFillUpdateContent ; Description ...: Update the auto-fill system with the data (items) contained in a comboBox ; Syntax ........: _GUICtrlComboBox_AutoFillUpdateContent($hWnd) ; Parameters ....: $hWnd - Control ID/Handle to the control. ; Return values .: Success - Items count ; Failure - -1 ; Author ........: Matwachich ; Remarks .......: Usefull when you change the data of the comboBox with the default AutoIt functions, and you want to update ; |the auto-fill data ; =============================================================================================================================== Func _GUICtrlComboBox_AutoFillUpdateContent($hWnd) Local $iIndex, $iCount $iIndex = __CBA_GetHWndIndex($hWnd) If Not $iIndex Then Return -1 $aList = _GUICtrlComboBox_GetListArray($hWnd) $iCount = $aList[0] ;----> Update array with the new item! $avCBA_MSGIDS[$iIndex][2] = $iCount $avCBA_MSGIDS[$iIndex][3] = $aList ;<---- Return $iCount EndFunc
    1 point
  3. funkey

    tga files into gui

    I made a DLL out of this code to load targa files to hBitmap. Hope this is useful and works as expected.
    1 point
  4. UEZ

    [SOLVED]Layer mask in GDI+

    Try this: #include <GDIPlus.au3> _GDIPlus_Startup() $hImage=_GDIPlus_ImageLoadFromFile(@ScriptDir & "1.png") $hNewBitmap = _GDIPlus_ImageShapeCircle($hImage, _GDIPlus_ImageGetWidth($hImage) /2) _GDIPlus_ImageSaveToFile($hNewBitmap, @ScriptDir & "2.png") _GDIPlus_ImageDispose($hImage) _GDIPlus_BitmapDispose($hNewBitmap) _GDIPlus_Shutdown() ShellExecute(@ScriptDir & "2.png") Exit Func _GDIPlus_ImageShapeCircle($hBitmap, $iRadius, $iTiling = 4) ;coded by UEZ 2012-12-17 Local $iWidth = $iRadius * 2, $iHeight = $iWidth Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateTexture", "ptr", $hImage, "int", $iTiling, "int*", 0) If @error Then Return SetError(1, 0, 0) Local $hTexture = $aResult[3] $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0) If @error Then Return SetError(2, 0, 0) Local $hImage = $aResult[6] Local $hGfxCtxt = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetSmoothingMode($hGfxCtxt, 2) DllCall($ghGDIPDll, "uint", "GdipSetPixelOffsetMode", "handle", $hGfxCtxt, "int", 2) _GDIPlus_GraphicsFillEllipse($hGfxCtxt, 0, 0, $iWidth, $iHeight, $hTexture) _GDIPlus_BrushDispose($hTexture) _GDIPlus_GraphicsDispose($hGfxCtxt) Return $hImage EndFunc Func _GDIPlus_ImageShapeCircle2($hBitmap, $iRadius, $fDX = 0, $fDY = 0, $iTiling = 4) ;coded by UEZ 2012-12-17 Local $iWidth = $iRadius * 2 If _GDIPlus_ImageGetWidth($hBitmap) < $iWidth Then $iWidth = _GDIPlus_ImageGetWidth($hBitmap) Local $iHeight = $iWidth Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateTexture2", "handle", $hBitmap, "int", $iTiling, "float", $fDX, "float", $fDY, "float", $iWidth, "float", $iHeight, "int*", 0) If @error Then Return SetError(1, 0, 0) Local $hTexture = $aResult[7] $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0) If @error Then Return SetError(2, 0, 0) Local $hImage = $aResult[6] Local $hGfxCtxt = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetSmoothingMode($hGfxCtxt, 2) DllCall($ghGDIPDll, "uint", "GdipSetPixelOffsetMode", "handle", $hGfxCtxt, "int", 2) _GDIPlus_GraphicsFillEllipse($hGfxCtxt, 0, 0, $iWidth, $iHeight, $hTexture) _GDIPlus_BrushDispose($hTexture) _GDIPlus_GraphicsDispose($hGfxCtxt) Return $hImage EndFunc Br, UEZ
    1 point
  5. They are, but it's 'good coding practice' to declare variables in their required scope i.e. Local, Global or Static. Dim should never be used. It's also a habit which I have picked up in the last 2yrs of being active on the Forum.
    1 point
  6. Melba23

    Listview and iniRead

    jazztjeff, I think this should give you the idea: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> Global $sIni_File = @ScriptDir & "\config.ini" $mainForm = GUICreate("Form", 250, 250) $listResSecGrp = GUICtrlCreateListView("SECURITY", 100, 50, 125, 150) ; Set column width to size of ListView, not header - you need a few pixels less or you get a scroll bar! _GUICtrlListView_SetColumnWidth($listResSecGrp, 0, 121) ; Fill the listView _ListView_Fill() GUICtrlCreateLabel("Security Group", 25, 25) $ResSecGrp = GUICtrlCreateInput("", 25, 50, 70, 21) $btnAdd = GUICtrlCreateButton("Add", 25, 100, 75, 25) $btnRemove = GUICtrlCreateButton("Remove", 25, 150, 75, 25) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $btnAdd ; Read the input $ResSecGrp1 = GUICtrlRead($ResSecGrp) ; If there is something to add If $ResSecGrp1 <> "" Then ; Add to the ini file IniWrite($sIni_File, "SECURITY", $ResSecGrp1, $ResSecGrp1) ; Refill the ListView _ListView_Fill() EndIf Case $btnRemove ; Read the selected item - it has a "|" at the end so we need to remove that $selGroup = StringTrimRight(GUICtrlRead(GUICtrlRead($listResSecGrp)), 1) ; As long as something was selected If $selGroup <> "" Then ; Remove from ini file IniDelete($sIni_File, "SECURITY", $selGroup) ; Refill the ListView _ListView_Fill() EndIf EndSwitch WEnd Func _ListView_Fill() ; Clear ListView _GUICtrlListView_DeleteAllItems($listResSecGrp) ; Read ini file Local $config = IniReadSection($sIni_File, "SECURITY") ; Loop through the array and fill the ListView For $i = 1 To $config[0][0] GUICtrlCreateListViewItem($config[$i][0], $listResSecGrp) Next EndFunc ;==>_ListView_Fill If the comments are not clear enough, please ask. M23
    1 point
  7. darbid

    Confirm File Replace

    Thanks - just need to change DllStructSetData($SHFILEOPSTRUCT, "fFlags", $FOF_ALLOWUNDO) to DllStructSetData($SHFILEOPSTRUCT, "fFlags", $FOF_NOCONFIRMATION) and add of course Global Const $FOF_NOCONFIRMATION = 0x0010 ; Respond with "Yes to All" for any dialog box that is displayed. so that you do not get any messages during the copy.
    1 point
  8. Jon

    Change Gui Title

    Any function that works with "title", "text" works with handles. Totally undocumented but when I upgraded the variants to support handles this was a nice side effect. In fact the "handle=" is completely redundant now - it stays only because I need it for AutoItX.
    1 point
×
×
  • Create New...