Source language: Translate to:

[bug] ? var windostate to normal and maximized

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

[bug] ? var windostate to normal and maximized

Postby sombra » Mon Sep 25, 2006 2:59 am

Hello,
I have an application with a button for maximize the window, but when I return to normal window with SetVar "[WindowState]" "normal" and press again for maximize the window, it don't work.
Here is an example test.pub with the code.
Exist any solution?
TIA.
sombra
 
Posts: 93
Joined: Sat Apr 02, 2005 3:09 pm
Location: Spain

Postby HPW » Mon Sep 25, 2006 3:38 am

Seems a bug to me.
When you enable the maximise button in book propertys you see that the state of this button is not restored properly when setting [Windowstate] back to normal.

PS: With hpwAutoItWinMaximize and hpwAutoItWinRestore from hpwAutoIt (2.8X) it works. Drawback is the additional DLL to deliver.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby sombra » Mon Sep 25, 2006 7:47 am

Hi HPW, thx for check it :) I will try this plugin.

Another possible bug:
I make an pub with a timer and a button, the button minimize the application to systray and set a timer to 10000 ms.
The timer should activate an Alertbox, But it activate the alertbox always on bottom.
I tried set the [windowstate] to normal before of the line Alertbox, then is showed the application and the alertbox.
Is possible show only the alertbox without the window of the application?
Here is an example

2neosoft Is planed fix these possibles "bugs"?
sombra
 
Posts: 93
Joined: Sat Apr 02, 2005 3:09 pm
Location: Spain

Postby Neosoft Support » Mon Sep 25, 2006 3:49 pm

Sombra,

I wish you had reported these problems last week because we just released an update on Friday. I will certainly add your message to the list of things to correct in the next release. In the mean time, here are some things you can do to work around the problems:

I have an application with a button for maximize the window, but when I return to normal window with SetVar "[WindowState]" "normal" and press again for maximize the window, it don't work.


Instead of setting [WindowState] to Maximized, do this:

Code: Select all
SetVar "[OldLeft]" "[WindowLeft]"
SetVar "[OldTop]" "[WindowTop]"
SetVar "[OldWidth]" "[WindowWidth]"
SetVar "[OldHeight]" "[WindowHeight]"
SetVar "[WindowLeft]" "0"
SetVar "[WindowTop]" "0"
SetVar "[WindowWidth]" "[ScreenWidth]"
SetVar "[WindowHeight]" "[ScreenHeight]"


Instead of setting "[WindowState]" to Normal, do this:

Code: Select all
SetVar "[WindowLeft]" "[OldLeft]"
SetVar "[WindowTop]" "[OldTop]"
SetVar "[WindowWidth]" "[OldWidth]"
SetVar "[WindowHeight]" "[OldHeight]"


...The timer should activate an Alertbox, But it activate the alertbox always on bottom. I tried set the [windowstate] to normal before of the line Alertbox, then is showed the application and the alertbox.


By default, the AlertBox won't interrupt the user if another application has the focus. However, you can force the AlertBox to appear on top by modifying your Timer action to include BringAppToFront. For example:

Code: Select all
TimerStop "Timer1"
[b]BringAppToFront "[Commandline]"[/b]
PlayTone "440"
AlertBox "test" "hello from Spain :)"


Another option is to replace the AlertBox with a CustomWindow which will display on top of other applications automatically.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 3 guests