Sign in to follow this  
Followers 0
Diana (Cda)

How to modify this code to work in Win98SE?

23 posts in this topic

I was given this great code to maximize all open windows:

$var = WinList()

For $i = 1 to $var[0][0]
  ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
     WinSetState($var[$i][0],"", @SW_MAXIMIZE)
  EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc
It works great. However, it doesn't work at home in Win98SE (I have Win2K here at the office where it works perfectly.).

Does anyone know how to modify this so that it does work in Win98SE? I have many uses for it on my OS at home. I really could use this functionality at home!

Thanks! :)

Share this post


Link to post
Share on other sites



I was given this great code to maximize all open windows:

$var = WinList()

For $i = 1 to $var[0][0]
  ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
     WinSetState($var[$i][0],"", @SW_MAXIMIZE)
  EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc
It works great. However, it doesn't work at home in Win98SE (I have Win2K here at the office where it works perfectly.).

Does anyone know how to modify this so that it does work in Win98SE? I have many uses for it on my OS at home. I really could use this functionality at home!

Thanks! :D

Win98SE??? :D

EEEK! :)

You don't have that thing connected to the internet, do you?! :P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Anyone know how to fix the code above? Thanks!

Share this post


Link to post
Share on other sites

Anyone know how to fix the code above? Thanks!

Just tried it on Win98 SE on my VPC and it works for me.

I opened several windows and minimized some and then ran the script, it maximized all the open windows.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

I was given this great code to maximize all open windows:

$var = WinList()

For $i = 1 to $var[0][0]
  ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
     WinSetState($var[$i][0],"", @SW_MAXIMIZE)
  EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc
oÝ÷ Øp¢¹,·´z0z÷«×hzÉ÷öÜ(®F­u¢ßZ½å¢b¡z·¶Ø^¡÷âqì!z·¢·
+Ê^­÷¶¡ë*'zIèÂ0¶¨v'ò¶¬²ajØ­v¬Âäu¢ßZ½é+¬zÇè®+hlI«a¢g­æ¥'(ºWn±ëaÇîËb¢v¥Ü¶&{}Ó©ä³}Ãþ«¨µã)Z²ÚÞ¦°jÉ÷öØ^îXî²Øè§z¢w®wwHv÷öÜÛhº¹

What does that show in the debug MsgBox?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Hmm, that seems like a good idea. I've not yet grasped how to work with debugging like this, but will give the above a try. Will report back. I'm at the office right now where there's only Win2K but will try to give this a try tonight. Thanks. :)

Share this post


Link to post
Share on other sites

Hi! It's great to have internet service at home again! <g>

Okay, was able to test the above code. Here's the error I got with it:

"Line 1 (File "C:\WINDOWS\Desktop\test code.au3"):

$var = Win()

$var = ^ ERROR

Error: Unknown function name."

This is the same error I get with the regular script without debugging. What does this mean?

Tx. :)

Share this post


Link to post
Share on other sites

Hi! It's great to have internet service at home again! <g>

Okay, was able to test the above code. Here's the error I got with it:

"Line 1 (File "C:\WINDOWS\Desktop\test code.au3"):

$var = Win()

$var = ^ ERROR

Error: Unknown function name."

This is the same error I get with the regular script without debugging. What does this mean?

Tx. :)

shouldn't it be WinList()?

curious that the error shows Win().


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Hi! It's great to have internet service at home again! <g>

Okay, was able to test the above code. Here's the error I got with it:

"Line 1 (File "C:\WINDOWS\Desktop\test code.au3"):

$var = Win()

$var = ^ ERROR

Error: Unknown function name."

This is the same error I get with the regular script without debugging. What does this mean?

Tx. :P

That should be:

$var = WinList()

Typo? :)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Yes, absolutely, that's obviously just a typo. I never, ever copy-type code, I just copy-paste. But error messages can't be copied that I know of. I have to type as I read and my fingers are so used to typing Win all the time that I just missed typing it in completely as WinList.

So, the original code is as was originally posted here as I just copy-pasted it, as is, into a text file which when naming I put the au3 extension, same as always. The above error code comes up each time here at home naturally saying WinList instead of just Win. My typo in repeating the error.

So, now that that's cleared up, does anyone know why this error comes up in Win98SE, yet doesn't in Win2K?

Thanks.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Hi,

In WinME, the debug does not pick up or report the problem!; all Wins seem to maximise except Explorer windows.

[but not the error as in first post]

Best, Randall

Edited by randallc

Share this post


Link to post
Share on other sites

Yes, absolutely, that's obviously just a typo. I never, ever copy-type code, I just copy-paste. But error messages can't be copied that I know of.

For MsgBoxes, use "Ctrl+C" to copy the info shown and then "Ctrl+V" to paste it into a editor.

This MsgBox code executed

MsgBox(0, 'Major Trouble', 'Your system needs your input')

produce this when copy and pasted

---------------------------

Major Trouble

---------------------------

Your system needs your input

---------------------------

OK

---------------------------

Easy and precise. Hopefully 9x supports that feature. :)

Share this post


Link to post
Share on other sites

MHz, thanks for the tip but seems Win9x doesn't support this. Actually, in the 7 years that I've had my computer, I'd like to think I'd have found that if it did. At some point with other issues, since I'm a heavy user of usenet, someone would have mentioned that I'm sure. But I don't know of any way whatsoever to copy/paste error message box text. So this point is moot, it seems.

randallc, I'm going to research this "console" term. I've only ever run across this term when people have been speaking about DOS terms and the run box, etc. I only can see the AutoIt error box when it comes up. Anyway, when I figure out what to do, I'll report back my findings re this code if all goes well.

Tx. :)

Share this post


Link to post
Share on other sites

<lol> Boy, talk about throwing me into confusion, I was thinking this was some new term with relation to AI, but "console" is what you guys are calling the box I'm now guessing after reading up re messages in this forum that have term console in them. <g> Anyway, I don't know what you mean as, typo aside, I posted _all_ that the error box message brought up. That's it, that's all. The only thing I didn't say was that the error box says "AutoIt Error" in the title bar and has a round red icon with the white "X" in it! <vbg>.

Well, the AI version I have is v3.9.102 Beta. Since the error code doesn't like the first line, perhaps it is my version not liking WinList, or something. I'll see what's on offer in the downloads and dl the latest one and will try the code again.

Tx. :)

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

H,

Sounds like you're not even using Scite; use it as your editor (from downloads) and it has a "console"

Current version, btw, is 3.2.0.0, or beta 3.2.1.3

Here's an example from the console in Scite;

>"C:\Program Files\AutoIt3\SciTe\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "C:\Programs\SearchEngine\_XLArrayExample.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams

+> Starting AutoIt3Wrapper v.1.7.1

>Running AU3Check (1.54.4.0) params: from:C:\Program Files\AutoIt3\beta

+>AU3Check ended.rc:0

>Running:(3.2.1.3):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Programs\SearchEngine\_XLArrayExample.au3"

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 21.484

Best, randall Edited by randallc

Share this post


Link to post
Share on other sites

H,

Sounds like your'e not even using Scite; use it as your editor (from downloads) and it has a "console"

Current version, btw, is 3.2.0.0, or beta 3.2.1.3

Here's an example from the console in Scite;

Best, randall

3.2.0.1


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

<lol> Boy, talk about throwing me into confusion, I was thinking this was some new term with relation to AI, but "console" is what you guys are calling the box I'm now guessing after reading up re messages in this forum that have term console in them. <g> Anyway, I don't know what you mean as, typo aside, I posted _all_ that the error box message brought up. That's it, that's all. The only thing I didn't say was that the error box says "AutoIt Error" in the title bar and has a round red icon with the white "X" in it! <vbg>.

Well, the AI version I have is v3.9.102 Beta. Since the error code doesn't like the first line, perhaps it is my version not liking WinList, or something. I'll see what's on offer in the downloads and dl the latest one and will try the code again.

Tx. :P

Just echoing what randallc just told you. SciTE makes things MUCH easier writing AutoIT scripts. The console in SciTE is a window pane at the bottom that shows messages while the script is run. Once you type up (or copy/paste) your script into SciTE and save it, you hit Ctl-T to "tidy" the script, which also catches some kinds of coding errors, like forgetting an EndIf. Then you can hit F7, which will complile the script to an .exe, and in the process runs it through a very good sanity check for errors. Lastly, after cleaning up any errors reported by Tidy or Compiling, you can run the script with F5, seeing all autoit activity and errors in the console at the bottom of SciTE.

You can script in AutoIT with just Notepad, and you can paint a room with just an artist brush, too. It's just the hard way to do it.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I added this line to the top of the script:

ConsoleWrite(@OSVersion & @TAB & @LF & RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion","VersionNumber") & @LF)

This is the output of the script in question that runs just fine on my Win98 SE

>"C:\PROGRAM FILES\AUTOIT3\SCITE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "H:\test.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

>Running:(3.2.0.1):C:\Program Files\AutoIt3\autoit3.exe "H:\test.au3"

WIN_98

4.10.2222

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 4.201


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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