Jump to content

Gui Questions... 1) Dynamic Content


ioliver
 Share

Recommended Posts

I'm trying to create a Gui that will list all open windows, using results from WinList(). Ideally, I'd like to have the Window Titles listed as a Label, that can be clicked on, and when clicked will bring the corresponding window to the front.

So, here's my question... Is there a way to add Dynamic content to a form? If so, I don't mind doing the research, just point me in the right direction. I'm very new to the GUI functions.

Thanks for your time, let me know if you need more information,

Ian

BTW, I'd like to evntually use this functionality in a Kiosk Script.

EDIT: Corrected spelling error

Edited by ioliver

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Link to comment
Share on other sites

  • Developers

So, here's my question...  Is there a way to add Dynamic content to a form?  If so, I don't mind doing the research, just point me in the right direction.  I'm very new to the GUI functions.

EDIT: Corrected spelling error

<{POST_SNAPBACK}>

Don't see why not.

You have a While.. wend loop, so you can scan for windows and when they change update your GUI control with GUISetData()...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Thanks JdeB,

I started working with that... Here's what I have:

#Include <GUIConstants.au3>

GUICreate("Open Windows", 250, 400, 25, 25)
  $owlctrl = GUICtrlCreateList("Open Window List", 15, 15)
  
GUISetState()

While 1
   $owlist = WinList()
   For $i = 1 To $owlist[0][0]
      GUICtrlSetData($owlctrl, $owlist[$i][0])
   Next
  ;$msg = GUIGetMsg()
   
  ;If $msg = $GUI_EVENT_CLOSE Then ExitLoop
   Sleep(100)
WEnd

My problem is, I can't figure out how to make the 'GUICtrlSetData' list the open windows, rather then replace them... I'm not sure if that clear. Please let me know if more information is needed.

Ideas are welcome.

Thanks,

Ian

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Link to comment
Share on other sites

  • Developers

This should get you started... :idiot:

#Include <GUIConstants.au3>
Global $SWindows = ""

GUICreate("Open Windows", 250, 400, 25, 25)
$owlctrl = GUICtrlCreateList("Open Window List", 15, 15)

GUISetState()

While 1
   $msg = GUIGetMsg()
   If $msg = $GUI_EVENT_CLOSE Then Exit
   $owlist = WinList()
   $Windows = ""
   For $i = 1 To $owlist[0][0]
      If $owlist[$i][0] <> "" And IsVisible($owlist[$i][1]) Then $Windows = $Windows & "|" & $owlist[$i][0]
   Next
   If $SWindows <> $Windows Then
      GUICtrlSetData($owlctrl, $Windows)
      $SWindows = $Windows
   EndIf
WEnd
Func IsVisible($handle)
   If BitAND( WinGetState($handle), 2) Then
      Return 1
   Else
      Return 0
   EndIf
   
EndFunc  ;==>IsVisible

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Ok, I'm trying a new approach. I'm going to create the GUI window after I get the Winlist(). Please look at this code, and let me know how I can imporove it. Right now, the spacing on the buttons is off.

CODE
#Include <GUIConstants.au3>

$owlist = WinList()

GUICreate("Open Windows", 250, 600, 25, 25)

For $i = 1 To $owlist[0][0]

$top = $top + 20

$i = GUICtrlCreateButton($owlist[$i][0], 5, $top)

Next

GUISetState()

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

Thanks for your help,

Ian

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

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