Sign in to follow this  
Followers 0
gamerman2360

Help, someting is wrong, don't know what...

7 posts in this topic

#1 ·  Posted (edited)

It is supposed to hide windows and add them to a 2D array, sort the array, add the window names to a list, and when selected, show the window, ect, ect... You will have to read the script to get everything. For some reason letting it refreash makes everything go crazy(the var that indexes the hidden windows, $hiddenwindows, goes bad). I must have done something wrong. Can someone help? The entire thing is still unfinished. I'll upload it in a file because I build this script for quality vs. getting the job done, so (at least to me) it has more stuff then what can easily be read without SciTE.

Edited by gamerman2360

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I glanced quickly through and found something irrelevant.. (but not involving your problem)

If @Compiled Then
    GUISetHelp("""" & @ScriptFullPath & """ /ToolTip")
Else
    $helpmsg = "Once you have selected to use the hotkey," & @CRLF & _
                "you can press the {F9} key to hide any" & @CRLF & _
                "window.  Then you can come back to this" & @CRLF & _
                "window to show them again."
    GUISetHelp(@AutoItExe & ' /AutoIt3ExecuteLine "$help = Opt(''TrayIconHide'', 1) & ToolTip(''$helpmsg$'', 10, 10) & Sleep(15000)"')
EndIf

Can be replaced by:

$helpmsg = "Once you have selected to use the hotkey," & @CRLF & _
                "you can press the {F9} key to hide any" & @CRLF & _
                "window.  Then you can come back to this" & @CRLF & _
                "window to show them again."
    GUISetHelp(@AutoItExe & ' /AutoIt3ExecuteLine "$help = Opt(''TrayIconHide'', 1) & ToolTip(''$helpmsg$'', 10, 10) & Sleep(15000)"')

Read the help file:

Form3: Compiled.exe [/ErrorStdOut][/AutoIt3ExecuteScript file] [params ...]

Execute from an compiled AutoIt3 Script File another script file. Like that you don't need to fileinstall another copy of the AutoIT3.exe in you compiled file.

Form4: AutoIt3.exe [/ErrorStdOut] /AutoIt3ExecuteLine "command line"

Execute one line of code.

#)

EDIT:

Line 98:

Case 0, -4 To -13

... Please avoid "magic" numbers. Use constants...

Edited by nfwu

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

:) I like magic numbers... Constants make the compiled script bloated.... And besides, would: "Case 0, $GUI_EVENT_MINIMIZE To $GUI_EVENT_DROPPED" look any better, who knows whats between $GUI_EVENT_MINIMIZE and $GUI_EVENT_DROPPED, unless of course you want me to type in all the vars for the 10 events..... I guess I could include a comment telling what the numbers mean tho..

The reason I'm doing what I'm doing with the help message is because now if it is compiled it won't have that tray icon appear for 750ms... Also because that is what I origionaly had but I found out I can't run the script more than once :mellow:. [edit] That reminds me, is there a way to get a #NoTrayIcon into an /AutoIt3ExecuteLine?

Edited by gamerman2360

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Try writing the script to a au3 file then run it using:

Form3: Compiled.exe [/ErrorStdOut] [/AutoIt3ExecuteScript file] [params ...]

Execute from an compiled AutoIt3 Script File another script file. Like that you don't need to fileinstall another copy of the AutoIT3.exe in you compiled file.

#)

EDIT: In code, it'll look sth like:

FileDelete ( @TempDir&"\temp.au3" )
FileWrite(@TempDir&"\temp.au3", "#NoTrayIcon"&@CRLF)
FileWrite(@TempDir&"\temp.au3", ";;;CODE HERE"&@CRLF )  ;;Put Code u want to exe here.
Run(@AutoItEXE & " /AutoIt3ExecuteScript """ & @TempDir & "\temp.au3"""" )
FileDelete ( @TempDir&"\temp.au3" )
Edited by nfwu

Share this post


Link to post
Share on other sites

Would it be better to use ListView instead of List?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Ok, to make it better to help(or ignore) me, I have took some time and commented everything in the attached file. I am thinking of throwing away that dang list control and trying a listview. Think it would work?

[edit]

Nvm, I don't really care anymore. Thanks to those 4 who at least tried to download the files.

Edited by gamerman2360

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

So close yet so far away... This now works a lot better than the first one did but it still dosn't work right. ListView is a lot better than List. I think the problem is when it tries to show the window again but im not sure. Can someone look at it and tell me what they think?

Hidden_ListView.au3

Edited by gamerman2360

Share this post


Link to post
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
Sign in to follow this  
Followers 0