Can a Dialog be made "Impossible to Minimize"?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Can a Dialog be made "Impossible to Minimize"?

Post by jpuziano » Tue Mar 21, 2006 7:39 am

Hi Marcus,

Thanks for the quick reply to Can a Dialog be made to "STAYONTOP"?.

That lets us make a dialog that no other window can appear in front of. That's good, however hitting "Windows Key"-D still minimizes the dialog and its gone from view.

I need a dialog that can't be minimized... exactly like the "SMTPSendMail Status Window" behaves.

Is there a way to make a dialog "Impossible to Minimize"?

Thanks
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 21, 2006 1:43 pm

No, I don't think that's possible. I'm actually a bit puzzled because a) my SMTP Status Windows *DOES* minimize when I hit Windows-D, and b) the flags used in the SetWindowPos function that I provided are identical to what are used internally on the SMTP Status Window. Therefore there is no difference to the way these windows are set up. As I said, in my case ALL windows minimize with Windows-D - including the status window!
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3503
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Mar 21, 2006 1:46 pm

In a non modal dialog the line:

WindowAction>0,[Dialog Title]

Inserted into the GetDialogAction> loop will prevent the dialog from staying minimised.

For a modal dialog a second script or an executable could be spawned to perform the same function.

A secondary script like this:

Label>start
WindowAction>0,[Dialog Title]
Wait>0.01
Goto>start

Hope this helps,
Dick

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 21, 2006 1:48 pm

Very smart. Good thinking!
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3503
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Mar 21, 2006 2:43 pm

Thanks.
Hope its useful for jpuziano.

Later,
Dick

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Tue Mar 21, 2006 5:40 pm

mtettmar wrote:No, I don't think that's possible. I'm actually a bit puzzled because a) my SMTP Status Windows *DOES* minimize when I hit Windows-D, and b) the flags used in the SetWindowPos function that I provided are identical to what are used internally on the SMTP Status Window. Therefore there is no difference to the way these windows are set up. As I said, in my case ALL windows minimize with Windows-D - including the status window!
Hi Marcus,

I tried it again and yes you're right, the SMTP Status Windows does indeed minimize on hitting Windows-D... I had tried it on a sluggish PC that took so long to respond, the SMTPSendMail command would finish in my test script before the SMTP Status Window had a chance to minimize... it appeared impervious to Windows-D.

Hi JRL,

Your solution is clever and exactly what I needed, thank you so much. If ever a "Macro Scheduler T-Shirt" is produced, I think you should get a free one. I owe you at least a beer... thanks again!!! :D :D :D
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

solo
Newbie
Posts: 6
Joined: Tue Jun 06, 2006 3:03 am

Post by solo » Tue Jun 06, 2006 12:45 pm

Hello to all and 1st off this forum is a godsend great work to all here...as you can tell by my script example below im brand new to macro scheduler but find it a facinateing tool with endless possibilities
my question has to do with this keeping the dialog on top code ive tried it several ways and some it has kept it on top but executed the script imediately rather than waiting for the button command this is just a simple script that waits for 1 button to appear then clicks it...could someone please show me how to incorperate the stay ontop code into this to make it work as it is designed to do.....ty in advance for any and all input.

Code: Select all

setfocus> in Big*
movewindow> in Big*,0,0
Dialog>Dialog1
   Caption=BigTeaser1.0
   Top=469
   Width=165
   Left=0
   Height=95
   Label=Press Shift + Esc to Stop,20,35
   Button=start,0,5,75,30,2
   Button=exit,80,5,75,30,3
EndDialog>Dialog1
show>Dialog1,result
if>result=2,start
if>result=3,exit
end
Label>start
Label>colors
GPC>235,280,reb
IF>%reb%=16777215,reb
Goto>colors
label>reb
MouseMove>235,280
wait>.4
lclick
goto>start
label>exit

thaumaturgy
Junior Coder
Posts: 24
Joined: Mon Nov 01, 2004 1:30 pm

Post by thaumaturgy » Tue Jun 06, 2006 2:28 pm

I'm not great at this but your using 2 as your result for your start button which i believe you always want 2 as your exit. change your start result to say 4 and that should work.

solo
Newbie
Posts: 6
Joined: Tue Jun 06, 2006 3:03 am

Post by solo » Tue Jun 06, 2006 5:51 pm

Thank you thaumaturgy for the feed back i will remember to use 2 as my exit from now on however the desired result im looking for would not... to the best of my knowledge... be affected by that returning result variable but tyvm for your responce.

User avatar
JRL
Automation Wizard
Posts: 3503
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jun 07, 2006 5:27 am

See remarks:

Hope this helps,
Dick

Code: Select all

setfocus> in Big*
movewindow> in Big*,0,0
Dialog>Dialog1
   Caption=BigTeaser1.0
   Top=469
   Width=165
   Left=0
   Height=95
   //Label=Press Shift + Esc to Stop,20,35
   //Fixed button results
   Button=start,0,5,75,30,3
   Button=exit,80,5,75,30,2
EndDialog>Dialog1

//to make this stay on top you must use
//a non-modal dialog.  See dialog help for
//modal vs non-modal
show>Dialog1
Label>ActionLoop
GetDialogAction>Dialog1,result
if>result=3,start
if>result=2,exit
//Wait added to prevent tight loop
Wait>0.01
//Window Action set to 0 and embedded into the
//ActionLoop of the non-modal dialog will prevent
//the window named BigTeaser1.0 from staying minimized
//for more than a couple hundredths of a second
WindowAction>0,BigTeaser1.0
Goto>ActionLoop
Label>start
Label>colors
//If you want the window to stay on top during the long(?)
//wait for the pixel to become the correct color
//you'll need teh same WindowAction> line in the "colors" loop
WindowAction>0,BigTeaser1.0
//Wait added to prevent tight loop
Wait>0.01
GPC>235,280,reb
IF>%reb%=16777215,reb
Goto>colors
label>reb
MouseMove>235,280
wait>.4
lclick
//Changed to goto>ActionLoop or you have an endless loop.
//you might have an endless loop anyway with the colors loop
//if the specified pixel never turns to the specified color.
//Goto>start
goto>ActionLoop
label>exit

solo
Newbie
Posts: 6
Joined: Tue Jun 06, 2006 3:03 am

Post by solo » Wed Jun 07, 2006 7:54 am

JRL I cant thank you enough That put me on the rite path and i think also helped to solve a few other issues that i was experianceing with much larger multifuntion scripts although i had found work arounds for most of them this is going to simplify a lot thx again.

Zally
Newbie
Posts: 1
Joined: Sat Jun 10, 2006 3:19 am

Post by Zally » Sat Jun 10, 2006 3:28 am

talking about the on top code i am wondering what the problem is with my script all help would be appreciated.

movewindow>in Big*,0,0
let>TIMES=0
Dialog>Dialog3
Caption=Roulette Player 1.1
Top=321
Width=173
Left=470
Height=87
Label=0,40,32
Button=Start,0,0,75,25,3
Button=%TIMES%,80,0,75,25,2
EndDialog>Dialog3
Show>Dialog3
label>asd
GetDialogAction>Dialog3,result
If>result=3,Colors1
if>result=2,Exit
goto>asd
Label>Colors1
ResetDialogAction>Dialog3
Label>Colors
Let>Dialog3.msLabel0=%TIMES%
GetDialogAction>Dialog3,result
If>result=3,Colors
if>result=2,Exit
GPC>234,278,Bm
if>%Bm%=16777215,Bm
goto>Colors
label>Bm
mou>234,278
lcl
mou>556,426
lcl
add>TIMES,1
goto>Colors
label>Exit

Hardware_Tester
Pro Scripter
Posts: 58
Joined: Mon Jun 27, 2005 7:03 am
Location: Switzerland

Post by Hardware_Tester » Mon Jun 12, 2006 7:30 am

You did not use a pause in your loops. This let the script be executed at max CPU speed. Add a pause of 0.05s

Wait>0.05

And a second hint: When you post some code, use the code button to provide a better readability.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts