Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/05/2012 in all areas

  1. That's a lovely story, just needs more dragons and details.
    2 points
  2. AZJIO

    Icon_of_folder

    Icon_of_folder Change folder icon screenshot Icon_of_folder.7z (350kb sources + EXE)
    1 point
  3. Alt+F6 is only available when the full SciTE version is loaded.
    1 point
  4. souldjer777, I would do it like this: While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case Else For $i = 1 To UBound($sites_array1) - 1 If $msg = $Button[$i] Then MsgBox(0, "Pressed", GUICtrlRead($Button[$i])) ExitLoop EndIf Next EndSelect WEnd Please ask if you have any questions. M23
    1 point
  5. @SmOke_N I work on it. It's ok for _ExcludeFileSet. For excluding files, we must give the parameters like this -x!*.mp3 -x!*.avi We can easily modify _ExcludeFileSet and _ExcludeArcSet function to do it. Func _ExcludeFileSet($sVal) If StringInStr($sVal, ";") Then Local $aVal = StringSplit($sVal, ";") $sVal = "" For $i = 1 to UBound($aVal) - 1 $sVal &= ' -x!"' & $aVal[$i] & '"' Next Return $sVal ElseIf StringInStr($sVal, "*") Then Return ' -x!"' & $sVal & '"' ElseIf StringLeft($sVal, 1) = "@" Then Return ' -x"' & $sVal & '"' Else Return ' -x!"' & $sVal & '"' EndIf EndFunc ;==>_ExcludeFileSet But for including files, it's not so easy, If I do the same thing for _IncludeFileSet, the result is really surprising !!! So actually I search what syntax to use, but I think that we must include the path (not sure). ^^ -i!$SearchPath*.mp3 -i!$SearchPath*.avi instead of -i!*.mp3 -i!*.avi I will make search later on the journey. Edit : After some testing, it seems that if you want to include multiple files, you must specify the path. Also, I have made try with fileset, and it's the same problem. If I use -i!*.mp3 -i!*.avi, the first parameter consider the search path, but not the second parameter! Perhaps it's due to this dll ! In original documentation, we can read that multiple include switches are supported, but they don't explain how it must be used in multiple include...
    1 point
  6. Sometimes things come to life if you dissect the function you're utilizing, then follow it to the functions that it utilizes until you find the function that does what it is you're looking for. In this case, ( no idea if it works ), I'd assume by following my own logic, that their is no set option provided to do more than 1 switch to exclude. So maybe make your own sub function from the add function: Func __7ZipAddEx($hWnd, $sArcName, $sFileName, $sHide = 0, $sCompress = 5, $sRecurse = 1, $sIncludeFile = 0, $sExcludeFile = 0, _ $sPassword = 0, $sSFX = 0, $sVolume = 0, $sWorkDir = 0) $sArcName = '"' & $sArcName & '"' $sFileName = '"' & $sFileName & '"' Local $iSwitch = "" If $sHide Then $iSwitch &= " -hide" $iSwitch &= " -mx" & $sCompress $iSwitch &= _RecursionSet($sRecurse) ; ## change made here to allow multiple switches for exclude and include Local $a_switch = 0 If $sIncludeFile Then $a_switch = StringSplit($sIncludeFile, ";", 2) For $i = 0 To UBound($a_switch) - 1 $iSwitch &= _IncludeFileSet($a_switch[$i]) Next EndIf If $sExcludeFile Then $a_switch = StringSplit($sExcludeFile, ";", 2) For $i = 0 To UBound($a_switch) - 1 $iSwitch &= _ExcludeFileSet($a_switch[$i]) Next EndIf If $sPassword Then $iSwitch &= " -p" & $sPassword If FileExists($sSFX) Then $iSwitch &= " -sfx" & $sSFX If $sVolume Then $iSwitch &= " -v" & $sVolume If $sWorkDir Then $iSwitch &= " -w" & $sWorkDir Local $tOutBuffer = DllStructCreate("char[32768]") Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZip", _ "hwnd", $hWnd, _ "str", "a " & $sArcName & " " & $sFileName & " " & $iSwitch, _ "ptr", DllStructGetPtr($tOutBuffer), _ "int", DllStructGetSize($tOutBuffer)) If Not $aRet[0] Then Return SetError(0, 0, DllStructGetData($tOutBuffer, 1)) Return SetError(1, 0, 0) EndFunc Try using that func instead of the main _7zipAdd() func. And for exclude separate by semi colons like you tried before. FYI Edit: It would probably be smarter to just edit the _Include/_Exclude(fileset) functions directly rather than mess with each function
    1 point
  7. VB Scripts cannot be run as administrator very easily. You'd have to invoke the script interpreter with administrator privileges instead.
    1 point
  8. I made a forum search and... ! I found something. oh you didn't, right?
    1 point
  9. This example returns 14 and 0: ConsoleWrite(StringInStr("Test with an Ü (german u umlaut)", "ü", 0) & @LF) ConsoleWrite(StringInStr("Test with an Ü (german u umlaut)", "ü", 2) & @LF)So there is no difference for plain english but for languages with umlaut, accented characters etc.
    1 point
  10. jmon, If you use custom drawn tabs and the WM_DRAWITEM event to position the labels, you will not have any problems with reordering of the tabs. The WM_DRAWITEM event fires after the reordering. The example below looks and works fine (Win XP), but custom drawn tabs doesn't look exactly like system drawn. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StructureConstants.au3> #include <GuiTab.au3> Global Const $ODT_TAB = 101 Global Const $ODA_DRAWENTIRE = 0x1 Global Const $ODS_SELECTED = 0x0001 Opt( "MustDeclareVars", 1 ) Global $hGui, $idTab, $hTab, $aPos MainScript() Func MainScript() $hGui = GUICreate("Test", 500, 500) $idTab = GUICtrlCreateTab(50, 50, 400, 296, $TCS_OWNERDRAWFIXED) $hTab = GUICtrlGetHandle($idTab) _GUICtrlTab_SetMinTabWidth($hTab, 100) $aPos = ControlGetPos($hGui, '', $idTab) GUIRegisterMsg($WM_DRAWITEM, "WM_DRAWITEM") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState() _GUICtrlTab_InsertItem($hTab, 0, "Tab 0") _GUICtrlTab_InsertItem($hTab, 1, "Tab 1") _GUICtrlTab_InsertItem($hTab, 2, "Tab 2") _GUICtrlTab_InsertItem($hTab, 3, "Tab 3") _GUICtrlTab_InsertItem($hTab, 4, "Tab 4") _GUICtrlTab_InsertItem($hTab, 5, "Tab 5") _GUICtrlTab_InsertItem($hTab, 6, "Tab 6") _GUICtrlTab_InsertItem($hTab, 7, "Tab 7") _GUICtrlTab_InsertItem($hTab, 8, "Tab 8") _GUICtrlTab_InsertItem($hTab, 9, "Tab 9") TabHighlight(1, 0xFFFF00) ; tab 1 yellow TabHighlight(4, 0x00FF00) ; tab 4 green TabHighlight(5, 0x0000FF) ; tab 5 blue ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc Func TabHighlight($iTab, $iColor) Local $aDisRect, $aRect, $iCtrl $aDisRect = _GUICtrlTab_GetDisplayRect($hTab) $aRect = _GUICtrlTab_GetItemRect($hTab, $iTab) $iCtrl = GUICtrlCreateLabel("", $aRect[0], $aRect[1], $aRect[2]-$aRect[0]-2, 2) GUICtrlSetBkColor($iCtrl, $iColor) If $aRect[0] < $aDisRect[2] Then GUICtrlSetPos($iCtrl, $aPos[0] + $aRect[0], $aPos[1] + $aRect[1]) GUICtrlSetState($iCtrl, $GUI_ONTOP + $GUI_SHOW + $GUI_ENABLE) Else GUICtrlSetState($iCtrl, $GUI_HIDE + $GUI_DISABLE) EndIf _GUICtrlTab_SetItemParam($hTab, $iTab, $iCtrl) EndFunc Func TabRemoveHighlight() Local $iCount = _GUICtrlTab_GetItemCount($hTab), $iCtrl For $i = 0 To $iCount - 1 $iCtrl = _GUICtrlTab_GetItemParam($hTab, $i) If $iCtrl = 0 Then ContinueLoop GUICtrlSetState($iCtrl, $GUI_HIDE + $GUI_DISABLE) Next EndFunc Func WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Local $hWndFrom = DllStructGetData($tNMHDR, 1) Local $Event = DllStructGetData($tNMHDR, 3) ;Appearently this event (-722) is triggered when the user clicks the up-down on the tabs If $Event = -722 Then TabRemoveHighlight() Return 1 EndIf Switch $hWndFrom Case $hTab Switch $Event Case $TCN_SELCHANGE Local $iItem = _GUICtrlTab_GetCurFocus(GUICtrlGetHandle($hTab)) If $iItem <> -1 Then TabRemoveHighlight() EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Func WM_DRAWITEM($hWnd, $Msg, $wParam, $lParam) Local $tDRAWITEMSTRUCT = DllStructCreate("uint cType;uint cID;uint itmID;uint itmAction;uint itmState;" & _ "hwnd hItm;hwnd hDC;dword itmRect[4];dword itmData", $lParam) If DllStructGetData($tDRAWITEMSTRUCT, "cType") <> $ODT_TAB Then Return $GUI_RUNDEFMSG If DllStructGetData($tDRAWITEMSTRUCT, "itmAction") <> $ODA_DRAWENTIRE Then Return $GUI_RUNDEFMSG Local $itmID = DllStructGetData($tDRAWITEMSTRUCT, "itmID") Local $iCtrl = _GUICtrlTab_GetItemParam($hTab, $itmID) If $iCtrl Then Local $aRect = _GUICtrlTab_GetItemRect($hTab, $itmID) If $aRect[0] > 0 Then GUICtrlSetPos($iCtrl, $aPos[0] + $aRect[0], $aPos[1] + $aRect[1]) GUICtrlSetState($iCtrl, $GUI_ONTOP + $GUI_SHOW + $GUI_ENABLE) EndIf EndIf Local $tBuffer = DllStructCreate("char[256]") DllStructSetData($tBuffer, 1, "Tab " & $itmID) Local $itmText = DllStructGetData($tBuffer, 1) DllStructSetData($tDRAWITEMSTRUCT, "itmRect", DllStructGetData($tDRAWITEMSTRUCT, "itmRect", 1) + 4, 1) DllStructSetData($tDRAWITEMSTRUCT, "itmRect", DllStructGetData($tDRAWITEMSTRUCT, "itmRect", 2) + 4, 2) Local $hDC = DllStructGetData($tDRAWITEMSTRUCT, "hDC") If DllStructGetData($tDRAWITEMSTRUCT, "itmState") = $ODS_SELECTED Then _WinAPI_SetTextColor($hDC, 0x0000FF) ; Red, BGR Else _WinAPI_SetTextColor($hDC, 0x000000) EndIf DllCall("user32.dll", "int", "DrawText", "hwnd", $hDC, "str", $itmText, "int", StringLen($itmText), _ "ptr", DllStructGetPtr($tDRAWITEMSTRUCT, "itmRect"), "int", $DT_LEFT) Return $GUI_RUNDEFMSG EndFunc Lars
    1 point
  11. what you are doing is very complicated try to draw, paint labels and use them to switch your tab
    1 point
  12. Works when opt('MustDeclareVars',0) thnx for giving me this idea, would use it next time for making any UDF
    1 point
  13. stev379, It is almost certainly by design, but as we do not permit discussion of login methods here I am closing the thread anyway. M23
    1 point
×
×
  • Create New...