Skizmata Posted July 15, 2007 Share Posted July 15, 2007 I'm still working on the same AS400 manipulation program I have been working on for the past few weeks and making great headway. I would like to make a sort of status window that floats on top and allows me to put information updates in it. I thought about using tooltip but didn't like the look TrayTip is to distracting so I settled on another GUI window and changing the label but am having a hard time figuring out how to set it to AllwaysOnTop. I need something I can throw information on and will remain there as I send() other info to the AS400 window. Also since I haven't got this to work at all yet really can anyone give me a better idea for a status window? All ideas an examples would be welcome and appreciated. Thanks again everyone. P.S. How do I change the mouse pointer to an hourglass or pointer/hourglass? AutoIt changed my life. Link to comment Share on other sites More sharing options...
xcal Posted July 15, 2007 Share Posted July 15, 2007 Look up GUICreate in the help file and scroll down to the extended styles. Or, you can use WinSetOnTop. How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Skizmata Posted July 15, 2007 Author Share Posted July 15, 2007 Thanks xcal I thought thats where the answer should be and attempted some of it but could'nt get it to work. Can anyone tell me why the code below dosent make the status window always on top? #include <GUIConstants.au3> GUICreate("Status Window",500,30,500,1) GUICtrlSetState("Status Window",$WS_EX_TOPMOST) GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd AutoIt changed my life. Link to comment Share on other sites More sharing options...
SadBunny Posted July 15, 2007 Share Posted July 15, 2007 Thanks xcal I thought thats where the answer should be and attempted some of it but could'nt get it to work. Can anyone tell me why the code below dosent make the status window always on top? #include <GUIConstants.au3> GUICreate("Status Window",500,30,500,1) GUICtrlSetState("Status Window",$WS_EX_TOPMOST) GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd GuiCtrlSetState is used for Gui Controls (like buttons, labels, listviews etc). You are trying to manipulate a Gui window, for which you'll need the GuiSetState (or do it in the GuiCreate parameters). Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Skizmata Posted July 15, 2007 Author Share Posted July 15, 2007 GuiCtrlSetState is used for Gui Controls (like buttons, labels, listviews etc). You are trying to manipulate a Gui window, for which you'll need the GuiSetState (or do it in the GuiCreate parameters). I changed the code to this... #include <GUIConstants.au3> GUICreate("Status Window",500,30,500,1) GuiSetState("Status Window",$WS_EX_TOPMOST) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEndoÝ÷ Ø Ý"·¥z-r·µëaxejÖ¥!¢»^Å©©ì(ºW[z÷«Ê¥¥û¥"{az¥¥ø¥yú+èzÔj×¢µÚ,z{lÁ¬+axnjYpk+(Ú)6Ü¢é]!ø§u©ò¶§)ÆP«y«^iº.¶+S+¡×ÛazƦzØb®¶sb6æ6ÇVFRfÇC´uT6öç7FçG2æS2fwC°¤uT7&VFRgV÷Cµ7FGW2væF÷rgV÷C²ÃSÃ3ÃSÃÂb33cµu5ôUõDõÔõ5B£·âwV6WE7FFRgV÷Cµ7FGW2væF÷rgV÷C²Âb33cµu5ôUõDõÔõ5B¥vÆR¢b33c¶×6rÒuTvWD×6r¢6VÆV7@¢66Rb33c¶×6rÒb33c´uTôUdTåEô4Äõ4P¢W@¢VæE6VÆV7@¥tVæ Thanks for your help. AutoIt changed my life. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 15, 2007 Moderators Share Posted July 15, 2007 WinSetOnTop(GUICreate("Status Window",500,30,500,1), '', 1) GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Skizmata Posted July 15, 2007 Author Share Posted July 15, 2007 @SmOke_N Works wonderfully many many thanks my friend! AutoIt changed my life. Link to comment Share on other sites More sharing options...
Skizmata Posted July 15, 2007 Author Share Posted July 15, 2007 This is still for my AS400 manipulation project at work my problem is when I change something in the GUI status window it doesn't update (see example below) how should I change the example below to allow my status GUI to update when I change something. During my AS400 manipulation I want to be able to let the user know whats going on in the status window. In case you where wondering what the purpose of this was. Thanks again! #include <GUIConstants.au3> WinSetOnTop(GUICreate("Status Window",500,30,500,1,$WS_POPUP), '', 1) $StatusInfo = "Load" GUICtrlCreateLabel ( $StatusInfo, 10, 10 ,-1) GuiSetState() HotKeySet("^a", "ChangeStatusMenu") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func ChangeStatusMenu() $StatusInfo = "Reload" EndFunc AutoIt changed my life. Link to comment Share on other sites More sharing options...
SadBunny Posted July 15, 2007 Share Posted July 15, 2007 (edited) This is still for my AS400 manipulation project at work my problem is when I change something in the GUI status window it doesn't update (see example below) how should I change the example below to allow my status GUI to update when I change something. During my AS400 manipulation I want to be able to let the user know whats going on in the status window. In case you where wondering what the purpose of this was. Thanks again! CODE: AutoIt#include <GUIConstants.au3> WinSetOnTop(GUICreate("Status Window",500,30,500,1,$WS_POPUP), '', 1) $StatusInfo = "Load" GUICtrlCreateLabel ( $StatusInfo, 10, 10 ,-1) GuiSetState() HotKeySet("^a", "ChangeStatusMenu") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func ChangeStatusMenu() $StatusInfo = "Reload" EndFunc To change something in a guictrl, you need to refer to it's "handle". The variable only contains the "Load" or "Reload", but changing a variable will not mean anything unless you do something with it. Try assigning the Label control to a variable, like: $mylabel = GuiCtrlCreateLabel($StatusInfo, 10, 10 ,-1) Then, change the ChangeStatusMenu() to: AutoItFunc ChangeStatusMenu() $StatusInfo = "Reload" GuiCtrlSetData($myLabel,$StatusInfo); <- or just GuiCtrlSetData("Reload") and omit the line before if you don't need this information elsewhere EndFunc /edit: corrected setdata command :"> As a side note, it might be useful to know that the following would also work (only showing the changed lines): ChangeStatusMenu("Reload") Func ChangeStatusMenu($newStatus) $StatusInfo = $newStatus GuiCtrlSetData($myLabel,$newStatus) EndFunc Edited July 15, 2007 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 15, 2007 Moderators Share Posted July 15, 2007 To change something in a guictrl, you need to refer to it's "handle".Your example shows you referring to it's control id, not it's handle ... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
SadBunny Posted July 15, 2007 Share Posted July 15, 2007 Your example shows you referring to it's control id, not it's handle ...Ofcourse Sorry, I get those mixed up sometimes when I talk about them. Using them is way easier than describing them, though! Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Skizmata Posted July 16, 2007 Author Share Posted July 16, 2007 (edited) Thank you very much guys (or girls) Say Bunny your solution seems to work perfectly for want I wanted to do. I really appreciate it! *Update* I've incorporated the Status Window into my program and its working out very well. Thanks again! Edited July 16, 2007 by Skizmata AutoIt changed my life. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now