Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

V3.0.103 Unstable


  • Please log in to reply
113 replies to this topic

#41 Abilio_KID

Abilio_KID

    Wayfarer

  • Active Members
  • Pip
  • 61 posts

Posted 20 August 2004 - 01:09 AM

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







#42 this-is-me

this-is-me

    Pursuer of obscure functionality

  • Active Members
  • PipPipPipPipPipPip
  • 2,466 posts

Posted 20 August 2004 - 12:10 PM

That can happen when you use windowblinds.
Who else would I be?

#43 Jon

Jon

    Up all night to get lucky

  • Administrators
  • 10,470 posts

Posted 23 August 2004 - 08:19 PM

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

#44 tylo

tylo

    Universalist

  • Developers
  • 280 posts

Posted 24 August 2004 - 03:53 PM

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! :ph34r:
blub

#45 Chris_1013

Chris_1013

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 347 posts

Posted 24 August 2004 - 03:56 PM

Am I missing what's so great about this that you couldn't do before? (and to be fair, I probably am...)

Edited by Chris_1013, 24 August 2004 - 03:58 PM.


#46 tylo

tylo

    Universalist

  • Developers
  • 280 posts

Posted 24 August 2004 - 04:04 PM

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 by tylo, 24 August 2004 - 04:09 PM.

blub

#47 tylo

tylo

    Universalist

  • Developers
  • 280 posts

Posted 24 August 2004 - 07:34 PM

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. :ph34r:
blub

#48 this-is-me

this-is-me

    Pursuer of obscure functionality

  • Active Members
  • PipPipPipPipPipPip
  • 2,466 posts

Posted 24 August 2004 - 08:21 PM

@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?

#49 tylo

tylo

    Universalist

  • Developers
  • 280 posts

Posted 25 August 2004 - 07:17 AM

@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 by tylo, 25 August 2004 - 07:42 AM.

blub

#50 Chris_1013

Chris_1013

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 347 posts

Posted 25 August 2004 - 08:25 AM

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?

#51 Jon

Jon

    Up all night to get lucky

  • Administrators
  • 10,470 posts

Posted 25 August 2004 - 08:42 AM

Add: however, I'm not so sure what the purpose is with OnAutoItStart()?

<{POST_SNAPBACK}>

Symmetry :ph34r:

Maybe you would like to hide away all your Opt() settings at the start of the script or something. I don't know. Heh.

#52 tylo

tylo

    Universalist

  • Developers
  • 280 posts

Posted 25 August 2004 - 11:14 AM

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 :ph34r:, you're doomed :( - sorry. :lol:
blub

#53 this-is-me

this-is-me

    Pursuer of obscure functionality

  • Active Members
  • PipPipPipPipPipPip
  • 2,466 posts

Posted 25 August 2004 - 12:27 PM

@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?

#54 Jon

Jon

    Up all night to get lucky

  • Administrators
  • 10,470 posts

Posted 25 August 2004 - 01:23 PM

@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?

<{POST_SNAPBACK}>

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.

#55 this-is-me

this-is-me

    Pursuer of obscure functionality

  • Active Members
  • PipPipPipPipPipPip
  • 2,466 posts

Posted 25 August 2004 - 08:35 PM

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?

#56 Jon

Jon

    Up all night to get lucky

  • Administrators
  • 10,470 posts

Posted 26 August 2004 - 09:49 PM

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 added

Extra 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)

#57 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 27 August 2004 - 12:20 AM

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.

#58 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,643 posts

Posted 27 August 2004 - 06:36 AM

@jon,
When do you expect to upload source and doc so I can preintegrate the Holger-gui stuff and bug corrections? :ph34r:

#59 Jon

Jon

    Up all night to get lucky

  • Administrators
  • 10,470 posts

Posted 27 August 2004 - 08:32 AM

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.

<{POST_SNAPBACK}>

Heh, I didn't even realize that GuiCreate returned a handle :">

Fixed now.

#60 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 27 August 2004 - 12:26 PM

Heh, I didn't even realize that GuiCreate returned a handle :">

Fixed now.

<{POST_SNAPBACK}>

Thanks Jon, works great now. :ph34r:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users