Jump to content



Photo

My Custom Tabbed Browser.


  • Please log in to reply
8 replies to this topic

#1 KingBeavii

KingBeavii

    Seeker

  • Active Members
  • 13 posts

Posted 08 May 2012 - 06:54 AM

**UPDATED*AGAIN**

the config file is now optional, but should still use the same formatt...This fixes a few things that i noticed were buggy.

========================
[home]
use= 1
tag=Home
url=http://www.google.com

[cust1]
use=1
tag=AutoIt
url=http://www.autoitscript.com
========================

you can set 6 custom ( [cust1] to [cust6] )and 1 home page.





*oh look, there's a minimize button ;) , how the Func did I forget that
*the progress bar is gone, i just hated it , no questions please.
*technically they're profiles and not tabs, they're still experimental
*uses less memory - depending on the quality of the porntube video you are watching

Posted Image

And Finally with out further delay, Here is some code......

AutoIt         
#include <WindowsConstants.au3> ;~ #include <ButtonConstants.au3> ;~ #include <GUIConstants.au3> ;~ Files to be #include <WinAPI.au3> ;~ Included #include <Array.au3> ;~ #include <IE.au3> ;~ Global $OBJexists[10], $OBJbank[10] ,$OBJ[10] ,$page[10] , $link[7][3] ,$loads = 1 ,$x = 0 ,$tab = 0 ; Declared Variables $link[0][0] = IniRead(@scriptdir&"\config.ini","home","use","1") ; $link[0][1] = IniRead(@scriptdir&"\config.ini","home","tag","Home") ; Customise Hompage $link[0][2] = IniRead(@scriptdir&"\config.ini","home","url","<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) ; $link[1][0] = IniRead(@scriptdir&"\config.ini","cust1","use","0") ; $link[1][1] = IniRead(@scriptdir&"\config.ini","cust1","tag","Custom 1") ; Custom Link 1 $link[1][2] = IniRead(@scriptdir&"\config.ini","cust1","url","<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) ; $link[2][0] = IniRead(@scriptdir&"\config.ini","cust2","use","0") ; $link[2][1] = IniRead(@scriptdir&"\config.ini","cust2","tag","Custom 2") ; Custom Link 2 $link[2][2] = IniRead(@scriptdir&"\config.ini","cust2","url","<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) ; $link[3][0] = IniRead(@scriptdir&"\config.ini","cust3","use","0") ; $link[3][1] = IniRead(@scriptdir&"\config.ini","cust3","tag","Custom 3") ; Custom Link 3 $link[3][2] = IniRead(@scriptdir&"\config.ini","cust3","url","<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) ; $link[4][0] = IniRead(@scriptdir&"\config.ini","cust4","use","0") ; $link[4][1] = IniRead(@scriptdir&"\config.ini","cust4","tag","Custom 4") ; Custom Link 4 $link[4][2] = IniRead(@scriptdir&"\config.ini","cust4","url","<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) ; $link[5][0] = IniRead(@scriptdir&"\config.ini","cust5","use","0") ; $link[5][1] = IniRead(@scriptdir&"\config.ini","cust5","tag","Custom 5") ; Custom Link 5 $link[5][2] = IniRead(@scriptdir&"\config.ini","cust5","url","<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) ; $link[6][0] = IniRead(@scriptdir&"\config.ini","cust6","use","0") ; $link[6][1] = IniRead(@scriptdir&"\config.ini","cust6","tag","Custom 6") ; Custom Link 6 $link[6][2] = IniRead(@scriptdir&"\config.ini","cust6","url","<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) ; $GUI = GUICreate("Easy Google", @DesktopWidth,@DesktopHeight-30,0,0,$WS_POPUP) ; Create Browser GUI GUISetFont(10,800) $back = GUICtrlCreateButton("<<" ,2 ,4 ,25 ,23) ; $forward = GUICtrlCreateButton(" >>" ,27 ,4 ,25 ,23) ; $tabdown = GUICtrlCreateButton("<" ,152 ,4 ,20 ,23) ; Navigation Buttons $ext = GUICtrlCreateButton("0" ,171 ,4 ,17 ,23) ; $tabup = GUICtrlCreateButton(" >" ,537 ,4 ,20 ,23) ; GUISetFont(8,600) $reload = GUICtrlCreateButton("Reload" ,52 ,4 ,50 ,23) ; $home = GUICtrlCreateButton($link[0][1] ,102 ,4 ,50 ,23) ; More Navigation $url = GUICtrlCreateButton("GO" ,557 ,4 ,30 ,23,$BS_DEFPUSHBUTTON) ; Select ; Case $link[1][0] = 1 ; $cust1 = GUICtrlCreateButton($link[1][1] ,587 + ($x*64) ,4 ,64 ,23) ; Custom Link 1 $x += 1 ; Button Case $link[1][0] <> 1 ; $cust1 = "none" ; EndSelect ; Select ; Case $link[2][0] = 1 ; $cust2 = GUICtrlCreateButton($link[2][1] ,587 + ($x*64) ,4 ,64 ,23) ; Custom Link 2 $x += 1 ; Button Case $link[2][0] <> 1 ; $cust2 = "none" ; EndSelect ; Select ; Case $link[3][0] = 1 ; $cust3 = GUICtrlCreateButton($link[3][1] ,587 + ($x*64) ,4 ,64 ,23) ; Custom Link 3 $x += 1 ; Button Case $link[3][0] <> 1 ; $cust3 = "none" ; EndSelect ; Select ; Case $link[4][0] = 1 ; $cust4 = GUICtrlCreateButton($link[4][1] ,587 + ($x*64) ,4 ,64 ,23) ; Custom Link 4 $x += 1 ; Button Case $link[4][0] <> 1 ; $cust4 = "none" ; EndSelect ; Select ; Case $link[5][0] = 1 ; $cust5 = GUICtrlCreateButton($link[5][1] ,587 + ($x*64) ,4 ,64 ,23) ; Custom Link 5 $x += 1 ; Button Case $link[5][0] <> 1 ; $cust5 = "none" ; EndSelect ; Select ; Case $link[6][0] = 1 ; $cust6 = GUICtrlCreateButton($link[6][1] ,587 + ($x*64) ,4 ,64 ,23) ; Custom Link 6 $x += 1 ; Button Case $link[6][0] <> 1 ; $cust6 = "none" ; EndSelect ; GUISetFont(28,1200) $minimize = GUICtrlCreateButton("-" ,@desktopwidth-45 ,4 ,21 ,23) ; Minimize GUISetFont(22,1200) $exit = GUICtrlCreateButton("X" ,@desktopwidth-24 ,4 ,21 ,23) ; Exit GUISetFont(9,800) $goto = GUICtrlCreateInput("http://", 188, 5, 349, 21) ; GO $text = $link[0][2] GUISetBkColor(0x00000F) $OBJ[$tab] = ObjCreate("Shell.Explorer.2") ; $OBJbank [$tab] = GUICtrlCreateObj ($OBJ[$tab],3, 31, @DesktopWidth-6, @DesktopHeight-65) ; Embed IE $OBJexists[$tab] = 1 ; GUISetState() _IENavigate($OBJ[$tab], $link[0][2] ,0) ; Go to 'HOMEPAGE' While 1 $http = _IEPropertyget($OBJ[$tab], "locationurl") ; If $http <> $text Then ; $text = $http ; Detect and refresh the adress bar $loads = $loads + 1 ; without interupting user input GUICtrlSetData($goto,$text) ; EndIf ; $msg = GUIGetMsg() Select Case $msg = $back ; Go Back (but only if a back exists) If $loads > 3 Then $OBJ[$tab].GoBack $loads -= 1 EndIf Case $msg = $forward ; Go Forward $OBJ[$tab].GoForward $loads += 1 Case $msg = $reload ; Refresh $OBJ[$tab].Refresh Case $msg = $home ; Home _IENavigate($OBJ[$tab], $link[0][2] ,0) $loads += 1 Case $msg = $cust1 ; Cust 1 If $link[1][0]=1 Then _IENavigate($OBJ[$tab], $link[1][2] ,0) $loads += 1 EndIf Case $msg = $cust2 ; Cust 2 If $link[2][0]=1 Then _IENavigate($OBJ[$tab], $link[2][2] ,0) $loads += 1 EndIf Case $msg = $cust3 If $link[3][0]=1 Then _IENavigate($OBJ[$tab], $link[3][2] ,0) EndIf Case $msg = $cust4 If $link[4][0]=1 Then _IENavigate($OBJ[$tab], $link[4][2] ,0) $loads += 1 EndIf Case $msg = $cust5 If $link[5][0]=1 Then _IENavigate($OBJ[$tab], $link[5][2] ,0) $loads += 1 EndIf Case $msg = $cust6 If $link[6][0]=1 Then _IENavigate($OBJ[$tab], $link[6][2] ,0) $loads += 1 EndIf Case $msg = $url $address = GUICtrlRead($goto) _IENavigate($OBJ[$tab], $address,0) $loads += 1 Case $msg = $tabup $page[$tab]= _IEPropertyget($OBJ[$tab], "locationurl") GUICtrlSetState($OBJbank[$tab],$GUI_HIDE) GUICtrlSetState($OBJbank[$tab],$GUI_DISABLE) $loads = 0 $tab = $tab + 1 If $tab = 10 then $tab = 9 GUICtrlSetData($ext,$tab) Select Case $OBJexists[$tab] <> 1 $OBJ[$tab] = ObjCreate("Shell.Explorer.2") $OBJexists[$tab] = 1 $OBJbank[$tab] = GUICtrlCreateObj($OBJ[$tab],3, 31, @DesktopWidth-6, @DesktopHeight-65) ;_IENavigate($OBJ[$tab], IniRead(@scriptdir&"\config.ini","home","url","<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) ,0) Case $OBJexists[$tab] = 1 GUICtrlDelete($OBJbank[$tab]) $OBJbank[$tab] = GUICtrlCreateObj($OBJ[$tab],3, 31, @DesktopWidth-6, @DesktopHeight-65) _IENavigate($OBJ[$tab], $page[$tab],0) EndSelect Case $msg = $tabdown $page[$tab]= _IEPropertyget($OBJ[$tab], "locationurl") GUICtrlSetState($OBJbank[$tab],$GUI_HIDE) GUICtrlSetState($OBJbank[$tab],$GUI_DISABLE) $loads = 0 $tab = $tab - 1 If $tab = -1 then $tab = 0 GUICtrlSetData($ext,$tab) Select Case $OBJexists[$tab] <> 1 $OBJ[$tab] = ObjCreate("Shell.Explorer.2") $OBJexists[$tab] = 1 $OBJbank[$tab] = GUICtrlCreateObj($OBJ[$tab],3, 31, @DesktopWidth-6, @DesktopHeight-65) GUICtrlSetData($ext,$tab) ;_IENavigate($OBJ[$tab], IniRead(@scriptdir&"\config.ini","home","url","<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) ,0) Case $OBJexists[$tab] = 1 GUICtrlDelete($OBJbank[$tab]) $OBJbank[$tab] = GUICtrlCreateObj($OBJ[$tab],3, 31, @DesktopWidth-6, @DesktopHeight-65) _IENavigate($OBJ[$tab], $page[$tab],0) EndSelect Case $msg = $ext $dump=MsgBox(4,"Easy Google","This will delete all memory from profile"&$tab&" and load a empty profile."&@CRLF&@CRLF&"Do you wish to continue",-1) If $dump = 6 Then $page[$tab] = "" GUICtrlDelete($OBJbank[$tab]) $OBJbank[$tab] = GUICtrlCreateObj($OBJ[$tab],3, 31, @DesktopWidth-6, @DesktopHeight-65) EndIf Case $msg = $exit exit Case $msg = $minimize WinSetState("Easy Google","",@SW_MINIMIZE) Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd

Edited by KingBeavii, 13 May 2012 - 10:13 AM.








#2 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,954 posts

Posted 08 May 2012 - 02:57 PM

i dont know what actually should i do now,, but i hope you can share your code... i will not run program, that i dont know actual code from others.. Posted Image


So is your whole computer just full of autoit scripts?
No exe files at all?

#3 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,749 posts

Posted 08 May 2012 - 02:59 PM

knightz93 (and anyone else who might think of posting something similar),

Take a look at this - and then keep quiet. ;)

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items

#4 knightz93

knightz93

    Seeker

  • Active Members
  • 23 posts

Posted 08 May 2012 - 03:00 PM

Actually i mean,, code from this forum,, sorry for my bad english...

and sorry becuase forgot about that.. sorry... ;)..

thanks M23...

Edited by knightz93, 08 May 2012 - 03:02 PM.

I will do my best in this forum my code : WindowsSwitcher3d()

#5 KingBeavii

KingBeavii

    Seeker

  • Active Members
  • 13 posts

Posted 08 May 2012 - 05:39 PM

Hey,

Just to clarify, I Intend to release the source at a later date.

At the moment there are still a couple of kinks in the chain, and the code looks like a cheese cake that fell from orbit.

But as with all scripts I have done, Once I believe it is functioning as (or beyond) planned. A complete rewrite is performed to 'clean' the code. Normally this also allows me to find and fix bugs at the same time as i am getting to the point where i can run scripts in my head.....

#6 guinness

guinness

    guinness

  • MVPs
  • 11,050 posts

Posted 08 May 2012 - 05:43 PM

KingBeavii,

One suggestion from me would be when there is focus in the URL input, when I hit the enter key it would be great to navigate to the website.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#7 KingBeavii

KingBeavii

    Seeker

  • Active Members
  • 13 posts

Posted 08 May 2012 - 06:19 PM

KingBeavii,

One suggestion from me would be when there is focus in the URL input, when I hit the enter key it would be great to navigate to the website.


Yeah, Working on that.

#8 guinness

guinness

    guinness

  • MVPs
  • 11,050 posts

Posted 10 May 2012 - 07:12 AM

A couple of points:
  • You're using Select...EndSelect when in fact you can use If...EndIf.
  • $x = $x + 1 can be shortened to $x += 1.
  • You're presuming the height of the taskbar for everyone is 30 pixels and that it is located at the bottom of the screen. Why not use _GetDesktopArea as this is the visible working area of the desktop.
  • Why not use a Switch...EndSwitch statement instead for GUIGetMsg.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#9 KingBeavii

KingBeavii

    Seeker

  • Active Members
  • 13 posts

Posted 12 May 2012 - 12:43 AM

Updated Again.....

As usual edited first post to incorporate the changes,


A couple of points:

  • You're using Select...EndSelect when in fact you can use If...EndIf.
  • $x = $x + 1 can be shortened to $x += 1.
  • You're presuming the height of the taskbar for everyone is 30 pixels and that it is located at the bottom of the screen. Why not use _GetDesktopArea as this is the visible working area of the desktop.
  • Why not use a Switch...EndSwitch statement instead for GUIGetMsg.


It would be helpful to me if you quoted the sections you are discussing. I dont see where If, EndIf improves the script. It can be used yes, but will extend the length of the script by $n*if's - 2.

I tested your
_GetDesktopArea func but it caused the GUI to be created, but not appear. will have a second when i have time.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users