insignia96 Posted June 14, 2009 Share Posted June 14, 2009 (edited) okay, when i set the GUIGetMsg Parameter in my script to 1 it says that the vaiable isnt an array and exits. I use this parameter all the time and its never done this. I cant duplicate this ! I dont know why but it only does it in this script! Edited June 14, 2009 by insignia96 Visit my website to see all my finished releases!Releases here:UDFs:GUI ResizingColor List (Web Colors)GUIFade_NearestPower Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 14, 2009 Moderators Share Posted June 14, 2009 insignia96, So post the script - how else are we supposed to see what might be wrong? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
insignia96 Posted June 14, 2009 Author Share Posted June 14, 2009 expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=I:\Earth.ico #AutoIt3Wrapper_Outfile=MMOwned Web Browser.exe #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_Comment=A custom web browser made just for MMOwned by Insignia96. #AutoIt3Wrapper_Res_Description=by Insignia96 #AutoIt3Wrapper_Res_Fileversion=0.5.0.0 #AutoIt3Wrapper_Res_Language=1033 ://////=__=://///= this application at this time. For major errors contact Insignia96 on MMOwned.com! #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Global $organizer = 0x000000 #include <GUIConstantsEx.au3> #include <Resources.au3> #include <GuiToolbar.au3> #include <ToolbarConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <GuiListview.au3> #include <IE.au3> #include <Timers.au3> #include <Array.au3> #include <File.au3> #include <Math.au3> #include <GuiMenu.au3> #include <WinAPI.au3> #include <Constants.au3> Global $pageurl = "http://mmowned.com" Global $bin = @AppDataDir & "\MMOwned Browser\bin\" If Not FileExists($bin) Then DirCreate($bin) EndIf FileInstall("C:\Documents and Settings\Dude\My Documents\Mai MMOwned Browser\bin\bookmarks.txt", @AppDataDir & "\MMOwned Browser\bin\bookmarks.txt", 0) FileInstall("C:\Documents and Settings\Dude\My Documents\Mai MMOwned Browser\bin\conf.ini", @AppDataDir & "\MMOwned Browser\bin\conf.ini", 1) $conf = $bin & "conf.ini" $book_mark = $bin & "bookmarks.txt" Global $warned = 0 _IEErrorHandlerRegister() $Form1 = GUICreate("MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides - MMOwned Web Browser - by Insignia96", 900, 650, 188, 119, BitOR($WS_MAXIMIZE, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX, $WS_CLIPSIBLINGS)) $BrowserObj = _IECreateEmbedded() $clientsize = WinGetClientSize($Form1) $Combo1 = GUICtrlCreateInput("http://mmowned.com/", 4, 40, $clientsize[0] - 50, 22) $Button1 = GUICtrlCreateButton("---->", $clientsize[0] - 38, 40, 31, 22, $WS_GROUP) $Browser1 = GUICtrlCreateObj($BrowserObj, 0, 65, $clientsize[0], $clientsize[1] - 115) $MenuItem1 = GUICtrlCreateMenu("File") $MenuItem6 = GUICtrlCreateMenuItem("Open File Ctrl+O", $MenuItem1) $MenuItem7 = GUICtrlCreateMenuItem("", $MenuItem1) $MenuItem8 = GUICtrlCreateMenuItem("Quick Print Ctrl+P", $MenuItem1) $MenuItem9 = GUICtrlCreateMenuItem("Print Ctrl+Shift+P", $MenuItem1) $MenuItem12 = GUICtrlCreateMenuItem("", $MenuItem1) $MenuItem13 = GUICtrlCreateMenuItem("Save Current Page Ctrl+S", $MenuItem1) $MenuItem34 = GUICtrlCreateMenuItem("View Page Source Ctrl+U", $MenuItem1) $MenuItem2 = GUICtrlCreateMenu("Edit") $MenuItem10 = GUICtrlCreateMenuItem("Undo Ctrl+Z", $MenuItem2) $MenuItem11 = GUICtrlCreateMenuItem("Redo Ctrl+Y", $MenuItem2) $MenuItem14 = GUICtrlCreateMenuItem("", $MenuItem2) $MenuItem15 = GUICtrlCreateMenuItem("Copy Ctrl+C", $MenuItem2) $MenuItem16 = GUICtrlCreateMenuItem("Paste Ctrl+V", $MenuItem2) $MenuItem17 = GUICtrlCreateMenuItem("Cut Ctrl+X", $MenuItem2) $MenuItem18 = GUICtrlCreateMenuItem("Delete Del", $MenuItem2) $MenuItem19 = GUICtrlCreateMenuItem("", $MenuItem2) $MenuItem20 = GUICtrlCreateMenuItem("Select All Ctrl+A", $MenuItem2) $MenuItem21 = GUICtrlCreateMenuItem("", $MenuItem2) $MenuItem22 = GUICtrlCreateMenuItem("Find Ctrl+F", $MenuItem2) $MenuItem3 = GUICtrlCreateMenu("Settings") $MenuItem23 = GUICtrlCreateMenuItem("Open View Settings", $MenuItem3) $MenuItem24 = GUICtrlCreateMenuItem("", $MenuItem3) $MenuItem25 = GUICtrlCreateMenuItem("Open General Settings", $MenuItem3) $MenuItem4 = GUICtrlCreateMenu("Bookmarks") $MenuItem26 = GUICtrlCreateMenuItem("Add Bookmark", $MenuItem4) $MenuItem27 = GUICtrlCreateMenuItem("", $MenuItem4) $MenuItem28 = GUICtrlCreateMenuItem("Organize Bookmarks", $MenuItem4) $MenuItem29 = GUICtrlCreateMenuItem("", $MenuItem4) Global $bookmarks = _AddBookmarks($MenuItem4, $book_mark) $MenuItem5 = GUICtrlCreateMenu("Help") $MenuItem31 = GUICtrlCreateMenuItem("Help...", $MenuItem5) $MenuItem32 = GUICtrlCreateMenuItem("", $MenuItem5) $MenuItem33 = GUICtrlCreateMenuItem("About", $MenuItem5) $ToolBar1 = _GUICtrlToolbar_Create($Form1, 0) _GUICtrlToolbar_AddBitmap($ToolBar1, 1, -1, $IDB_STD_LARGE_COLOR) _GUICtrlToolbar_AddButton($ToolBar1, "idBack", $STD_FILENEW) _GUICtrlToolbar_AddButton($ToolBar1, "idForward", $STD_FILEOPEN) GUISetState(@SW_SHOW) _IENavigate($BrowserObj, "http://www.mmowned.com") $document = _IEDocGetObj($BrowserObj) WinSetTitle($Form1, "", $document.title & " - MMOwned Web Browser - by Insignia96") AdlibEnable("CheckAndSetUI", "10") While 1 Select Case _GUICtrlToolbar_IsButtonPressed($ToolBar1, "idBack") = True _IEAction($BrowserObj, "back") Case _GUICtrlToolbar_IsButtonPressed($ToolBar1, "idForward") = True _IEAction($BrowserObj, "forward") EndSelect $nMsg = GUIGetMsg(1) If NOT IsArray( $nMsg ) Then MsgBox( 48, "Internal Error!", "Internal Error(2) has occurred! This Data has been copied to the clipboard!" ) ClipPut( "Errorcode = 2, Comment = GUIGetMsg has Failed!" ) ConsoleWrite( "Exiting with Errorcode 2, Comment = GUIGetMsg has Failed!" & @CRLF ) Exit EndIf $lastmark = UBound($bookmarks, 1) - 1 Switch $nMsg[0] Case $GUI_EVENT_CLOSE If $organizer = 0x000000 Then _IEErrorHandlerDeRegister() Exit Else GUIDelete( $organizer ) $organizer = 0x000000 EndIf Case $Button1 _IENavigate($BrowserObj, GUICtrlRead($Combo1)) $doc = _IEDocGetObj($BrowserObj) GUICtrlSetData($Combo1, $doc.url) $pageurl = $doc.url Case $MenuItem34 $doc = _IEDocGetObj($BrowserObj) _GetSource($doc.url) Case $MenuItem26 $doc = _IEDocGetObj($BrowserObj) _BookmarkPage($doc.title, $doc.url) Case $bookmarks[1][2] To $bookmarks[$lastmark][2] $press = _GetPressedBookmark( $bookmarks, $nMsg[0], 2) $marked_url = $bookmarks[$press][1] ;~ MsgBox(4096, "Pressed", $press) ;~ MsgBox(4096, "Bookmarked URL!", $marked_url) _IENavigate($BrowserObj, $marked_url) $doc = _IEDocGetObj($BrowserObj) GUICtrlSetData($Combo1, $doc.url) $pageurl = $doc.url Case $MenuItem28 $organizer = _ShowBookmarkOrganizer() Case $marksDelete EndSwitch WEnd Func CheckAndSetUI() $nMsg = GUIGetMsg() $doc = _IEDocGetObj($BrowserObj) $doc = _IEDocGetObj($BrowserObj) WinSetTitle($Form1, "", $doc.title & " - MMOwned Web Browser - by Insignia96") $doc = _IEDocGetObj($BrowserObj) Switch $doc.domain Case "mmowned.com" $warned = False Case "www.mmowned.com" $warned = False Case "arcemu.info" $warned = False Case "arcemu.org" $warned = False Case "www.aspiredev.org" $warned = False Case Else If Not $warned Then _WarnExternal($doc.url) EndSwitch EndFunc ;==>CheckAndSetUI Func _AddBookmarks($outMnu, $file) $time = _Timer_Init() $lines = _FileCountLines($file) Local $hArray[$lines + 1][$lines + 1] $hArray[0][0] = _FileCountLines($file) $bookmark = FileOpen($file, 0) $i = 1 While $i <= $lines $mark = FileReadLine($file, $i) $data = StringSplit($mark, "|") $makeitem = GUICtrlCreateMenuItem($data[1], $outMnu) If Even($i) Then _GUICtrlMenu_SetItemBmp($outMnu, $i - 1, _WinAPI_CreateSolidBitmap($Form1, 0x0000FF, 16, 16)) Else _GUICtrlMenu_SetItemBmp($outMnu, $i - 1, _WinAPI_CreateSolidBitmap($Form1, 0xFF0000, 16, 16)) EndIf $hArray[$i][0] = $data[1] $hArray[$i][1] = $data[2] $hArray[$i][2] = $makeitem $i = $i + 1 WEnd FileClose($bookmark) MsgBox(64, "Bookmarks Loaded!", "Bookmarks fully loaded in " & _Timer_Diff($time) & " ms") Return $hArray EndFunc ;==>_AddBookmarks Func _BookmarkPage($page_title, $page_url) $name = InputBox("Please enter the title for this bookmark...", "Please enter a title for the bookmark at: " & $page_url, $page_title) If $name = "" Then Return False $reset = $bookmarks[0][0] $i = 1 While $i <= $reset GUICtrlDelete($bookmarks[$i][2]) $i = $i + 1 WEnd FileWriteLine($book_mark, $name & "|" & $page_url) Sleep(1000) _AddBookmarks($MenuItem4, $book_mark) Sleep(15) _ArrayDisplay($bookmarks) EndFunc ;==>_BookmarkPage Func _GetSource($srcurl) $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", $srcurl) $oHTTP.Send() $HTMLSource = $oHTTP.Responsetext _IEDocWriteHTML($BrowserObj, "") $source_page = StringFormat("<center><h3>Page Source For URL: %s<h3><br/><br/><textarea rows=""50"" cols=""100"" readonly=""readonly"">%s</textarea></center>", $srcurl, $HTMLSource) _IEBodyWriteHTML($BrowserObj, $source_page) $oHTTP = 0 EndFunc ;==>_GetSource Func _WarnExternal($extUrl) _IEDocWriteHTML($BrowserObj, "/*Warning Page Initiating!*/") $warning = StringFormat("<h2>Page Not On the Safe List!</h2><br/><p>The page you are trying to view is not on the list of webpages <br/> that have been declared safe for use in this browser! <br/> Any damage to your computer after this is not the responsibility of iWoW / Aqua Programming.</p><br/><br/><h6>If you still wish to visit the webpage click <a href=""%s"">here.</a></h6>", $extUrl) _IEBodyWriteHTML($BrowserObj, $warning) $warned = True EndFunc ;==>_WarnExternal Func Even($hInt) If Not IsInt($hInt) Then Return 0 SetError(1) EndIf Switch _MathCheckDiv($hInt, 2) Case 1 Return False Case 2 Return True Case - 1 SetError(1) SetExtended("Not a Valid Number!") Return -1 EndSwitch EndFunc ;==>Even Func _GetPressedBookmark($array, $guiMsg, $msgColumn = 2) $i = 1 While $i <= $array[0][0] If $array[$i][$msgColumn] = $guiMsg Then Return $i ExitLoop ElseIf $i = $array[0][0] Then ExitLoop EndIf $i = $i + 1 WEnd SetError(-1) Return 0 EndFunc ;==>_GetPressedBookmark Func _ShowBookmarkOrganizer( ) Global $marksOrg = GUICreate("Organize Bookmarks...", 698, 623, 270, 153) Global $marksLV = GUICtrlCreateListView("Name|URL", 8, 56, 681, 561) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 350) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 325) Global $marksLVcontext = GUICtrlCreateContextMenu($marksLV) Global $marksDelete = GUICtrlCreateMenuItem("Delete", $marksLVcontext) Global $marksSep1 = GUICtrlCreateMenuItem("", $marksLVcontext) Global $marksNewSep = GUICtrlCreateMenuItem("Add Seperator", $marksLVcontext) Global $marksAddMark = GUICtrlCreateMenuItem("Add Bookmark", $marksLVcontext) Global $marksAddFolder = GUICtrlCreateMenuItem("Add Folder", $marksLVcontext) Global $marksUpSel = GUICtrlCreateButton("up", 616, 24, 27, 25, 0) Global $marksDownSel = GUICtrlCreateButton("down", 656, 24, 27, 25, $WS_GROUP) Global $marksClearAll = GUICtrlCreateButton("Clear All Bookmarks...", 8, 16, 123, 25, $WS_GROUP) Global $marksImport = GUICtrlCreateButton("Import Bookmarks Backup...", 152, 16, 155, 25, $WS_GROUP) Global $marksExport = GUICtrlCreateButton("Export Bookmarks Backup...", 328, 16, 155, 25, $WS_GROUP) GUISetState( @SW_SHOW, $marksOrg ) Global $LVArray = _PopulateOrganizer( $marksLV, $book_mark ) Return $marksOrg EndFunc Func _PopulateOrganizer($outLV, $file) $time = _Timer_Init() $lines = _FileCountLines($file) Local $hArray[$lines + 1][$lines + 1] $hArray[0][0] = _FileCountLines($file) $bookmark = FileOpen($file, 0) $i = 1 While $i <= $lines $mark = FileReadLine($file, $i) $data = StringSplit($mark, "|") $makeitem = GUICtrlCreateListViewItem( $data[1] & "|" & $data[2], $outLV ) $hArray[$i][0] = $data[1] $hArray[$i][1] = $data[2] $hArray[$i][2] = $makeitem $i = $i + 1 WEnd FileClose($bookmark) MsgBox(64, "Bookmarks Loaded!", "Bookmarks fully loaded into LV in " & _Timer_Diff($time) & " ms") Return $hArray EndFunc ;==>_AddBookmarks Func _GUICtrlListView_GetSelectedBookmark( $handle ) $items = _GUICtrlListView_GetItemCount( $handle ) $i = 0 While $i <= $items $get = _GUICtrlListView_GetItemSelected( $handle, $i ) If $get = True Then Return _GUICtrlListView_GetItemText($handle, $i) ExitLoop Else $i = $i + 1 EndIf WEnd EndFunc Sorry if its a bit long XD . Visit my website to see all my finished releases!Releases here:UDFs:GUI ResizingColor List (Web Colors)GUIFade_NearestPower Link to comment Share on other sites More sharing options...
martin Posted June 14, 2009 Share Posted June 14, 2009 expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=I:\Earth.ico #AutoIt3Wrapper_Outfile=MMOwned Web Browser.exe #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_Comment=A custom web browser made just for MMOwned by Insignia96. #AutoIt3Wrapper_Res_Description=by Insignia96 #AutoIt3Wrapper_Res_Fileversion=0.5.0.0 #AutoIt3Wrapper_Res_Language=1033 ://////=__=://///= this application at this time. For major errors contact Insignia96 on MMOwned.com! #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Global $organizer = 0x000000 #include <GUIConstantsEx.au3> #include <Resources.au3> #include <GuiToolbar.au3> #include <ToolbarConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <GuiListview.au3> #include <IE.au3> #include <Timers.au3> #include <Array.au3> #include <File.au3> #include <Math.au3> #include <GuiMenu.au3> #include <WinAPI.au3> #include <Constants.au3> Global $pageurl = "http://mmowned.com" Global $bin = @AppDataDir & "\MMOwned Browser\bin\" If Not FileExists($bin) Then DirCreate($bin) EndIf FileInstall("C:\Documents and Settings\Dude\My Documents\Mai MMOwned Browser\bin\bookmarks.txt", @AppDataDir & "\MMOwned Browser\bin\bookmarks.txt", 0) FileInstall("C:\Documents and Settings\Dude\My Documents\Mai MMOwned Browser\bin\conf.ini", @AppDataDir & "\MMOwned Browser\bin\conf.ini", 1) $conf = $bin & "conf.ini" $book_mark = $bin & "bookmarks.txt" Global $warned = 0 _IEErrorHandlerRegister() $Form1 = GUICreate("MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides - MMOwned Web Browser - by Insignia96", 900, 650, 188, 119, BitOR($WS_MAXIMIZE, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX, $WS_CLIPSIBLINGS)) $BrowserObj = _IECreateEmbedded() $clientsize = WinGetClientSize($Form1) $Combo1 = GUICtrlCreateInput("http://mmowned.com/", 4, 40, $clientsize[0] - 50, 22) $Button1 = GUICtrlCreateButton("---->", $clientsize[0] - 38, 40, 31, 22, $WS_GROUP) $Browser1 = GUICtrlCreateObj($BrowserObj, 0, 65, $clientsize[0], $clientsize[1] - 115) $MenuItem1 = GUICtrlCreateMenu("File") $MenuItem6 = GUICtrlCreateMenuItem("Open File Ctrl+O", $MenuItem1) $MenuItem7 = GUICtrlCreateMenuItem("", $MenuItem1) $MenuItem8 = GUICtrlCreateMenuItem("Quick Print Ctrl+P", $MenuItem1) $MenuItem9 = GUICtrlCreateMenuItem("Print Ctrl+Shift+P", $MenuItem1) $MenuItem12 = GUICtrlCreateMenuItem("", $MenuItem1) $MenuItem13 = GUICtrlCreateMenuItem("Save Current Page Ctrl+S", $MenuItem1) $MenuItem34 = GUICtrlCreateMenuItem("View Page Source Ctrl+U", $MenuItem1) $MenuItem2 = GUICtrlCreateMenu("Edit") $MenuItem10 = GUICtrlCreateMenuItem("Undo Ctrl+Z", $MenuItem2) $MenuItem11 = GUICtrlCreateMenuItem("Redo Ctrl+Y", $MenuItem2) $MenuItem14 = GUICtrlCreateMenuItem("", $MenuItem2) $MenuItem15 = GUICtrlCreateMenuItem("Copy Ctrl+C", $MenuItem2) $MenuItem16 = GUICtrlCreateMenuItem("Paste Ctrl+V", $MenuItem2) $MenuItem17 = GUICtrlCreateMenuItem("Cut Ctrl+X", $MenuItem2) $MenuItem18 = GUICtrlCreateMenuItem("Delete Del", $MenuItem2) $MenuItem19 = GUICtrlCreateMenuItem("", $MenuItem2) $MenuItem20 = GUICtrlCreateMenuItem("Select All Ctrl+A", $MenuItem2) $MenuItem21 = GUICtrlCreateMenuItem("", $MenuItem2) $MenuItem22 = GUICtrlCreateMenuItem("Find Ctrl+F", $MenuItem2) $MenuItem3 = GUICtrlCreateMenu("Settings") $MenuItem23 = GUICtrlCreateMenuItem("Open View Settings", $MenuItem3) $MenuItem24 = GUICtrlCreateMenuItem("", $MenuItem3) $MenuItem25 = GUICtrlCreateMenuItem("Open General Settings", $MenuItem3) $MenuItem4 = GUICtrlCreateMenu("Bookmarks") $MenuItem26 = GUICtrlCreateMenuItem("Add Bookmark", $MenuItem4) $MenuItem27 = GUICtrlCreateMenuItem("", $MenuItem4) $MenuItem28 = GUICtrlCreateMenuItem("Organize Bookmarks", $MenuItem4) $MenuItem29 = GUICtrlCreateMenuItem("", $MenuItem4) Global $bookmarks = _AddBookmarks($MenuItem4, $book_mark) $MenuItem5 = GUICtrlCreateMenu("Help") $MenuItem31 = GUICtrlCreateMenuItem("Help...", $MenuItem5) $MenuItem32 = GUICtrlCreateMenuItem("", $MenuItem5) $MenuItem33 = GUICtrlCreateMenuItem("About", $MenuItem5) $ToolBar1 = _GUICtrlToolbar_Create($Form1, 0) _GUICtrlToolbar_AddBitmap($ToolBar1, 1, -1, $IDB_STD_LARGE_COLOR) _GUICtrlToolbar_AddButton($ToolBar1, "idBack", $STD_FILENEW) _GUICtrlToolbar_AddButton($ToolBar1, "idForward", $STD_FILEOPEN) GUISetState(@SW_SHOW) _IENavigate($BrowserObj, "http://www.mmowned.com") $document = _IEDocGetObj($BrowserObj) WinSetTitle($Form1, "", $document.title & " - MMOwned Web Browser - by Insignia96") AdlibEnable("CheckAndSetUI", "10") While 1 Select Case _GUICtrlToolbar_IsButtonPressed($ToolBar1, "idBack") = True _IEAction($BrowserObj, "back") Case _GUICtrlToolbar_IsButtonPressed($ToolBar1, "idForward") = True _IEAction($BrowserObj, "forward") EndSelect $nMsg = GUIGetMsg(1) If NOT IsArray( $nMsg ) Then MsgBox( 48, "Internal Error!", "Internal Error(2) has occurred! This Data has been copied to the clipboard!" ) ClipPut( "Errorcode = 2, Comment = GUIGetMsg has Failed!" ) ConsoleWrite( "Exiting with Errorcode 2, Comment = GUIGetMsg has Failed!" & @CRLF ) Exit EndIf $lastmark = UBound($bookmarks, 1) - 1 Switch $nMsg[0] Case $GUI_EVENT_CLOSE If $organizer = 0x000000 Then _IEErrorHandlerDeRegister() Exit Else GUIDelete( $organizer ) $organizer = 0x000000 EndIf Case $Button1 _IENavigate($BrowserObj, GUICtrlRead($Combo1)) $doc = _IEDocGetObj($BrowserObj) GUICtrlSetData($Combo1, $doc.url) $pageurl = $doc.url Case $MenuItem34 $doc = _IEDocGetObj($BrowserObj) _GetSource($doc.url) Case $MenuItem26 $doc = _IEDocGetObj($BrowserObj) _BookmarkPage($doc.title, $doc.url) Case $bookmarks[1][2] To $bookmarks[$lastmark][2] $press = _GetPressedBookmark( $bookmarks, $nMsg[0], 2) $marked_url = $bookmarks[$press][1] ;~ MsgBox(4096, "Pressed", $press) ;~ MsgBox(4096, "Bookmarked URL!", $marked_url) _IENavigate($BrowserObj, $marked_url) $doc = _IEDocGetObj($BrowserObj) GUICtrlSetData($Combo1, $doc.url) $pageurl = $doc.url Case $MenuItem28 $organizer = _ShowBookmarkOrganizer() Case $marksDelete EndSwitch WEnd Func CheckAndSetUI() $nMsg = GUIGetMsg() $doc = _IEDocGetObj($BrowserObj) $doc = _IEDocGetObj($BrowserObj) WinSetTitle($Form1, "", $doc.title & " - MMOwned Web Browser - by Insignia96") $doc = _IEDocGetObj($BrowserObj) Switch $doc.domain Case "mmowned.com" $warned = False Case "www.mmowned.com" $warned = False Case "arcemu.info" $warned = False Case "arcemu.org" $warned = False Case "www.aspiredev.org" $warned = False Case Else If Not $warned Then _WarnExternal($doc.url) EndSwitch EndFunc ;==>CheckAndSetUI Func _AddBookmarks($outMnu, $file) $time = _Timer_Init() $lines = _FileCountLines($file) Local $hArray[$lines + 1][$lines + 1] $hArray[0][0] = _FileCountLines($file) $bookmark = FileOpen($file, 0) $i = 1 While $i <= $lines $mark = FileReadLine($file, $i) $data = StringSplit($mark, "|") $makeitem = GUICtrlCreateMenuItem($data[1], $outMnu) If Even($i) Then _GUICtrlMenu_SetItemBmp($outMnu, $i - 1, _WinAPI_CreateSolidBitmap($Form1, 0x0000FF, 16, 16)) Else _GUICtrlMenu_SetItemBmp($outMnu, $i - 1, _WinAPI_CreateSolidBitmap($Form1, 0xFF0000, 16, 16)) EndIf $hArray[$i][0] = $data[1] $hArray[$i][1] = $data[2] $hArray[$i][2] = $makeitem $i = $i + 1 WEnd FileClose($bookmark) MsgBox(64, "Bookmarks Loaded!", "Bookmarks fully loaded in " & _Timer_Diff($time) & " ms") Return $hArray EndFunc ;==>_AddBookmarks Func _BookmarkPage($page_title, $page_url) $name = InputBox("Please enter the title for this bookmark...", "Please enter a title for the bookmark at: " & $page_url, $page_title) If $name = "" Then Return False $reset = $bookmarks[0][0] $i = 1 While $i <= $reset GUICtrlDelete($bookmarks[$i][2]) $i = $i + 1 WEnd FileWriteLine($book_mark, $name & "|" & $page_url) Sleep(1000) _AddBookmarks($MenuItem4, $book_mark) Sleep(15) _ArrayDisplay($bookmarks) EndFunc ;==>_BookmarkPage Func _GetSource($srcurl) $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", $srcurl) $oHTTP.Send() $HTMLSource = $oHTTP.Responsetext _IEDocWriteHTML($BrowserObj, "") $source_page = StringFormat("<center><h3>Page Source For URL: %s<h3><br/><br/><textarea rows=""50"" cols=""100"" readonly=""readonly"">%s</textarea></center>", $srcurl, $HTMLSource) _IEBodyWriteHTML($BrowserObj, $source_page) $oHTTP = 0 EndFunc ;==>_GetSource Func _WarnExternal($extUrl) _IEDocWriteHTML($BrowserObj, "/*Warning Page Initiating!*/") $warning = StringFormat("<h2>Page Not On the Safe List!</h2><br/><p>The page you are trying to view is not on the list of webpages <br/> that have been declared safe for use in this browser! <br/> Any damage to your computer after this is not the responsibility of iWoW / Aqua Programming.</p><br/><br/><h6>If you still wish to visit the webpage click <a href=""%s"">here.</a></h6>", $extUrl) _IEBodyWriteHTML($BrowserObj, $warning) $warned = True EndFunc ;==>_WarnExternal Func Even($hInt) If Not IsInt($hInt) Then Return 0 SetError(1) EndIf Switch _MathCheckDiv($hInt, 2) Case 1 Return False Case 2 Return True Case - 1 SetError(1) SetExtended("Not a Valid Number!") Return -1 EndSwitch EndFunc ;==>Even Func _GetPressedBookmark($array, $guiMsg, $msgColumn = 2) $i = 1 While $i <= $array[0][0] If $array[$i][$msgColumn] = $guiMsg Then Return $i ExitLoop ElseIf $i = $array[0][0] Then ExitLoop EndIf $i = $i + 1 WEnd SetError(-1) Return 0 EndFunc ;==>_GetPressedBookmark Func _ShowBookmarkOrganizer( ) Global $marksOrg = GUICreate("Organize Bookmarks...", 698, 623, 270, 153) Global $marksLV = GUICtrlCreateListView("Name|URL", 8, 56, 681, 561) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 350) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 325) Global $marksLVcontext = GUICtrlCreateContextMenu($marksLV) Global $marksDelete = GUICtrlCreateMenuItem("Delete", $marksLVcontext) Global $marksSep1 = GUICtrlCreateMenuItem("", $marksLVcontext) Global $marksNewSep = GUICtrlCreateMenuItem("Add Seperator", $marksLVcontext) Global $marksAddMark = GUICtrlCreateMenuItem("Add Bookmark", $marksLVcontext) Global $marksAddFolder = GUICtrlCreateMenuItem("Add Folder", $marksLVcontext) Global $marksUpSel = GUICtrlCreateButton("up", 616, 24, 27, 25, 0) Global $marksDownSel = GUICtrlCreateButton("down", 656, 24, 27, 25, $WS_GROUP) Global $marksClearAll = GUICtrlCreateButton("Clear All Bookmarks...", 8, 16, 123, 25, $WS_GROUP) Global $marksImport = GUICtrlCreateButton("Import Bookmarks Backup...", 152, 16, 155, 25, $WS_GROUP) Global $marksExport = GUICtrlCreateButton("Export Bookmarks Backup...", 328, 16, 155, 25, $WS_GROUP) GUISetState( @SW_SHOW, $marksOrg ) Global $LVArray = _PopulateOrganizer( $marksLV, $book_mark ) Return $marksOrg EndFunc Func _PopulateOrganizer($outLV, $file) $time = _Timer_Init() $lines = _FileCountLines($file) Local $hArray[$lines + 1][$lines + 1] $hArray[0][0] = _FileCountLines($file) $bookmark = FileOpen($file, 0) $i = 1 While $i <= $lines $mark = FileReadLine($file, $i) $data = StringSplit($mark, "|") $makeitem = GUICtrlCreateListViewItem( $data[1] & "|" & $data[2], $outLV ) $hArray[$i][0] = $data[1] $hArray[$i][1] = $data[2] $hArray[$i][2] = $makeitem $i = $i + 1 WEnd FileClose($bookmark) MsgBox(64, "Bookmarks Loaded!", "Bookmarks fully loaded into LV in " & _Timer_Diff($time) & " ms") Return $hArray EndFunc ;==>_AddBookmarks Func _GUICtrlListView_GetSelectedBookmark( $handle ) $items = _GUICtrlListView_GetItemCount( $handle ) $i = 0 While $i <= $items $get = _GUICtrlListView_GetItemSelected( $handle, $i ) If $get = True Then Return _GUICtrlListView_GetItemText($handle, $i) ExitLoop Else $i = $i + 1 EndIf WEnd EndFunc Sorry if its a bit long XD . Hey, insignia96, at least tell us what the error message is and what the variable is that's wrong. I tried running your script but all I get is an hour glass cursor. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 14, 2009 Moderators Share Posted June 14, 2009 insignia96, If it is the GUIGetMsg(1) in Line 106 that is causing you a problem, it works fine for me. However, your app fails each time the main loop tries to parse:Switch $nMsg[0] Case $bookmarks[1][2] To $bookmarks[$lastmark][2] It always comes up with:M:\Program\Au3 Scripts\fred.au3 (143) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: Case $bookmarks[1][2] To $bookmarks[$lastmark][2] Case ^ ERROR I think you need some more errorchecking. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
insignia96 Posted June 14, 2009 Author Share Posted June 14, 2009 insignia96, If it is the GUIGetMsg(1) in Line 106 that is causing you a problem, it works fine for me. However, your app fails each time the main loop tries to parse:Switch $nMsg[0] Case $bookmarks[1][2] To $bookmarks[$lastmark][2] It always comes up with:M:\Program\Au3 Scripts\fred.au3 (143) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: Case $bookmarks[1][2] To $bookmarks[$lastmark][2] Case ^ ERROR I think you need some more errorchecking. M23 XD sorry i forgot! there are some files needed to go with it! the error you get is not mine. You are getting it because my functions to parse up the files are reading nonexistent files. My error is on the: Switch $nMsg[0] part. It tells me this: \source.au3 (119) : ==> Subscript used with non-Array variable. The function has the advanced parameter, but it doesn't return an array! here is an updated version of the script btw. I commented out the part that is throwing you an error. expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=I:\Earth.ico #AutoIt3Wrapper_Outfile=MMOwned Web Browser.exe #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_Comment=A custom web browser made just for MMOwned by Insignia96. #AutoIt3Wrapper_Res_Description=by Insignia96 #AutoIt3Wrapper_Res_Fileversion=0.5.0.0 #AutoIt3Wrapper_Res_Language=1033 ://////=__=://///= this application at this time. For major errors contact Insignia96 on MMOwned.com! #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Global $organizer = 0x000000 Global $marksOrg, $marksAddFolder, $marksAddMark, $marksClearAll, $marksDelete, $marksDownSel, $marksExport, $marksImport, $marksLV, $marksLVcontext, $marksNewSep, $marksSep1, $marksUpSel #include <GUIConstantsEx.au3> #include <Resources.au3> #include <GuiToolbar.au3> #include <ToolbarConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <GuiListview.au3> #include <IE.au3> #include <Timers.au3> #include <Array.au3> #include <File.au3> #include <Math.au3> #include <GuiMenu.au3> #include <WinAPI.au3> #include <Constants.au3> Global $pageurl = "http://mmowned.com" Global $bin = @AppDataDir & "\MMOwned Browser\bin\" If Not FileExists($bin) Then DirCreate($bin) EndIf FileInstall("C:\Documents and Settings\Dude\My Documents\Mai MMOwned Browser\bin\bookmarks.txt", @AppDataDir & "\MMOwned Browser\bin\bookmarks.txt", 0) FileInstall("C:\Documents and Settings\Dude\My Documents\Mai MMOwned Browser\bin\conf.ini", @AppDataDir & "\MMOwned Browser\bin\conf.ini", 1) $conf = $bin & "conf.ini" $book_mark = $bin & "bookmarks.txt" Global $warned = 0 _IEErrorHandlerRegister() $Form1 = GUICreate("MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides - MMOwned Web Browser - by Insignia96", 900, 650, 188, 119, BitOR($WS_MAXIMIZE, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX, $WS_CLIPSIBLINGS)) $BrowserObj = _IECreateEmbedded() $clientsize = WinGetClientSize($Form1) $Combo1 = GUICtrlCreateInput("http://mmowned.com/", 4, 40, $clientsize[0] - 50, 22) $Button1 = GUICtrlCreateButton("---->", $clientsize[0] - 38, 40, 31, 22, $WS_GROUP) $Browser1 = GUICtrlCreateObj($BrowserObj, 0, 65, $clientsize[0], $clientsize[1] - 115) $MenuItem1 = GUICtrlCreateMenu("File") $MenuItem6 = GUICtrlCreateMenuItem("Open File Ctrl+O", $MenuItem1) $MenuItem7 = GUICtrlCreateMenuItem("", $MenuItem1) $MenuItem8 = GUICtrlCreateMenuItem("Quick Print Ctrl+P", $MenuItem1) $MenuItem9 = GUICtrlCreateMenuItem("Print Ctrl+Shift+P", $MenuItem1) $MenuItem12 = GUICtrlCreateMenuItem("", $MenuItem1) $MenuItem13 = GUICtrlCreateMenuItem("Save Current Page Ctrl+S", $MenuItem1) $MenuItem34 = GUICtrlCreateMenuItem("View Page Source Ctrl+U", $MenuItem1) $MenuItem2 = GUICtrlCreateMenu("Edit") $MenuItem10 = GUICtrlCreateMenuItem("Undo Ctrl+Z", $MenuItem2) $MenuItem11 = GUICtrlCreateMenuItem("Redo Ctrl+Y", $MenuItem2) $MenuItem14 = GUICtrlCreateMenuItem("", $MenuItem2) $MenuItem15 = GUICtrlCreateMenuItem("Copy Ctrl+C", $MenuItem2) $MenuItem16 = GUICtrlCreateMenuItem("Paste Ctrl+V", $MenuItem2) $MenuItem17 = GUICtrlCreateMenuItem("Cut Ctrl+X", $MenuItem2) $MenuItem18 = GUICtrlCreateMenuItem("Delete Del", $MenuItem2) $MenuItem19 = GUICtrlCreateMenuItem("", $MenuItem2) $MenuItem20 = GUICtrlCreateMenuItem("Select All Ctrl+A", $MenuItem2) $MenuItem21 = GUICtrlCreateMenuItem("", $MenuItem2) $MenuItem22 = GUICtrlCreateMenuItem("Find Ctrl+F", $MenuItem2) $MenuItem3 = GUICtrlCreateMenu("Settings") $MenuItem23 = GUICtrlCreateMenuItem("Open View Settings", $MenuItem3) $MenuItem24 = GUICtrlCreateMenuItem("", $MenuItem3) $MenuItem25 = GUICtrlCreateMenuItem("Open General Settings", $MenuItem3) $MenuItem4 = GUICtrlCreateMenu("Bookmarks") $MenuItem26 = GUICtrlCreateMenuItem("Add Bookmark", $MenuItem4) $MenuItem27 = GUICtrlCreateMenuItem("", $MenuItem4) $MenuItem28 = GUICtrlCreateMenuItem("Organize Bookmarks", $MenuItem4) $MenuItem29 = GUICtrlCreateMenuItem("", $MenuItem4) ;~ Global $bookmarks = _AddBookmarks($MenuItem4, $book_mark) $MenuItem5 = GUICtrlCreateMenu("Help") $MenuItem31 = GUICtrlCreateMenuItem("Help...", $MenuItem5) $MenuItem32 = GUICtrlCreateMenuItem("", $MenuItem5) $MenuItem33 = GUICtrlCreateMenuItem("About", $MenuItem5) $ToolBar1 = _GUICtrlToolbar_Create($Form1, 0) _GUICtrlToolbar_AddBitmap($ToolBar1, 1, -1, $IDB_STD_LARGE_COLOR) _GUICtrlToolbar_AddButton($ToolBar1, "idBack", $STD_FILENEW) _GUICtrlToolbar_AddButton($ToolBar1, "idForward", $STD_FILEOPEN) GUISetState(@SW_SHOW) _IENavigate($BrowserObj, "http://www.mmowned.com") $document = _IEDocGetObj($BrowserObj) WinSetTitle($Form1, "", $document.title & " - MMOwned Web Browser - by Insignia96") AdlibEnable("CheckAndSetUI", "10") While 1 Select Case _GUICtrlToolbar_IsButtonPressed($ToolBar1, "idBack") = True _IEAction($BrowserObj, "back") Case _GUICtrlToolbar_IsButtonPressed($ToolBar1, "idForward") = True _IEAction($BrowserObj, "forward") EndSelect $nMsg = GUIGetMsg(1) If NOT IsArray( $nMsg ) Then MsgBox( 48, "Internal Error!", "Internal Error(2) has occurred! This Data has been copied to the clipboard!" ) ClipPut( "Errorcode = 2, Comment = GUIGetMsg has Failed!" ) ConsoleWrite( "Exiting with Errorcode 2, Comment = GUIGetMsg has Failed!" & @CRLF ) Exit EndIf $lastmark = UBound($bookmarks, 1) - 1 Switch $nMsg[0] Case $GUI_EVENT_CLOSE If $organizer = 0x000000 Then _IEErrorHandlerDeRegister() Exit Else GUIDelete( $organizer ) $organizer = 0x000000 EndIf Case $Button1 _IENavigate($BrowserObj, GUICtrlRead($Combo1)) $doc = _IEDocGetObj($BrowserObj) GUICtrlSetData($Combo1, $doc.url) $pageurl = $doc.url Case $MenuItem34 $doc = _IEDocGetObj($BrowserObj) _GetSource($doc.url) Case $MenuItem26 $doc = _IEDocGetObj($BrowserObj) _BookmarkPage($doc.title, $doc.url) ;~ Case $bookmarks[1][2] To $bookmarks[$lastmark][2] ;~ $press = _GetPressedBookmark( $bookmarks, $nMsg[0], 2) ;~ $marked_url = $bookmarks[$press][1] ;~ MsgBox(4096, "Pressed", $press) ;~ MsgBox(4096, "Bookmarked URL!", $marked_url) ;~ _IENavigate($BrowserObj, $marked_url) ;~ $doc = _IEDocGetObj($BrowserObj) ;~ GUICtrlSetData($Combo1, $doc.url) ;~ $pageurl = $doc.url Case $MenuItem28 ;~ $organizer = _ShowBookmarkOrganizer() Case $marksDelete EndSwitch WEnd Func CheckAndSetUI() $nMsg = GUIGetMsg() $doc = _IEDocGetObj($BrowserObj) $doc = _IEDocGetObj($BrowserObj) WinSetTitle($Form1, "", $doc.title & " - MMOwned Web Browser - by Insignia96") $doc = _IEDocGetObj($BrowserObj) Switch $doc.domain Case "mmowned.com" $warned = False Case "www.mmowned.com" $warned = False Case "arcemu.info" $warned = False Case "arcemu.org" $warned = False Case "www.aspiredev.org" $warned = False Case Else If Not $warned Then _WarnExternal($doc.url) EndSwitch EndFunc ;==>CheckAndSetUI Func _AddBookmarks($outMnu, $file) $time = _Timer_Init() $lines = _FileCountLines($file) Local $hArray[$lines + 1][$lines + 1] $hArray[0][0] = _FileCountLines($file) $bookmark = FileOpen($file, 0) $i = 1 While $i <= $lines $mark = FileReadLine($file, $i) $data = StringSplit($mark, "|") $makeitem = GUICtrlCreateMenuItem($data[1], $outMnu) If Even($i) Then _GUICtrlMenu_SetItemBmp($outMnu, $i - 1, _WinAPI_CreateSolidBitmap($Form1, 0x0000FF, 16, 16)) Else _GUICtrlMenu_SetItemBmp($outMnu, $i - 1, _WinAPI_CreateSolidBitmap($Form1, 0xFF0000, 16, 16)) EndIf $hArray[$i][0] = $data[1] $hArray[$i][1] = $data[2] $hArray[$i][2] = $makeitem $i = $i + 1 WEnd FileClose($bookmark) MsgBox(64, "Bookmarks Loaded!", "Bookmarks fully loaded in " & _Timer_Diff($time) & " ms") Return $hArray EndFunc ;==>_AddBookmarks Func _BookmarkPage($page_title, $page_url) $name = InputBox("Please enter the title for this bookmark...", "Please enter a title for the bookmark at: " & $page_url, $page_title) If $name = "" Then Return False $reset = $bookmarks[0][0] $i = 1 While $i <= $reset GUICtrlDelete($bookmarks[$i][2]) $i = $i + 1 WEnd FileWriteLine($book_mark, $name & "|" & $page_url) Sleep(1000) _AddBookmarks($MenuItem4, $book_mark) Sleep(15) _ArrayDisplay($bookmarks) EndFunc ;==>_BookmarkPage Func _GetSource($srcurl) $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", $srcurl) $oHTTP.Send() $HTMLSource = $oHTTP.Responsetext _IEDocWriteHTML($BrowserObj, "") $source_page = StringFormat("<center><h3>Page Source For URL: %s<h3><br/><br/><textarea rows=""50"" cols=""100"" readonly=""readonly"">%s</textarea></center>", $srcurl, $HTMLSource) _IEBodyWriteHTML($BrowserObj, $source_page) $oHTTP = 0 EndFunc ;==>_GetSource Func _WarnExternal($extUrl) _IEDocWriteHTML($BrowserObj, "/*Warning Page Initiating!*/") $warning = StringFormat("<h2>Page Not On the Safe List!</h2><br/><p>The page you are trying to view is not on the list of webpages <br/> that have been declared safe for use in this browser! <br/> Any damage to your computer after this is not the responsibility of iWoW / Aqua Programming.</p><br/><br/><h6>If you still wish to visit the webpage click <a href=""%s"">here.</a></h6>", $extUrl) _IEBodyWriteHTML($BrowserObj, $warning) $warned = True EndFunc ;==>_WarnExternal Func Even($hInt) If Not IsInt($hInt) Then Return 0 SetError(1) EndIf Switch _MathCheckDiv($hInt, 2) Case 1 Return False Case 2 Return True Case - 1 SetError(1) SetExtended("Not a Valid Number!") Return -1 EndSwitch EndFunc ;==>Even Func _GetPressedBookmark($array, $guiMsg, $msgColumn = 2) $i = 1 While $i <= $array[0][0] If $array[$i][$msgColumn] = $guiMsg Then Return $i ExitLoop ElseIf $i = $array[0][0] Then ExitLoop EndIf $i = $i + 1 WEnd SetError(-1) Return 0 EndFunc ;==>_GetPressedBookmark Func _ShowBookmarkOrganizer( ) Global $marksOrg = GUICreate("Organize Bookmarks...", 698, 623, 270, 153) Global $marksLV = GUICtrlCreateListView("Name|URL", 8, 56, 681, 561) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 350) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 325) Global $marksLVcontext = GUICtrlCreateContextMenu($marksLV) Global $marksDelete = GUICtrlCreateMenuItem("Delete", $marksLVcontext) Global $marksSep1 = GUICtrlCreateMenuItem("", $marksLVcontext) Global $marksNewSep = GUICtrlCreateMenuItem("Add Seperator", $marksLVcontext) Global $marksAddMark = GUICtrlCreateMenuItem("Add Bookmark", $marksLVcontext) Global $marksAddFolder = GUICtrlCreateMenuItem("Add Folder", $marksLVcontext) Global $marksUpSel = GUICtrlCreateButton("up", 616, 24, 27, 25, 0) Global $marksDownSel = GUICtrlCreateButton("down", 656, 24, 27, 25, $WS_GROUP) Global $marksClearAll = GUICtrlCreateButton("Clear All Bookmarks...", 8, 16, 123, 25, $WS_GROUP) Global $marksImport = GUICtrlCreateButton("Import Bookmarks Backup...", 152, 16, 155, 25, $WS_GROUP) Global $marksExport = GUICtrlCreateButton("Export Bookmarks Backup...", 328, 16, 155, 25, $WS_GROUP) GUISetState( @SW_SHOW, $marksOrg ) Global $LVArray = _PopulateOrganizer( $marksLV, $book_mark ) Return $marksOrg EndFunc Func _PopulateOrganizer($outLV, $file) $time = _Timer_Init() $lines = _FileCountLines($file) Local $hArray[$lines + 1][$lines + 1] $hArray[0][0] = _FileCountLines($file) $bookmark = FileOpen($file, 0) $i = 1 While $i <= $lines $mark = FileReadLine($file, $i) $data = StringSplit($mark, "|") $makeitem = GUICtrlCreateListViewItem( $data[1] & "|" & $data[2], $outLV ) $hArray[$i][0] = $data[1] $hArray[$i][1] = $data[2] $hArray[$i][2] = $makeitem $i = $i + 1 WEnd FileClose($bookmark) MsgBox(64, "Bookmarks Loaded!", "Bookmarks fully loaded into LV in " & _Timer_Diff($time) & " ms") Return $hArray EndFunc ;==>_AddBookmarks Func _GUICtrlListView_GetSelectedBookmark( $handle ) $items = _GUICtrlListView_GetItemCount( $handle ) $i = 0 While $i <= $items $get = _GUICtrlListView_GetItemSelected( $handle, $i ) If $get = True Then Return _GUICtrlListView_GetItemText($handle, $i) ExitLoop Else $i = $i + 1 EndIf WEnd EndFunc Visit my website to see all my finished releases!Releases here:UDFs:GUI ResizingColor List (Web Colors)GUIFade_NearestPower Link to comment Share on other sites More sharing options...
Zedna Posted June 14, 2009 Share Posted June 14, 2009 (edited) Source of problems isAdlibEnable("CheckAndSetUI", "10")In this function you call $nMsg = GUIGetMsg()When you comment this line all works fine.Here is small reproducing script:#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> $Form1 = GUICreate("MMOwned", 300, 200) GUISetState(@SW_SHOW) AdlibEnable("CheckAndSetUI", "10") ; comment this line to fix problem While 1 $nMsg = GUIGetMsg(1) If Not IsArray($nMsg) Then MsgBox(48, "Internal Error!", "Internal Error(2) has occurred! This Data has been copied to the clipboard!") ConsoleWrite("Exiting with Errorcode 2, Comment = GUIGetMsg has Failed!" & @CRLF) Exit EndIf WEnd Func CheckAndSetUI() $nMsg = GUIGetMsg() EndFuncEDIT: fixFunc CheckAndSetUI() $nMsg = GUIGetMsg(1) EndFunc Edited June 14, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
insignia96 Posted June 14, 2009 Author Share Posted June 14, 2009 damn, i thought that somewhere i must've declared $nMsg differently somewhere, must've made a typo in the Find Box =D! Anyways thanks Zedna! Visit my website to see all my finished releases!Releases here:UDFs:GUI ResizingColor List (Web Colors)GUIFade_NearestPower Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now