Sign in to follow this  
Followers 0
TomaSzz

how to get all open window titles into a dropdown menu

38 posts in this topic

#1 ·  Posted (edited)

so as the title says :mellow: how do u get all windows that are open to a dropdown box?u use WinGetTitle() but how to get all open windows?even if they are minimized..

[i did try to search forum but i cant.. <_< ]

Posted Image

p.s. heres code ive done so far..just cant get the dropdown box with all titles of open windows

#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <EditConstants.au3>


Opt("WinTitleMatchMode", 2) ; Match substring

    Local $Button_1, $Button_2, $msg, $slider, $title_get, $trans, $trans1, $get
    GUICreate("window Trasparenting", 200, 100) ; will create a dialog box that when displayed is centered

    $trans1 = GUICtrlCreateLabel("Set the transparency of the window", 1, 45, 200, 13)
    $slider = GUICtrlCreateSlider( 1, 60, 100, 20)
    GUICtrlSetLimit(-1, 250, 0)
    $get = GUICtrlCreateInput("", 0, 15, 200, 20)
    $trans = GUICtrlCreateLabel("Enter the window title here:", 1, 1, 123, 13)

    GUISetState()      ; will display an  dialog box with 2 button

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button_1
                $trans = 0
                $trans1 = GUICtrlRead($slider)
                do
                WinSetTrans("Notepad", "", GuiCtrlRead($slider))
                $trans = $trans + 1
                until $trans = $trans1
            Case $msg = $Button_2
                MsgBox(0, 'Testing', 'Button 2 was pressed')    ; Will demonstrate Button 2 being pressed
            Case $msg = $slider
                $trans = 0
                $trans1 = GUICtrlRead($slider)
                do
                WinSetTrans(GUICtrlRead($get), "", GuiCtrlRead($slider))
                $trans = $trans + 1
                until $trans = $trans1
        EndSelect
    WEnd
Edited by TomaSzz

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Well, I would start with _WinAPI_EnumWindows to get a list of all windows, then enumerate through the array and eliminate those that don't match your criteria (WinGetState) and display those with _GUICtrlComboBox_Create and its counterparts.

I'm still a beginner, but if nobody else smarter than I responds to this, then I'll try to see if I can work some code for you.

Edit: I feel like editing something.

Edited by borderLine

Share this post


Link to post
Share on other sites

hehe ..ok ... u explained it all in one small piece.. hard for me to understand it,yet i first time now see the codes of wat u sayd :mellow:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ive another question now too... working over al night on an anti cheat ..and finaly the good stuff came..but one little thing i rly need on it is ..how to make for examaple

Func CheatList() ;CheatList,the main feature where all cheats are scanned.CheatList calls back to engine in order start the scan of this list again
While 1
    If ProcessExists("Cheat Engine.exe") Or WinExists("Cheat Engine", "Cheat Engine") Then
        Sleep(500)
        ProcessClose("Cheat Engine.exe")
        Sleep(100)
        MsgBox(0 , "AntiCheat", "There was a cheat,hack or exploit detected and it was shut down", 2000)
        
        Call("engine")
    EndIf
WEnd
EndFunc



;here i dont know how to put the thing in order... i want this part to scan for one file only while CheatList is always scanning...but look ill try now.. but i think its wrong>

While CheatList()
      Do
          while 1
          if not processexists("Security.dll.exe") then
                 run("Security.dll.exe")
          endif
          wend
wend
;and i just tryed this part now while posting
Edited by TomaSzz

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

While CheatList() <-- Func CheatList() needs to return a 1 for this to be executed.

and Do needs a corresponding Until statement.

and if that file isn't guaranteed to be there, then it needs to be checked, or you might end up in an infinite loop looking for it

Edited by borderLine

Share this post


Link to post
Share on other sites

thnx man rly apreciate ur help :P:mellow:

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

While CheatList()
          if not processexists("Security.dll.exe") then
                 run("Security.dll.exe")
          endif
wend
wouldnt this be it? :mellow:

sheize,...dbl psot

Edited by TomaSzz

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Looks much cleaner.

What about CheatList() not returning anything for your while statement?

Between the Wend and the Endfunc, you need to determine if the CheatList() routine detected what you wanted it to detect, and Return a value that your while statement can act upon.

Edited by borderLine

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I don't understand that msg, Jos. Is there another topic he started that would give more insight?

Edited by borderLine

Share this post


Link to post
Share on other sites

I don't understand that msg, Jos. Is there another topic he started that would give more insight?

Not sure why you ask as I was quoting TomaSzz his post but I this is what I am referring too: #804136

by the way, you want to put a Sleep(10) in the While...Wend loop to avoid CPU utilization.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

I have the impression I haven't been clear yesterday. you did read it ..right?

i did read.. im sry i know i made mistake :mellow:

and btw as ur dev i think u will know this problem that just occured few min ago..

i might of pressed something wrong

when i type in autoit this sign " with number 2 below F1 it gives me this @ andthen i type @ near # it gives me "

how to make it like it was? coz i dont like this way ...rly annoying..and btw remove my dbl post if u want i dont mind :P

P.S. thnx borderLine but that way it would then do a loop around it all .. so i might aswell that way make another func... but wat i rly want is that last thing o loop forever until the .exe is shut down and while everytin else is running in the script

Edited by TomaSzz

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

That's smart. I never look for that because I always make really long message loops ¦)

Edit: about the Sleep()

Edited by borderLine

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I've looked over the information that Jos provided, and I'm thinking that he's using his Dev status to pick on people. These are all honest questions, and everything TomaSzz did seemed like he was just trying to get an answer to his question that wasn't getting answered and then this cop showed up that started hard-assing him just like right here.

Edited by borderLine

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

yes US :mellow: but with US it was just few min like i want to .. but its not atm..and btw.. this problem is only on autoit i created text file tryed tehre and it worked as i want it to

Edited by TomaSzz

Share this post


Link to post
Share on other sites

i did read.. im sry i know i made mistake :mellow:

No you don't as you continue.

You better take these comments serious as I am too about what I have said.

... and I am not going to help you as long as you cannot blend in here.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

No you don't as you continue.

You better take these comments serious as I am too about what I have said.

... and I am not going to help you as long as you cannot blend in here.

wat'd i do now? -.-

Share this post


Link to post
Share on other sites

I've looked over the information that Jos provided, and I'm thinking that he's using his Dev status to pick on people. These are all honest questions, and everything TomaSzz did seemed like he was just trying to get an answer to his question that wasn't getting answered and then this cop showed up that started hard-assing him just like right here.

sorry ? Pick on people ?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

i did say sry ... this time its u who needs to calm down

Share this post


Link to post
Share on other sites

You need to lay off, Jos. We were having a nice, decent, calm discussion about AutoIt programming befvore you showed up and started causing trouble.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0