Abilio_KID Posted August 20, 2004 Posted August 20, 2004 hehehe, I'm having fun with the transparent thing. Try this: while 1 for $n = -254 to 254 step 5 WinSetTrans("Program Manager", "", abs($n)) next wend Aparently you can apply transparency to the desktop, altough there's nothing behind it anyway (black, that is). Oh, it's supposed to go from 0 to 255, right? If I use 255 then it becomes black (in the example the window would blick when reaching 255).
this-is-me Posted August 20, 2004 Posted August 20, 2004 That can happen when you use windowblinds. Who else would I be?
Administrators Jon Posted August 23, 2004 Author Administrators Posted August 23, 2004 Updated: - OnAutoItStart() and OnAutoItExit() user functions are called on start/exit - Default exit function can be changed with Opt("OnExitFunc", "funcname") - Extra parameter added to ControlCommand - Last two parameters of ControlCommand are optional - New "commands" for ControlCommand: "LV_GetItemCount" "LV_GetSubItemCount" "LV_GetItem", Item, SubItem "LV_GetSelectedCount" No doc/installer update though as I'm in coding mode... Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
tylo Posted August 24, 2004 Posted August 24, 2004 Updated:- OnAutoItStart() and OnAutoItExit() user functions are called on start/exit- Default exit function can be changed with Opt("OnExitFunc", "funcname")Finally - I've been waiting for this one! blub
Chris_1013 Posted August 24, 2004 Posted August 24, 2004 (edited) Am I missing what's so great about this that you couldn't do before? (and to be fair, I probably am...) Edited August 24, 2004 by Chris_1013
tylo Posted August 24, 2004 Posted August 24, 2004 (edited) Am I missing what's so great about this that you couldn't do before? (and to be fair, I probably am...) <{POST_SNAPBACK}>When the user exits my autoit script from the program-tray, I want do close down another program that was started by the script. Couldn't be done before, I think. /Add: however, I'm not so sure what the purpose is with OnAutoItStart()? Edited August 24, 2004 by tylo blub
tylo Posted August 24, 2004 Posted August 24, 2004 Just want to say that you guys never stop impressing me. I haven't been around for a while, but all the recent new stuff is truly remarkable: Process control, dynamic variable creation/assignment, on-exit callback, etc., let alone the GUI... I can throw away all those small extra tools I needed before. My hat is off. blub
this-is-me Posted August 24, 2004 Posted August 24, 2004 @jon - Hey, maybe in the onexit... func a user could return 0 (or 1) if you do not want to exit at the time. I can see many reasons that a script would want to complete the current operation before exiting. Who else would I be?
tylo Posted August 25, 2004 Posted August 25, 2004 (edited) @jon - Hey, maybe in the onexit... func a user could return 0 (or 1) if you do not want to exit at the time. I can see many reasons that a script would want to complete the current operation before exiting. <{POST_SNAPBACK}>What you want is to use the Break(n) function to disable and enable the user from exiting the script on critical places. Be careful not to set Break(0) too long - the user is likely to use the old Ctrl-Alt-Del to close down your script... /btw: The Break() doc says: "If Break is enabled (1), then the user cannot terminate the script this way." - which I believe is wrong. OnAutoItExit() is like a c++ exception handler - you should take actions needed to clean up, or do emergency handling. A hint is to have a $g_scriptStage variable which you should set to certain values in the different stages of your script. When OnAutoItExit() is called by interrupt from the user, you can check the $g_scriptStage variable, to see which stage the script was in. (A minor issue: OnAutoItExit() has no access to your local varibles in the function that was executed, so you have to rely on globals. The same goes for the Adlib-functions...) tylo. Edited August 25, 2004 by tylo blub
Chris_1013 Posted August 25, 2004 Posted August 25, 2004 I get ya. Only problem I see with this is it changes the way the system tray icon used to work. In my logic, selecting Exit from the system tray icon is a way to quickly kill a script that's gone awry. However, what if it's an OnExit function that's gone awry?
Administrators Jon Posted August 25, 2004 Author Administrators Posted August 25, 2004 Add: however, I'm not so sure what the purpose is with OnAutoItStart()? Symmetry Maybe you would like to hide away all your Opt() settings at the start of the script or something. I don't know. Heh. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
tylo Posted August 25, 2004 Posted August 25, 2004 In my logic, selecting Exit from the system tray icon is a way to quickly kill a script that's gone awry. However, what if it's an OnExit function that's gone awry?An analogy: If you contract a deadly disease, and your only doctor has gone completely mad , you're doomed - sorry. blub
this-is-me Posted August 25, 2004 Posted August 25, 2004 @jon, Does break still work in the onexit function? If so, then that would alleviate the problem I see and allow the script to return to normal operation. In other words, is the break statement tested before, after, or during onexit? Another thing, is onexit called if break is 0 before attempting to close? If so, I vote that the onexit still be called to allow the script to give a messagebox telling the user important information. I also vote for an onpause function. I know this could probably throw a monkeywrench into some things, but I would like to know if the user paused my script so that I can send an email using blat. Is this too much to ask? Who else would I be?
Administrators Jon Posted August 25, 2004 Author Administrators Posted August 25, 2004 @jon, Does break still work in the onexit function? If so, then that would alleviate the problem I see and allow the script to return to normal operation. In other words, is the break statement tested before, after, or during onexit? Another thing, is onexit called if break is 0 before attempting to close? If so, I vote that the onexit still be called to allow the script to give a messagebox telling the user important information. I also vote for an onpause function. I know this could probably throw a monkeywrench into some things, but I would like to know if the user paused my script so that I can send an email using blat. Is this too much to ask? When the script is exited the stacks are rolled back (so any functions in progress are exited) until the script is at the normal "global" scope. Then the onexit function is called and works like a normal function - there are no restrictions on what you can do in there. The only thing that _is_ different is that if you exit the onexit function you won't get into problems where onexit is called again. It is only ever called once. Break has no effect on if the onexit function is called or not. It is always called if it exists. What you choose to do in there is up to you though. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
this-is-me Posted August 25, 2004 Posted August 25, 2004 Is there a way to allow the onexit to be called while the current script is paused, but be ready to jump back in if break(0) is called inside of onexit? Also, what about the onpause? maybe? Who else would I be?
Administrators Jon Posted August 26, 2004 Author Administrators Posted August 26, 2004 Updated:http://www.autoitscript.com/autoit3/files/unstable/autoit/Some neato stuff here (no docs though...) let me know how you get on with them. I've only tested them with an explorer window so far but it seems to work pretty well.- Added: HWND datatype added to variants- Added: ControlGetHandle()- Added: ControlCommand(): SysListView32 commands addedExtra listview ControlCommands are:- LV_GetItemCount- LV_GetSubItemCount- LV_GetText, index, subindex- LV_SelectAll- LV_SelectClear- LV_IsSelected, index- LV_Select, from index, [to index]- LV_Deselect, from index, [to index]- LV_GetSelected, [0 = single/first, 1 = multiple delimited by | ]Tech:Larry mentioned that to get these control functions to work you had to do shared process memory stuff like in StatusBarGetText. Oh yes. And it is REALLY annoying so i've written a new class that allows you to allocate and write to shared memory without having to worry about the differences between NT and 95 (not to mention the fact that you have to dynamically load the functions to maintain 9x compatibility) Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
Valik Posted August 27, 2004 Posted August 27, 2004 Jon, I've found two bugs. 1) GUICreate() doesn't appear to return a handle that you can use as is, it still needs to be in the "handle=" & GuiCreate() form. 2) The following code has a problem: Opt("WinTitleMatchMode", 4) Opt("TrayIconDebug", 1) $hwnd = "handle=" & GUICreate("Test", 100, 100) GUIShow() While WinExists($hwnd) $msg = GUIMsg(0) If $msg = -3 Then GUIDelete() Wend The problem is, the GUI is properly deleted (Spy++ confirms this), however, the loop is never exited, so the GUI is closed, but the script never exits.
jpm Posted August 27, 2004 Posted August 27, 2004 @jon, When do you expect to upload source and doc so I can preintegrate the Holger-gui stuff and bug corrections?
Administrators Jon Posted August 27, 2004 Author Administrators Posted August 27, 2004 Jon, I've found two bugs. 1) GUICreate() doesn't appear to return a handle that you can use as is, it still needs to be in the "handle=" & GuiCreate() form. 2) The following code has a problem: Opt("WinTitleMatchMode", 4) Opt("TrayIconDebug", 1) $hwnd = "handle=" & GUICreate("Test", 100, 100) GUIShow() While WinExists($hwnd) $msg = GUIMsg(0) If $msg = -3 Then GUIDelete() Wend The problem is, the GUI is properly deleted (Spy++ confirms this), however, the loop is never exited, so the GUI is closed, but the script never exits. Heh, I didn't even realize that GuiCreate returned a handle :"> Fixed now. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
Valik Posted August 27, 2004 Posted August 27, 2004 Heh, I didn't even realize that GuiCreate returned a handle :"> Fixed now. <{POST_SNAPBACK}>Thanks Jon, works great now.
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