Jump to content

Different style settings?


Roofel
 Share

Recommended Posts

Hello:) I just wonder, What "Style" do i have to use on GuiCreate to get the GUI to be always ontop? Just like the Windows Task Manager, How can i make it always appear ontop?:)

Tried looking through the AutoIt Help but couldnt find anything in the different styles about it:S even tried some but didnt work...

Also another thing:)

How can i get a window to restore after doubleclicking/clicking on the tray icon? and getting a window to close without exitting the script?^^,

Hope you can help, Roofel:)

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

Link to comment
Share on other sites

you must use $TRAY_EVENT_PRIMARY_DOUBLE to check if the icon is double-clicked...then to restore put under it.. GUISetState(@SW_SHOW, $gui)

Not sure about a style about it...but you could always put in your loop WinSetOnTop($gui)

Hope this helps Roofel :)

Link to comment
Share on other sites

and if I'm allowed to ask, where do i put the $TRAY_EVENT_PRIMARY_DOUBLE? Inside the While 1 group or somewhere else?:)

I now got a idea on how to restore the window but how to close it?:) When i click the "X" button it closes the script:S

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

Link to comment
Share on other sites

Of Course you can ask anything :)

its Supposted to close the script...but you can change that...where $GUI_EVENT_CLOSE is...under it...instead of Exit...put GUISetState(@SW_HIDE, $gui)

and that will make the window disappear...but the script will still be running...then...Do this...inside your loop

$tray = TrayGetMsg()

Select

Case $tray = $GUI_EVENT_PRIMARY_DOUBLE

GUISetState(@SW_SHOW, $gui)

Edited by Swift
Link to comment
Share on other sites

Hmm, getting an error, the GUI_EVENT_PRIMARY_DOUBLE is taken as a Variable i gotta declare first:S

Any idea on how i can get past this?:)

Edit: This isnt a future added in the beta files is it? Got both installed on my computer but using Release version at the moment=)

Edit2: Not in the beta either.

Edited by Roofel

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

Link to comment
Share on other sites

I got it included since i basicly need it on every script i got but it still gives and error message:S

You using Beta files or Release files?

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

Link to comment
Share on other sites

I got it included since i basicly need it on every script i got but it still gives and error message:S

You using Beta files or Release files?

Release...hmm...? Go do a forum search for PassSecure...and get the source file..look at the source...it has that...and it works...? Am I missing something any 'higher' person than me? Why doesnt this work?

Link to comment
Share on other sites

Nope:S nothing in any of them, looked through every of the Include files, none had any words about PRIMARY_DOUBLE

Checking the beta file Includes now

Not in the beta Includes either:S Where the bloody hell is it?:S

Edit: I searched for PassSecure and found only mine and this thread

http://www.autoitscript.com/forum/index.ph...p;hl=PassSecure

Searched all the include files and the source for the Keyword but found none...

Edited by Roofel

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

Link to comment
Share on other sites

Nope:S nothing in any of them, looked through every of the Include files, none had any words about PRIMARY_DOUBLE

Checking the beta file Includes now

Not in the beta Includes either:S Where the bloody hell is it?:S

Edit: I searched for PassSecure and found only mine and this thread

http://www.autoitscript.com/forum/index.ph...p;hl=PassSecure

Searched all the include files and the source for the Keyword but found none...

The GUIConstants.au3 has changed... :)

Use #Include <Constants.au3> and you should be right. :)

Link to comment
Share on other sites

Thanks Bert:) Found it while searching also, it wasnt $TRAY_EVENT_PRIMARY_DOUBLE but $TRAY_EVENT_PRIMARYDOUBLE:P

One thing also:S When i put the Variable under TrayGetMsg()

The window closes(Supposed to go into tray) but then it just shows up again:S Any ideas? Here is the script part. Tried all the different places and also tried SECONDARYDOUBLE....

#include <Constants.au3>
#include <IE.au3>
#include <GUIListbox.au3>

Opt("TrayMenuMode",1)
Opt("GUIDataSeparatorChar",2)
HotKeySet("{Esc}", "Close");For use while testing:)


$Form1= GUICreate("Find Airlines!", 403, 251, 616, 455)
$Group1= GUICtrlCreateGroup("Search", 8, 8, 385, 233)
$Button1= GUICtrlCreateButton("Google", 72, 72, 81, 49, 0)
$Button2= GUICtrlCreateButton("Yahoo!", 160, 72, 81, 49, 0)
$Button3= GUICtrlCreateButton("Kvasir", 248, 72, 81, 49, 0)
$Label2= GUICtrlCreateLabel("With", 20, 87, 52, 25)
$List1= GUICtrlCreateList("", 32, 123, 337, 71)
$Input1= GUICtrlCreateInput("", 80, 39, 193, 21)
$Label1= GUICtrlCreateLabel("Search for", 16, 40, 52, 17)
$Listbtn=GUICtrlCreateButton("Add search to list", 280, 30, 100, 40)
$Writebtn=GUICtrlCreateButton("Save searches", 32, 200, 169, 30)
$Remove=GUICtrlCreateButton("Remove selected", 202, 200, 169, 30)
$Menu=GUICtrlCreateContextMenu($List1)
$Item1=GUICtrlCreateMenuItem("Add to search bar", $Menu)
$Item2=GUICtrlCreateMenuItem("Remove from list", $Menu)
$Iniload=IniRead("Search.ini", "Main", "Data", "")
$Restore=TrayCreateItem("Restore Window")
$Nothing=TrayCreateItem("")
$About=TrayCreateItem("About")
$Exit=TrayCreateItem("Exit program")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
GUICtrlSetData($List1, $Iniload)


While 1
    $nMsg = GUIGetMsg()
    WinSetOnTop($Form1, "", 1)
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUISetState(@SW_HIDE, $Form1)
        Case $Listbtn
            GUICtrlSetData($List1,Guictrlread($Input1))
        Case $Remove
            _GUICtrlListBox_GetCurSel($List1)
            _GUICtrlListBox_DeleteString($List1,1)
        Case $Writebtn
            IniWrite("Search.ini", "Main", "Data", GUICtrlRead($List1))
        Case $Button1
            _IECreate('http://www.google.com/search?q='&GUICtrlRead($Input1),1,1,0)
        Case $Button2
            _IECreate("http://www.kvasir.no/nettsok/searchResult.html?searchExpr="&GuiCtrlRead($Input1), 1,1,0)
        Case $Button3
            _IECreate("http://search.yahoo.com/search;_ylt=A0geu9fhcrlHOHUB1JxXNyoA?p="&GUICtrlRead($Input1), 1,1,0)
        Case $Item1
            GUICtrlSetData($Input1, GuictrlRead($List1))
        Case $Item2
            _GUICtrlListBox_GetCurSel($List1)
            _GUICtrlListBox_DeleteString($List1,1)
    EndSwitch
    $Msg=TrayGetMsg()
    Select
        Case $Msg=$Restore
            GUISetState(@SW_SHOW, $Form1)
        Case $Msg=$About
            MsgBox(64, "about:", "This program was created by Roofel using the amazing software AutoIt")
        Case $Msg=$Exit
            Exit
    EndSelect
WEnd

Func Close()
    Exit
EndFunc

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

Link to comment
Share on other sites

I have no idea what your asking. Do you mean?

#include <Constants.au3>
#include <IE.au3>
#include <GUIListbox.au3>

Opt("TrayMenuMode",1)
Opt("GUIDataSeparatorChar",2)
TraySetClick (8)
HotKeySet("{Esc}", "Close");For use while testing:)


$Form1= GUICreate("Find Airlines!", 403, 251, 616, 455)
$Group1= GUICtrlCreateGroup("Search", 8, 8, 385, 233)
$Button1= GUICtrlCreateButton("Google", 72, 72, 81, 49, 0)
$Button2= GUICtrlCreateButton("Yahoo!", 160, 72, 81, 49, 0)
$Button3= GUICtrlCreateButton("Kvasir", 248, 72, 81, 49, 0)
$Label2= GUICtrlCreateLabel("With", 20, 87, 52, 25)
$List1= GUICtrlCreateList("", 32, 123, 337, 71)
$Input1= GUICtrlCreateInput("", 80, 39, 193, 21)
$Label1= GUICtrlCreateLabel("Search for", 16, 40, 52, 17)
$Listbtn=GUICtrlCreateButton("Add search to list", 280, 30, 100, 40)
$Writebtn=GUICtrlCreateButton("Save searches", 32, 200, 169, 30)
$Remove=GUICtrlCreateButton("Remove selected", 202, 200, 169, 30)
$Menu=GUICtrlCreateContextMenu($List1)
$Item1=GUICtrlCreateMenuItem("Add to search bar", $Menu)
$Item2=GUICtrlCreateMenuItem("Remove from list", $Menu)
$Iniload=IniRead("Search.ini", "Main", "Data", "")
$Restore=TrayCreateItem("Restore Window")
TrayCreateItem("")
$About=TrayCreateItem("About")
TrayCreateItem("")
$Exit=TrayCreateItem("Exit program")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
GUICtrlSetData($List1, $Iniload)


While 1
    $nMsg = GUIGetMsg()
    WinSetOnTop($Form1, "", 1)
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUISetState(@SW_HIDE, $Form1)
        Case $Listbtn
            GUICtrlSetData($List1,Guictrlread($Input1))
        Case $Remove
            _GUICtrlListBox_GetCurSel($List1)
            _GUICtrlListBox_DeleteString($List1,1)
        Case $Writebtn
            IniWrite("Search.ini", "Main", "Data", GUICtrlRead($List1))
        Case $Button1
            _IECreate('http://www.google.com/search?q='&GUICtrlRead($Input1),1,1,0)
        Case $Button2
            _IECreate("http://www.kvasir.no/nettsok/searchResult.html?searchExpr="&GuiCtrlRead($Input1), 1,1,0)
        Case $Button3
            _IECreate("http://search.yahoo.com/search;_ylt=A0geu9fhcrlHOHUB1JxXNyoA?p="&GUICtrlRead($Input1), 1,1,0)
        Case $Item1
            GUICtrlSetData($Input1, GuictrlRead($List1))
        Case $Item2
            _GUICtrlListBox_GetCurSel($List1)
            _GUICtrlListBox_DeleteString($List1,1)
    EndSwitch
    
    $Msg=TrayGetMsg()
    Select
        Case $Msg=$Restore
            GUISetState(@SW_SHOW, $Form1)
        Case $Msg=$About
            MsgBox(64, "About:", "This program was created by Roofel using the amazing software AutoIt")
        Case $Msg=$Exit
            Exit
        Case $Msg = $TRAY_EVENT_PRIMARYDOUBLE
            GUISetState(@SW_SHOW, $Form1)
    EndSelect
WEnd

Func Close()
    Exit
EndFunc
Link to comment
Share on other sites

I have no idea what your asking. Do you mean?

#include <Constants.au3>
#include <IE.au3>
#include <GUIListbox.au3>

Opt("TrayMenuMode",1)
Opt("GUIDataSeparatorChar",2)
TraySetClick (8)
HotKeySet("{Esc}", "Close");For use while testing:)


$Form1= GUICreate("Find Airlines!", 403, 251, 616, 455)
$Group1= GUICtrlCreateGroup("Search", 8, 8, 385, 233)
$Button1= GUICtrlCreateButton("Google", 72, 72, 81, 49, 0)
$Button2= GUICtrlCreateButton("Yahoo!", 160, 72, 81, 49, 0)
$Button3= GUICtrlCreateButton("Kvasir", 248, 72, 81, 49, 0)
$Label2= GUICtrlCreateLabel("With", 20, 87, 52, 25)
$List1= GUICtrlCreateList("", 32, 123, 337, 71)
$Input1= GUICtrlCreateInput("", 80, 39, 193, 21)
$Label1= GUICtrlCreateLabel("Search for", 16, 40, 52, 17)
$Listbtn=GUICtrlCreateButton("Add search to list", 280, 30, 100, 40)
$Writebtn=GUICtrlCreateButton("Save searches", 32, 200, 169, 30)
$Remove=GUICtrlCreateButton("Remove selected", 202, 200, 169, 30)
$Menu=GUICtrlCreateContextMenu($List1)
$Item1=GUICtrlCreateMenuItem("Add to search bar", $Menu)
$Item2=GUICtrlCreateMenuItem("Remove from list", $Menu)
$Iniload=IniRead("Search.ini", "Main", "Data", "")
$Restore=TrayCreateItem("Restore Window")
TrayCreateItem("")
$About=TrayCreateItem("About")
TrayCreateItem("")
$Exit=TrayCreateItem("Exit program")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
GUICtrlSetData($List1, $Iniload)


While 1
    $nMsg = GUIGetMsg()
    WinSetOnTop($Form1, "", 1)
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUISetState(@SW_HIDE, $Form1)
        Case $Listbtn
            GUICtrlSetData($List1,Guictrlread($Input1))
        Case $Remove
            _GUICtrlListBox_GetCurSel($List1)
            _GUICtrlListBox_DeleteString($List1,1)
        Case $Writebtn
            IniWrite("Search.ini", "Main", "Data", GUICtrlRead($List1))
        Case $Button1
            _IECreate('http://www.google.com/search?q='&GUICtrlRead($Input1),1,1,0)
        Case $Button2
            _IECreate("http://www.kvasir.no/nettsok/searchResult.html?searchExpr="&GuiCtrlRead($Input1), 1,1,0)
        Case $Button3
            _IECreate("http://search.yahoo.com/search;_ylt=A0geu9fhcrlHOHUB1JxXNyoA?p="&GUICtrlRead($Input1), 1,1,0)
        Case $Item1
            GUICtrlSetData($Input1, GuictrlRead($List1))
        Case $Item2
            _GUICtrlListBox_GetCurSel($List1)
            _GUICtrlListBox_DeleteString($List1,1)
    EndSwitch
    
    $Msg=TrayGetMsg()
    Select
        Case $Msg=$Restore
            GUISetState(@SW_SHOW, $Form1)
        Case $Msg=$About
            MsgBox(64, "About:", "This program was created by Roofel using the amazing software AutoIt")
        Case $Msg=$Exit
            Exit
        Case $Msg = $TRAY_EVENT_PRIMARYDOUBLE
            GUISetState(@SW_SHOW, $Form1)
    EndSelect
WEnd

Func Close()
    Exit
EndFunc
Exactly what i needed:) Thanks alot mate^^,

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...