www.virtualacorn.co.uk/forum

For support and advice on VirtualAcorn products
Forums now closed. This is an HTML only record of the content.
HTML version of Forum generated Thursday 24th May 2018

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Detection of Alt-Enter on exiting VRPC
PostPosted: Tue May 19, 2009 8:41 pm 
Offline

Joined: Thu Nov 28, 2002 7:08 pm
Posts: 69
Location: Cambridge
I've found a super Windows app (AutoIt) that allows really easy programming of the Win API. It allows me to have a two line script to execute the Alt-Enter to put VRPC in full screen mode. Thats great, but what I really want to do is have a script execute on EXIT from VRPC full screen mode. The intention is to get the script to move focus away from VRPC to avoid inadvertent clicks getting to RISC OS. I just need to find a way to get Windows to execute the script.
It seems that Alt-Enter is trapped and acted upon by VRPC, but does it propagate through to Windows at all?
Alternatively, can I get VRPC to execute the script in the Windows environment (in a similar way to the firing up of MS Word when opening a Word doc)?
I thought of having a script running continuously in the Windows environment just looking for the change of state of the VRPC window, but the AutoIt API doesn't seem to include reading of a window state "fullscreen". It only has "minimized" and "maximized" etc.
The only other thing I can think of is having RISC OS alter a file which is detected by a script running in Windows and as soon as it sees the change it can execute the script to move focus.
Any ideas?


Top
 Profile  
 
 Post subject: Re: Detection of Alt-Enter on exiting VRPC
PostPosted: Wed May 20, 2009 2:43 am 
Offline

Joined: Thu Nov 28, 2002 7:08 pm
Posts: 69
Location: Cambridge
Whilst I'd still be interested in replies to my post I have actually found a way to do what I want, although its not as elegant as I would like. I have an AutoIt script like this:
DirCreate("C:\Program Files\VirtualAcorn\VirtualRPC-SE\HardDisc4\Utilities\InVRPC")
WinSetState("Virtual RPC-SE","",@SW_SHOW)
WinActivate("Virtual RPC-SE")
Send("!{ENTER}")
Sleep(200)
MouseClick("left",0,0)
While FileExists("C:\Program Files\VirtualAcorn\VirtualRPC-SE\HardDisc4\Utilities\InVRPC")
Sleep(500)
WEnd
Send("!{ENTER}")
WinActivate("Fast Launcher")
WinSetState("Virtual RPC-SE","",@SW_HIDE)

What this does is to create a directory in HardDisc4 that means VRPC is fullscreen. Then it makes sure the VRPC window is visible and gives it focus. Then it sends Alt-Enter and puts the mouse pointer to top left (to avoid any spurious clicks during the switch). The script then polls to see when the directory is deleted. In RISC OS I have an Obey file (or a KlikMacro button) that deletes the directory. The script sees this and sends Alt-Enter to VRPC and when back in a window it moves focus away from VRPC (in this case Fast Launcher) and hides the VRPC window.
Another script allows me to show VRPC if I want to see it.
Now, if only I could trap Alt-Enter.... so that when I forget to click the button and by habit press Alt-Enter it deletes the directory.

VRPC users might be interested in AutoIt to automate other things too. Its brilliant!


Top
 Profile  
 
 
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

   
cron
Forums originally Powered by phpBB © 2007 phpBB Group. Contents © 3QD Developments Ltd 2018 version no. 1.07