Alwaysontop Script

Discussion, questions and support.
Jim K
Posts: 8
Joined: Nov 12th, ’18, 02:54

Post by Jim K » Nov 14th, ’18, 14:51

Hi Tom,

I tried what you suggested. Still not working...

I thought I was on the right track, but not yet. :|
Tom4.jpg
I attached the binary file. You'll have to change the suffix to .BAS.

Here's the link to RobotBASIC. It was too big to attach.
www.robotbasic.org/app/download/3550162/RobotBASIC.exe

I thought I was on the right track, but not yet. :|
Tom4.jpg
Thank you for your continued help. Much appreciated.

Jim
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Nov 15th, ’18, 18:04

I tried but this method doesn't work for this particular window.

Try the example shortcut in FastKeys (Alt+Insert) which toggles any active window to be always on top. Unfortunately it doesn't work for your generated window. Is there something in your script which prevents this?
Jim K
Posts: 8
Joined: Nov 12th, ’18, 02:54

Post by Jim K » Nov 15th, ’18, 22:30

Hi Tom,

I tried the same script with a 5000 ms delay. Still didn't work.

I also tried it with the source code file, TopTest.BAS. Same result...

That's the only script I'm aware of.

run TopTest_.BAS
sleep 5000
Winset, Alwaysontop, On, RobotBASIC

I'll check with John, the author of RobotBASIC, to see if he has anything that's a problem when you run from a source or binary file. He already told me he doesn't have any procedure in the code to keep the window on top. I'll let you know if I find out anything.

Let me know if you think of anything else.

Thank you!

Jim
Jim K
Posts: 8
Joined: Nov 12th, ’18, 02:54

Post by Jim K » Nov 19th, ’18, 02:48

Hi Tom,

I'm back. I never could get AutoHotKey to work for this window. I didn't like DeskPins because it needed too many manual steps to get it working.

I finally completely solved the problem by temporarily moving the RB window to the upper left corner. Then using an AutoHotKey script to launch DeskPins and TopTest_.BAS

I thought you might like to see this, in case someone else needs it.

Here is the final RobotBASIC test program. Notice the two screen locations.
ScrSetMetrics 0,0,700,,0,1
delay 2000 ' Wait until DeskPins is done pinning the window
ScrSetMetrics 500,250,700,,0,1
xyText 10,110,"Try to Put a Window over me...",,25,fs_Bold

while true
wend

Here is the script I ended up with that pulls everything together:

; Script to force window to always stay on top.
Process, Wait, DeskPins.exe, 0.5 ; see if process running
NewPID := ErrorLevel

if not NewPID ; Don't reload if already loaded.
{
run C:\Program Files (x86)\DeskPins\DeskPins.exe
} ; Prevents error message on screen

run TopTest_.BAS ; Launch application program.
sleep 750
send ^{F11} ; Key to activate DeskPins
Mouseclick , , 100, 100 ; Click to pin window to top.
; Window must be in upper left corner for this to work. May be a better way...

Here's the final screen. Note the red pin in the upper right corner.
PinScreen.jpg
Now I can launch the whole thing by just running the script. Exactly what I wanted. The timing does seem to be important.

Thank you for all your help.

Regards,

Jim
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Nov 20th, ’18, 12:51

Interesting, thanks for posting.
Post Reply