goodmanjl531

Menu for Web links

4 posts in this topic

I am trying to create a menu that will list a specific number of weblinks and after the user clicks on one it will open the specfic link in Firefox

 

I need the menu to be full screen and topmost screen then when firefox opens the same topmost screen fullly maximized,  When user close's Firefox the menu should then be back in the top screen

 

Some of my company specific code has been removed

Ive tried different calls for Firefox shellexecute vs just a run command 

most important since this is running on a locked down machine I need widows to be on top at specific points to stop other software from taking over.

everything is working except having the different windows stay in focus on top when needed.

 

Thanks in advance for anyhelp

#include <APISysConstants.au3>
#include <ButtonConstants.au3>
#include <ColorConstants.au3>
#include <Constants.au3>
#include <EditConstants.au3>
#include <FileConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>


$TYPE = 0



    $Form1 = GUICreate(StringUpper($Storedivision) & " Weblinks", 1921, 1179, 1912, -8, BitOR($WS_SYSMENU, $WS_MAXIMIZE, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE))
    $Button1 = GUICtrlCreateButton("iNotes", 24, 96, 137, 73)
    $Button2 = GUICtrlCreateButton(StringUpper($Storedivision), 24, 16, 137, 73)
    $Button3 = GUICtrlCreateButton("ShopperTrak", 184, 16, 137, 73)
    If $StoreShopperTrak = "no" Then
        _GUICtrlButton_Enable($Button3, False)
    EndIf
    $Button4 = GUICtrlCreateButton("Ceridian", 184, 96, 137, 73)
    $Button5 = GUICtrlCreateButton("Shoplifting Incident Form", 24, 176, 137, 73)
    $Button6 = GUICtrlCreateButton("Customer Email", 184, 176, 137, 73)
    $Button7 = GUICtrlCreateButton("Exit", 112, 312, 145, 49)
    GUISetState(@SW_SHOWMAXIMIZED)

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $Button1 ; INOTES
                $Website = $iNotes
                SplashTextOn($Storedivision & " Weblinks", "Loading iNotes" & @CRLF & "Please Wait...", "300", "100", "-1", "50", 0, "Arial Black", "12", "700")
                Run(@ProgramFilesDir & "\Mozilla Firefox\firefox.exe " & $Website, "", @SW_MAXIMIZE)
                ;ShellExecute($Website)
                Sleep(10000)
                SplashOff()
                ;Exit
            Case $Button2 ; Division Web
                Select
                    Case $TYPE = 15
                        $Website = $ClUS
                    Case $TYPE = 5
                        $Website = $ClCD
                    Case $TYPE = 1000
                        $Website = $ClCD
                    Case $TYPE = 11
                        $Website = $ICUS
                    Case $TYPE = 1
                        $Website = $ICCD
                EndSelect
                ShellExecute($Website)
                Sleep(10000)
                Exit
            Case $Button3 ; ShopperTrak
                $Website = $ShopperTrak
                ShellExecute($Website)
            Case $Button4 ; Ceridian
                $Website = $Ceridian
                ShellExecute($Website)
            Case $Button5 ; LP
                $Website = $LPShoplifting
                ShellExecute($Website)
            Case $Button6 ; EMAIL Signup
                Select
                    Case $TYPE = 15
                        $Website = $CLUSEmail
                    Case $TYPE = 5
                        $Website = $CLCDEmail
                    Case $TYPE = 1000
                        $Website = $CLCDEmail
                    Case $TYPE = 11
                        $Website = $ICUSEmail
                    Case $TYPE = 1
                        $Website = $ICCDEmail
                EndSelect
                ShellExecute($Website)
            Case $Button7 ; EXIT
                Exit
        EndSwitch
    WEnd




EndIf

 

Share this post


Link to post
Share on other sites



Had to change firefox path a bit to suit mine:

Case $Button1 ; INOTES
                $Website = 'google.pt'
                SplashTextOn($Storedivision & " Weblinks", "Loading iNotes" & @CRLF & "Please Wait...", "300", "100", "-1", "50", 0, "Arial Black", "12", "700")
                Run('C:\Program Files (x86)\Mozilla Firefox\firefox.exe ' & $Website, "", @SW_MAXIMIZE)
                WinSetOnTop ($Form1, '', 0)
                WinWaitActive('CLASS:[MozillaWindowClass]')
                SplashOff()
                WinSetOnTop ('CLASS:[MozillaWindowClass]', '', 0)
                Sleep(5000)
                ;Exit

I think you get the idea.

1 person likes this

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

Thanks, that worked i had to tweak it a bit..

 

$Website = $iNotes
                SplashTextOn($division & " Weblinks", "Loading iNotes" & @CRLF & "Please Wait...", "300", "100", "-1", "50", 0, "Arial Black", "12", "700")
                Run(@ProgramFilesDir & '\Mozilla Firefox\firefox.exe ' & $Website, "", @SW_MAXIMIZE)
                WinSetOnTop($Form1, '', 0)
                ;WinWaitActive('CLASS:[MozillaWindowClass]')
                WinSetOnTop('CLASS:[MozillaWindowClass]', '', 0)
                Sleep(5000)
                SplashOff()

 

Share this post


Link to post
Share on other sites
31 minutes ago, goodmanjl531 said:

Thanks, that worked i had to tweak it a bit..

 

$Website = $iNotes
                SplashTextOn($division & " Weblinks", "Loading iNotes" & @CRLF & "Please Wait...", "300", "100", "-1", "50", 0, "Arial Black", "12", "700")
                Run(@ProgramFilesDir & '\Mozilla Firefox\firefox.exe ' & $Website, "", @SW_MAXIMIZE)
                WinSetOnTop($Form1, '', 0)
                ;WinWaitActive('CLASS:[MozillaWindowClass]')
                WinSetOnTop('CLASS:[MozillaWindowClass]', '', 0)
                Sleep(5000)
                SplashOff()

 

I am in the process of doing something similar, but have not started it yet. I believe the best way to do this is to create an INI file, maybe even let the end user update it via the script -so that would mean another type  of GUI, so that the user can put the name of the  link as well as the URL to be saved in the INI file. That way if any sites change, or they want to create their own links, they can do so. With your GUI design, this might not work so well, as you are using buttons, but it could be used with a dropdown control too.


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now