#NoTrayIcon #RequireAdmin #AutoIt3Wrapper_icon=iSafari.ico #AutoIt3Wrapper_outfile=iSafari.exe #AutoIt3Wrapper_UseUpx=n ;#AutoIt3Wrapper_Change2CUI=y ;Mode VERBOSE #AutoIt3Wrapper_Res_Comment=by DJSIR and The French AutoIt Team #AutoIt3Wrapper_Res_Description=DJSIR, Inc #AutoIt3Wrapper_Res_Fileversion=3.5.1 #AutoIt3Wrapper_Res_LegalCopyright=Creative Commons 3.0 EN (by-nc-sa) #AutoIt3Wrapper_Res_Language=1036 #include #include #include #include #include #include #include #cs ---------------------------------------------------------------------------- Script Name : iSafari 3.5.1 Author : DJSIR Script Function : Script principal d'iSafari, contient le naviguateur et les fonctions principales. #ce ---------------------------------------------------------------------------- Opt("GUIOnEventMode", 1) ConsoleWrite("---------------- iSafari 3.5.1 ----------------" & @CRLF & _ "---------------- [Mode Console] ---------------" & @CRLF) ;Lecture du fichier de Config et Créations de Variables $INI_SKIN = IniRead(@ScriptDir & "\database\configuration.ini", "CFG", "SKIN", "Qute") $THEME = @ScriptDir & "\database\skins\" & $INI_SKIN & ".dll" $INI_HOME = IniRead(@ScriptDir & "\database\configuration.ini", "CFG", "HOME", "http://www.google.fr/") $URLToLaunch = "0" Global $SITE, $TempArray ConsoleWrite(@CRLF & "Apparence: " & $INI_SKIN & @CRLF) ConsoleWrite("Th-me: " & $THEME & @CRLF) ConsoleWrite("Page d'Accueil: " & $INI_HOME & @CRLF) ;Vérification des paramètres (isafari http://djsir.free.fr/) If $CmdLine[0] > 0 Then $URLToLaunch = $CmdLineRaw EndIf If $URLToLaunch <> "0" Then ConsoleWrite("-- Lancé Avec Paramètres --" & @CRLF) If $URLToLaunch <> "0" Then ConsoleWrite("URL: " & $URLToLaunch & @CRLF) $GUI = GUICreate("iSafari", 800, 640, -1, -1, $WS_MAXIMIZEBOX + $WS_MINIMIZEBOX + $WS_SIZEBOX) GUISetBkColor(0xFFFFFF) ;Menu $FILE = GUICtrlCreateMenu("&Fichier") GUICtrlCreateMenuItem("No&uvelle fenêtre", $FILE) GUICtrlSetOnEvent(-1, "_RUN") GUICtrlCreateMenuItem("Ouvrir une &adresse..." & @TAB & "Ctrl+L", $FILE) GUICtrlSetOnEvent(-1, "_ND") GUICtrlCreateMenuItem("&Ouvrir un fichier..." & @TAB & "Ctrl+O", $FILE) GUICtrlSetOnEvent(-1, "_OPEN_WEB") GUICtrlCreateMenuItem("Fe&rmer la fenêtre" & @TAB & "Ctrl+Maj+W", $FILE) GUICtrlSetOnEvent(-1, "_EXIT") GUICtrlCreateMenuItem("", $FILE) GUICtrlCreateMenuItem("Copier l'URL dans le presse papier", $FILE) GUICtrlSetOnEvent(-1, "_CLIP_URL") GUICtrlCreateMenuItem("&Enregistrer sous" & @TAB & "Ctrl+S", $FILE) GUICtrlSetOnEvent(-1, "_SAVE") GUICtrlCreateMenuItem("", $FILE) GUICtrlCreateMenuItem("&Mise en page...", $FILE) GUICtrlSetOnEvent(-1, "_ND") GUICtrlCreateMenuItem("Aperçu a&vant impression", $FILE) GUICtrlSetOnEvent(-1, "_ND") GUICtrlCreateMenuItem("Im&primer..." & @TAB & "Ctrl+P", $FILE) GUICtrlSetOnEvent(-1, "_PRINT") GUICtrlCreateMenuItem("Imp&ression rapide", $FILE) GUICtrlSetOnEvent(-1, "__PRINT") GUICtrlCreateMenuItem("", $FILE) GUICtrlCreateMenuItem("&Quitter" & @TAB & "Alt+F4", $FILE) GUICtrlSetOnEvent(-1, "_EXIT") $HISTORY = GUICtrlCreateMenu("&Historique") GUICtrlCreateMenuItem("Page précédente" & @TAB & "Alt+Flèche gauche", $HISTORY) GUICtrlSetOnEvent(-1, "_BACK") GUICtrlCreateMenuItem("Page suivante" & @TAB & "Alt+Flèche droite", $HISTORY) GUICtrlSetOnEvent(-1, "_NEXT") GUICtrlCreateMenuItem("Accueil" & @TAB & "Alt+Origine", $HISTORY) GUICtrlSetOnEvent(-1, "_START") GUICtrlCreateMenuItem("", $HISTORY) GUICtrlCreateMenuItem("Afficher l'historique" & @TAB & "Ctrl+Maj+H", $HISTORY) GUICtrlSetOnEvent(-1, "_ND") GUICtrlCreateMenuItem("Supprimer l'historique du jour", $HISTORY) GUICtrlSetOnEvent(-1, "_ND") GUICtrlCreateMenuItem("Supprimer l'historique", $HISTORY) GUICtrlSetOnEvent(-1, "_ND") $BOOKMARKS = GUICtrlCreateMenu("&Marque-pages") GUICtrlCreateMenuItem("Marquer cette page" & @TAB & "Ctrl+D", $BOOKMARKS) GUICtrlSetOnEvent(-1, "_F_Add") GUICtrlCreateMenuItem("Afficher les Marque-Pages..." & @TAB & "Ctrl+Maj+B", $BOOKMARKS) GUICtrlSetOnEvent(-1, "_F_Display") $TOOLS = GUICtrlCreateMenu("&Outils") GUICtrlCreateMenuItem("&Options...", $TOOLS) GUICtrlSetOnEvent(-1, "_ND") $HELP = GUICtrlCreateMenu("&?") GUICtrlCreateMenuItem("Rubriques d'&aide" & @TAB & "F1", $HELP) GUICtrlSetOnEvent(-1, "_ND") GUICtrlCreateMenuItem("&Signaler...", $HELP) GUICtrlSetOnEvent(-1, "_ND") GUICtrlCreateMenuItem("", $HELP) GUICtrlCreateMenuItem("Rec&hercher des mises à jour...", $HELP) GUICtrlSetOnEvent(-1, "_ND") GUICtrlCreateMenuItem("", $HELP) GUICtrlCreateMenuItem("A &propos de iSafari", $HELP) GUICtrlSetOnEvent(-1, "About") ;Définition du Header ;Creation d'un Tableau pour les Images (4 Lignes) Dim $Button[11] For $i = 1 To 10 $Button[$i] = GUICtrlCreatePic("", 0, 0, 0, 0) Next ;Créations des Groupes (entourage) et Ajout des Pics de la DLL Dim $Group[11] $Group[1] = GUICtrlCreateGroup("", 5, 0, 30, 35) SetBitmapResourceToPicCtrl($GUI, $Button[1], 8, 8, 24, 24, $THEME, "101_BMP", "str") GUICtrlSetCursor($Button[1], 0) GUICtrlSetTip($Button[1], "Reculer d'une Page") GUICtrlSetOnEvent($Button[1], "_BACK") $Group[2] = GUICtrlCreateGroup("", 40, 0, 30, 35) SetBitmapResourceToPicCtrl($GUI, $Button[2], 43, 8, 24, 24, $THEME, "102_BMP", "str") GUICtrlSetCursor($Button[2], 0) GUICtrlSetTip($Button[2], "Avancer d'une Page") GUICtrlSetOnEvent($Button[2], "_NEXT") $Group[3] = GUICtrlCreateGroup("", 75, 0, 30, 35) SetBitmapResourceToPicCtrl($GUI, $Button[3], 78, 8, 24, 24, $THEME, "103_BMP", "str") GUICtrlSetCursor($Button[3], 0) GUICtrlSetTip($Button[3], "Arrêter le Chargement de la Page") GUICtrlSetOnEvent($Button[3], "_STOP") $Group[4] = GUICtrlCreateGroup("", 110, 0, 30, 35) SetBitmapResourceToPicCtrl($GUI, $Button[4], 113, 8, 24, 24, $THEME, "104_BMP", "str") GUICtrlSetCursor($Button[4], 0) GUICtrlSetTip($Button[4], "Actualiser la Page Courante") GUICtrlSetOnEvent($Button[4], "_REFRESH") $Group[5] = GUICtrlCreateGroup("", 145, 0, 30, 35) SetBitmapResourceToPicCtrl($GUI, $Button[5], 148, 8, 24, 24, $THEME, "105_BMP", "str") GUICtrlSetCursor($Button[5], 0) GUICtrlSetTip($Button[5], "Retourner sur la Page d'Accueil") GUICtrlSetOnEvent($Button[5], "_START") $Group[6] = GUICtrlCreateGroup("", 180, 0, 30, 35) SetBitmapResourceToPicCtrl($GUI, $Button[6], 183, 8, 24, 24, $THEME, "106_BMP", "str") GUICtrlSetCursor($Button[6], 0) GUICtrlSetTip($Button[6], "Afficher les Pages Marqués") GUICtrlSetOnEvent($Button[6], "_F_Display") $Group[7] = GUICtrlCreateGroup("", 215, 0, 30, 35) SetBitmapResourceToPicCtrl($GUI, $Button[7], 218, 8, 24, 24, $THEME, "107_BMP", "str") GUICtrlSetCursor($Button[7], 0) GUICtrlSetTip($Button[7], "Afficher l'Historique") ;~ GUICtrlSetOnEvent($Button[7], "_") $Group[8] = GUICtrlCreateGroup("", 250, 0, 30, 35) SetBitmapResourceToPicCtrl($GUI, $Button[8], 253, 8, 24, 24, $THEME, "108_BMP", "str") GUICtrlSetCursor($Button[8], 0) GUICtrlSetTip($Button[8], "Imprimer la Page Courante") GUICtrlSetOnEvent($Button[8], "_PRINT") $Group[9] = GUICtrlCreateGroup("", 285, 0, 30, 35) SetBitmapResourceToPicCtrl($GUI, $Button[9], 288, 8, 24, 24, $THEME, "109_BMP", "str") GUICtrlSetCursor($Button[9], 0) GUICtrlSetTip($Button[9], "Nouvelle Fenêtre") GUICtrlSetOnEvent($Button[9], "_RUN") $Adresse = GUICtrlCreateInput("", 321, 8, 439, 24) GUICtrlSetFont(-1, 10, -1, -1, "Tahoma") $Group[10] = GUICtrlCreateGroup("", 765, 0, 30, 35) SetBitmapResourceToPicCtrl($GUI, $Button[10], 768, 8, 24, 24, $THEME, "102_BMP", "str") GUICtrlSetCursor($Button[10], 0) GUICtrlSetTip($Button[10], "Valider l'Adresse") GUICtrlSetOnEvent($Button[10], "_LOAD") $IE = _IECreateEmbedded() $IE_OBJ = GUICtrlCreateObj($IE, 5, 40, 790, 528) ObjEvent($IE, "IEEvent_", "DWebBrowserEvents") ;Définition du Footer (StatusBar) $GroupFinal = GUICtrlCreateGroup("", 5, 566, 790, 30) $Statut = GUICtrlCreateLabel("", 10, 576, 550, 15) $ProgressPage = GUICtrlCreateProgress(640, 576, 150, 15, $PBS_SMOOTH) ;Informations sur le Redimentionnement GUICtrlSetResizing($IE_OBJ, $GUI_DOCKAUTO + $GUI_DOCKBOTTOM + $GUI_DOCKTOP) GUICtrlSetResizing($Adresse, $GUI_DOCKRIGHT + $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT) GUICtrlSetResizing($Button[10], $GUI_DOCKRIGHT + $GUI_DOCKSIZE + $GUI_DOCKTOP) GUICtrlSetResizing($Group[10], $GUI_DOCKRIGHT + $GUI_DOCKSIZE + $GUI_DOCKTOP) GUICtrlSetResizing($Statut, $GUI_DOCKLEFT + $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT) GUICtrlSetResizing($GroupFinal, $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKHEIGHT) GUICtrlSetResizing($ProgressPage, $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT) For $i = 1 To 9 GUICtrlSetResizing($Button[$i], $GUI_DOCKALL) GUICtrlSetResizing($Group[$i], $GUI_DOCKALL) Next GUISetOnEvent($GUI_EVENT_CLOSE, "_EXIT") GUISetState(@SW_SHOW) ;Recherche d'un URL à lancer (paramètre) If $URLToLaunch = "0" Then _START() If $URLToLaunch <> "0" Then _IENavigate($IE, $URLToLaunch, 0) While 1 Sleep(50) WEnd #Region Fonctions #Region Basiques Func _RUN() ;Permet d'Ouvrir une Nouvelle Fenêtre If @Compiled Then Run(@ScriptDir & "\iSafari.exe", @ScriptDir) EndFunc ;==>_RUN Func _START() ;Charge la Page d'Accueil _IENavigate($IE, $INI_HOME, 0) EndFunc ;==>_START Func _LOAD() ;Charge l'URL dans la Barre d'Adresses _IENavigate($IE, GUICtrlRead($Adresse), 0) EndFunc ;==>_LOAD Func _BACK() ;Recule d'une Page _IEAction($IE, "back") EndFunc ;==>_BACK Func _NEXT() ;Avance d'une Page _IEAction($IE, "forward") EndFunc ;==>_NEXT Func _STOP() ;Arrète le chargement de la page _IEAction($IE, "stop") EndFunc ;==>_STOP Func _REFRESH() ;Rafraichissement de la page _IEAction($IE, "refresh") EndFunc ;==>_REFRESH Func _OPEN_WEB() ;Ouvrir une page HTML puis naviguer dessus avec iSafari $OPENED_FILE = FileOpenDialog("Ouvrir un fichier", @MyDocumentsDir, "Fichier HTML (*.html;*.htm)|Autres (*.*)") If Not @error Then _IENavigate($IE, $OPENED_FILE, 0) EndIf EndFunc ;==>_OPEN_WEB Func _AUTOIT() ;Topic Officiel _IENavigate($IE, "http://www.autoitscript.fr/forum/viewtopic.php?t=1633", 0) EndFunc ;==>_AUTOIT Func _SAVE() ;Enregistrer la page _IEAction($IE, "saveas") EndFunc ;==>_SAVE Func _PRINT() ;Imprimer la page _IEAction($IE, "print") EndFunc ;==>_PRINT Func __PRINT() ;Imprimer la page sans paramètres (impression rapide dans Word 2007) _IEAction($IE, "printdefault") EndFunc ;==>__PRINT Func _CLIP_URL() ;Copier l'URL dans le Presse Papier ClipPut(_IEPropertyGet($IE, "locationurl")) EndFunc ;==>_CLIP_URL Func _EXIT() ;Quitter iSafari Exit EndFunc ;==>_EXIT Func _ND() ;Fonction non disponible. MsgBox(16, "iSafari", "Cette fonction n'est pas disponible.") EndFunc ;==>_ND Func About() ;About MsgBox(32, "iSafari", "iSafari 3.5.1" & @CRLF & "by DJSIR and The French AutoIt Team" & @CRLF & @CRLF & "Creative Commons 3.0 En-US (by-nc-sa)") EndFunc ;==>About #EndRegion Basiques #Region Events et Autres Func SetBitmapResourceToPicCtrl($hwnd, $ctrl, $posw, $posh, $picw, $pich, $FILE, $resource, $type = "int") Local Const $STM_SETIMAGE = 0x0172 Local Const $IMAGE_BITMAP = 0 Local Const $LR_CREATEDIBSECTION = 0x2000 Local Const $LR_COPYDELETEORG = 8 $hwnd = ControlGetHandle($hwnd, "", $ctrl) Local $DLLinst = DllCall("kernel32.dll", "hwnd", "LoadLibrary", $type, $FILE) $DLLinst = $DLLinst[0] Local $hBitmap = DllCall("user32.dll", "hwnd", "LoadImage", "hwnd", $DLLinst, "str", $resource, _ "int", $IMAGE_BITMAP, "int", 0, "int", 0, "int", 0) $hBitmap = $hBitmap[0] DeleteObject(_SendMessage($hwnd, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap, 0, "int", "int", "hwnd")) DllCall("kernel32.dll", "int", "FreeLibrary", "hwnd", $DLLinst) GUICtrlSetPos($ctrl, $posw, $posh, $picw, $pich) EndFunc ;==>SetBitmapResourceToPicCtrl Func DeleteObject($hObj) Local $bResult = DllCall('gdi32.dll', 'int', 'DeleteObject', _ 'hwnd', $hObj) Return $bResult[0] EndFunc ;==>DeleteObject Func IEEvent_ProgressChange($PROGRESS, $PROGRESS_MAX) If $PROGRESS_MAX > 0 Then GUICtrlSetData($ProgressPage, ($PROGRESS * 100) / $PROGRESS_MAX) EndIf EndFunc ;==>IEEvent_ProgressChange Func IEEvent_StatusTextChange($TEXT) GUICtrlSetData($Statut, $TEXT) EndFunc ;==>IEEvent_StatusTextChange Func IEEvent_NavigateComplete($URL) GUICtrlSetData($Adresse, $URL) WinSetTitle($GUI, "", _IEPropertyGet($IE, "title") & " - iSafari") EndFunc ;==>IEEvent_NavigateComplete Func ArrayDisplay(Const ByRef $avArray, $sTitle = "Array: ListView Display", $iItemLimit = -1, $iTranspose = 0, $sSeparator = "", $sReplace = "|") If Not IsArray($avArray) Then Return SetError(1, 0, 0) Local $iDimension = UBound($avArray, 0), $iUBound = UBound($avArray, 1) - 1, $iSubMax = UBound($avArray, 2) - 1 If $iDimension > 2 Then Return SetError(2, 0, 0) If $iUBound < 1 Then Return SetError(1, 0, 0) If $sSeparator = "" Then $sSeparator = Chr(124) Local $i, $j, $vTmp, $aItem, $avArrayText, $sHeader = "Nombre", $iBuffer = 64 Local $iColLimit = 250, $iLVIAddUDFThreshold = 4000, $iWidth = 640, $iHeight = 480 Local $iOnEventMode = Opt("GUIOnEventMode", 0), $sDataSeparatorChar = Opt("GUIDataSeparatorChar", $sSeparator) If $iSubMax < 0 Then $iSubMax = 0 If $iTranspose Then $vTmp = $iUBound $iUBound = $iSubMax $iSubMax = $vTmp EndIf If $iSubMax > $iColLimit Then $iSubMax = $iColLimit If $iItemLimit = 1 Then $iItemLimit = $iLVIAddUDFThreshold If $iItemLimit < 1 Then $iItemLimit = $iUBound If $iUBound > $iItemLimit Then $iUBound = $iItemLimit If $iLVIAddUDFThreshold > $iUBound Then $iLVIAddUDFThreshold = $iUBound $sHeader = $sSeparator & "Nom" & $sSeparator & "Adresse" Local $avArrayText[$iUBound + 1] For $i = 0 To $iUBound $avArrayText[$i] = "[" & $i & "]" For $j = 0 To $iSubMax If $iDimension = 1 Then If $iTranspose Then $vTmp = $avArray[$j] Else $vTmp = $avArray[$i] EndIf Else If $iTranspose Then $vTmp = $avArray[$j][$i] Else $vTmp = $avArray[$i][$j] EndIf EndIf $vTmp = StringReplace($vTmp, $sSeparator, $sReplace, 0, 1) $avArrayText[$i] &= $sSeparator & $vTmp $vTmp = StringLen($vTmp) If $vTmp > $iBuffer Then $iBuffer = $vTmp Next Next $iBuffer += 1 Local Const $_ARRAYCONSTANT_GUI_DOCKBORDERS = 0x66 Local Const $_ARRAYCONSTANT_GUI_DOCKBOTTOM = 0x40 Local Const $_ARRAYCONSTANT_GUI_DOCKHEIGHT = 0x0200 Local Const $_ARRAYCONSTANT_GUI_DOCKLEFT = 0x2 Local Const $_ARRAYCONSTANT_GUI_DOCKRIGHT = 0x4 Local Const $_ARRAYCONSTANT_GUI_EVENT_CLOSE = -3 Local Const $_ARRAYCONSTANT_LVIF_PARAM = 0x4 Local Const $_ARRAYCONSTANT_LVIF_TEXT = 0x1 Local Const $_ARRAYCONSTANT_LVM_GETCOLUMNWIDTH = (0x1000 + 29) Local Const $_ARRAYCONSTANT_LVM_GETITEMCOUNT = (0x1000 + 4) Local Const $_ARRAYCONSTANT_LVM_GETITEMSTATE = (0x1000 + 44) Local Const $_ARRAYCONSTANT_LVM_INSERTITEMA = (0x1000 + 7) Local Const $_ARRAYCONSTANT_LVM_SETEXTENDEDLISTVIEWSTYLE = (0x1000 + 54) Local Const $_ARRAYCONSTANT_LVM_SETITEMA = (0x1000 + 6) Local Const $_ARRAYCONSTANT_LVS_EX_FULLROWSELECT = 0x20 Local Const $_ARRAYCONSTANT_LVS_EX_GRIDLINES = 0x1 Local Const $_ARRAYCONSTANT_LVS_SHOWSELALWAYS = 0x8 Local Const $_ARRAYCONSTANT_WS_EX_CLIENTEDGE = 0x0200 Local Const $_ARRAYCONSTANT_WS_MAXIMIZEBOX = 0x00010000 Local Const $_ARRAYCONSTANT_WS_MINIMIZEBOX = 0x00020000 Local Const $_ARRAYCONSTANT_WS_SIZEBOX = 0x00040000 Local Const $_ARRAYCONSTANT_tagLVITEM = "int Mask;int Item;int SubItem;int State;int StateMask;ptr Text;int TextMax;int Image;int Param;int Indent;int GroupID;int Columns;ptr pColumns" Local $iAddMask = BitOR($_ARRAYCONSTANT_LVIF_TEXT, $_ARRAYCONSTANT_LVIF_PARAM) Local $tBuffer = DllStructCreate("char Text[" & $iBuffer & "]"), $pBuffer = DllStructGetPtr($tBuffer) Local $tItem = DllStructCreate($_ARRAYCONSTANT_tagLVITEM), $pItem = DllStructGetPtr($tItem) DllStructSetData($tItem, "Param", 0) DllStructSetData($tItem, "Text", $pBuffer) DllStructSetData($tItem, "TextMax", $iBuffer) Local $hGUI = GUICreate($sTitle, $iWidth, $iHeight, Default, Default, BitOR($_ARRAYCONSTANT_WS_SIZEBOX, $_ARRAYCONSTANT_WS_MINIMIZEBOX, $_ARRAYCONSTANT_WS_MAXIMIZEBOX)) Local $aiGUISize = WinGetClientSize($hGUI) Local $hListView = GUICtrlCreateListView($sHeader, 0, 0, $aiGUISize[0], $aiGUISize[1] - 26, $_ARRAYCONSTANT_LVS_SHOWSELALWAYS) Local $hCopy = GUICtrlCreateButton("Naviguer vers le favori sélectionné", 3, $aiGUISize[1] - 23, $aiGUISize[0] - 6, 20) GUICtrlSetResizing($hListView, $_ARRAYCONSTANT_GUI_DOCKBORDERS) GUICtrlSetResizing($hCopy, $_ARRAYCONSTANT_GUI_DOCKLEFT + $_ARRAYCONSTANT_GUI_DOCKRIGHT + $_ARRAYCONSTANT_GUI_DOCKBOTTOM + $_ARRAYCONSTANT_GUI_DOCKHEIGHT) GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_SETEXTENDEDLISTVIEWSTYLE, $_ARRAYCONSTANT_LVS_EX_GRIDLINES, $_ARRAYCONSTANT_LVS_EX_GRIDLINES) GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_SETEXTENDEDLISTVIEWSTYLE, $_ARRAYCONSTANT_LVS_EX_FULLROWSELECT, $_ARRAYCONSTANT_LVS_EX_FULLROWSELECT) GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_SETEXTENDEDLISTVIEWSTYLE, $_ARRAYCONSTANT_WS_EX_CLIENTEDGE, $_ARRAYCONSTANT_WS_EX_CLIENTEDGE) For $i = 0 To $iLVIAddUDFThreshold GUICtrlCreateListViewItem($avArrayText[$i], $hListView) Next For $i = ($iLVIAddUDFThreshold + 1) To $iUBound $aItem = StringSplit($avArrayText[$i], $sSeparator) DllStructSetData($tBuffer, "Text", $aItem[1]) DllStructSetData($tItem, "Item", $i) DllStructSetData($tItem, "SubItem", 0) DllStructSetData($tItem, "Mask", $iAddMask) GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_INSERTITEMA, 0, $pItem) DllStructSetData($tItem, "Mask", $_ARRAYCONSTANT_LVIF_TEXT) For $j = 2 To $aItem[0] DllStructSetData($tBuffer, "Text", $aItem[$j]) DllStructSetData($tItem, "SubItem", $j - 1) GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_SETITEMA, 0, $pItem) Next Next $iWidth = 0 For $i = 0 To $iSubMax + 1 $iWidth += GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_GETCOLUMNWIDTH, $i, 0) Next If $iWidth < 250 Then $iWidth = 230 WinMove($hGUI, "", Default, Default, $iWidth + 20) GUISetState(@SW_SHOW, $hGUI) $nMsg = GUIGetMsg() While $nMsg <> $_ARRAYCONSTANT_GUI_EVENT_CLOSE $nMsg = GUIGetMsg() If $nMsg = $hCopy Then Local $sClip = "" Local $aiCurItems[1] = [0] For $i = 0 To GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_GETITEMCOUNT, 0, 0) If GUICtrlSendMsg($hListView, $_ARRAYCONSTANT_LVM_GETITEMSTATE, $i, 0x2) Then $aiCurItems[0] += 1 ReDim $aiCurItems[$aiCurItems[0] + 1] $aiCurItems[$aiCurItems[0]] = $i EndIf Next If Not $aiCurItems[0] Then For $sItem In $avArrayText $sClip &= $sItem & @CRLF Next Else For $i = 1 To UBound($aiCurItems) - 1 $sClip &= $avArrayText[$aiCurItems[$i]] & @CRLF Next EndIf GUIDelete($hGUI) Opt("GUIOnEventMode", $iOnEventMode) Opt("GUIDataSeparatorChar", $sDataSeparatorChar) Return ($sClip) EndIf Sleep(10) WEnd GUIDelete($hGUI) Opt("GUIOnEventMode", $iOnEventMode) Opt("GUIDataSeparatorChar", $sDataSeparatorChar) Return 1 EndFunc ;==>ArrayDisplay #EndRegion Events et Autres #Region Favoris Func _F_Add($SITE = "") If $SITE = "" Then $SITE = _IEPropertyGet($IE, "locationurl") IniWrite(@ScriptDir & "\database\favoris.ini", "FAVORIS", _IEPropertyGet($IE, "title"), $SITE) MsgBox(64, "iSafari", "Ce site à été ajouté dans les Marques-Pages.") EndFunc ;==>_F_Add Func _F_Display() $avArray = IniReadSection(@ScriptDir & "\database\favoris.ini", "Favoris") $SITE = ArrayDisplay($avArray, "Marques-Pages") If @error Then MsgBox(16, 'iSafari', "Il n'y a Aucun Favori à Afficher") ElseIf $SITE <> 1 Then $TempArray = StringSplit($SITE, "|") $SITE = $TempArray[3] _IENavigate($IE, $SITE, 0) EndIf EndFunc ;==>_F_Display #EndRegion Favoris #EndRegion Fonctions