Jump to content

Question About Combo


Recommended Posts

It's Me Again LOL :)

i know that to create a combo the source is :

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $msg
    GUICreate("My GUI combo") ; will create a dialog box that when displayed is centered

    GUICtrlCreateCombo("", 10, 10); create first item
    GUICtrlSetData(-1, "item2|item3", "item3"); add other item snd set a new default
    GUISetState()

   ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
EndFunc  ;==>Example

But can this combo display the programs currently runned on the taskbar ?

ty in advance

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

can auto it do that ? please i need it verry much :)

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

something like this:

#include <GUIConstantsEx.au3>
$Form1 = GUICreate("My GUI combo")
$Combo1 = GUICtrlCreateCombo("", 10, 10, 200)
$Combo2 = GUICtrlCreateCombo("",210, 10, 100)
GUICtrlSetData(-1, "Applications|Processes", "Applications")
GUISetState(@SW_SHOW)
_DisplaySelection()
While 1
    $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then Exit
        if $msg = $Combo2 then _DisplaySelection()
WEnd
func _DisplaySelection()
    Local $newData = ""
    if GUICtrlRead($Combo2) = "Applications" Then
        $var = WinList()
        For $i = 1 to $var[0][0]
            If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
                if $newData = "" Then
                    $newData = "[Applications]|" & $var[$i][0]
                    $newDataFirst = "[Applications]"
                Else
                    $newData = $newData & "|" & $var[$i][0]
                EndIf
            EndIf
        Next
        GUICtrlSetData($Combo1, "")
        GUICtrlSetData($Combo1, $newData, $newDataFirst)
    Else
        $var = ProcessList()
        for $i = 1 to $var[0][0]
            if $newData = "" Then
                $newData = $var[$i][0]
                $newDataFirst = $var[$i][0]
            Else
                $newData = $newData & "|" & $var[$i][0]
            EndIf
        Next
        GUICtrlSetData($Combo1, "")
        GUICtrlSetData($Combo1, $newData, $newDataFirst)
    EndIf
EndFunc
Func IsVisible($handle)
    If BitAnd( WinGetState($handle), 2 ) Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc
Link to comment
Share on other sites

yes but i think there is something sereously wrong :)

cuz i give an example i have Progress opened called "PhOeniXAnGeL | 3700" and it displays "PhOeniXAnGeL" "3700" in 2 lines or so and with othere applications and prosseses is the same :)

#sry for bad english

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

can someone fix his code pls ?

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

it means 1 program on the task bar is showing 2 times and ..... 1 of that is wrong sry my english is verry bad :S

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

i will say again i'm playing a game on the taksbar the game name is "PhOeniXAnGeL | 3700" and in the program is showing in 2 lines "PhOeniXAnGeL" and "3700" and when i try to use with othere functions it gives error :S

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

so can't anyone fix it plsss ?

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

#include <GUIConstantsEx.au3>
#include <GUIComboBox.au3>
$Form1 = GUICreate("My GUI combo", 320, 40)
$Combo1 = GUICtrlCreateCombo("", 10, 10, 200)
$Combo2 = GUICtrlCreateCombo("",210, 10, 100)
GUICtrlSetData(-1, "Applications|Processes", "Applications")
GUISetState(@SW_SHOW)
_DisplaySelection()
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    if $msg = $Combo2 then _DisplaySelection()
WEnd
func _AddingItems($Name, $number)
    if GUICtrlRead($Combo1) = "" Then
        if $number = 1 Then
            _GUICtrlComboBox_InsertString($Combo1, "[Applications]", 0)
        Else
            _GUICtrlComboBox_InsertString($Combo1, $Name, 0)
        EndIf
        _GUICtrlComboBox_SetCurSel($Combo1, 0)
    Else
        _GUICtrlComboBox_InsertString($Combo1, $Name)
    EndIf
EndFunc
func _DisplaySelection()
    GUICtrlSetData($Combo1, "");delete previous data in combobox
    if GUICtrlRead($Combo2) = "Applications" Then
        $var = WinList()
        For $i = 1 to $var[0][0]
            If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
                _AddingItems($var[$i][0], 1)
            EndIf
        Next
    Else
        $var = ProcessList()
        for $i = 1 to $var[0][0]
            _AddingItems($var[$i][0], 2)
        Next
    EndIf
EndFunc
Func IsVisible($handle)
    If BitAnd( WinGetState($handle), 2 ) Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc

Edited by sandin
Link to comment
Share on other sites

thank you bro for all your help i'm realy grateful :) if u have skype , msn , yahoo , icq please contact me i need to ask u 1 more question

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

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...