Boot into Dr. Wimp application
Arno (2152) 9 posts |
Hello, Arno |
Kevin (224) 322 posts |
Double click on !Boot to open the configuration window: Click on Boot then Click on Run. Then drag your application to Run at startup. This will load your appliation to the iconbar. Try putting a PROCwimp_openwindow somewhere in DEf PROCuser_initialise, after the window has been initialised. This is a semi educated guess. |
Rick Murray (539) 13840 posts |
See above for how to get RISC OS to boot it.
As it is your program, you’re in luck. Your Wimp_Poll handling will do stuff in return to a click on the iconbar icon. I don’t use Dr. Wimp so I can’t advise on specific function names. If it is like the library I use, it will call a function to deal with the iconbar click. Remember the function that is called. Now go to the initialisation function. The one that initialises the wimp task, loads the windows, etc, etc. At the end of that, drop in a call to the function that is called upon mouse clicks on the icon bar. This ought to have the effect you are looking for. That’s a bit of a mouthful, so hopefully it’ll make sense when looking at the code. ;-) |
Arno (2152) 9 posts |
Thank you Kevin, thank you Rick, |
Rick Murray (539) 13840 posts |
It… Gets complicated. I guess, at a pinch, you could wait on the task started notification, try to work out which icon belong to the task, position the mouse there and fake a mouse click? All conjecture, for I’ve never needed to do such a thing. I can’t imagine it can’t be done, but I can imagine it wouldn’t exactly be straightforward. Oooh, hang on a moment. How about wait for the task to start, get the task handle, and then set a post-poll filter to hijack one of the early messages (doesn’t the wimp probe the task to see if it can change memory slots or something like that at start-up?) and change it to a faked mouse click on the icon bar icon? At this point the filter would unregister itself and die. I would say to hijack the first null poll, but that’ll only work if the task is not idling for a long time with null events disabled. Though… Having said that, couldn’t a pre-poll filter amend this behaviour as well? Mmmmm, this is starting to sound interesting. ;-) |
Ronald May (387) 407 posts |
There is an app called !Highway by Bernard Veasey that |
Arno (2152) 9 posts |
@Ronald: |
Fred Graute (114) 645 posts |
As Rick says this is a bit tricky but you could try the following procedure: Get the task handle of the application you’re interested in. Either by calling Wimp_StartTask to start it and noting the returned handle, or by using TaskManager_EnumerateTasks if it’s already running. Use Wimp_GetWindowInfo on the iconbar to find the number of iconbar icons. Send an User Message Acknowledge (19) to each icon in turn to find the handle of the task owning that icon. When the owner handle matches your task handle send a MouseClick event to that iconbar icon. I’ve put a couple of applets demonstrating this here |
Rick Murray (539) 13840 posts |
Just looked at my PRMs and noticed that Wimp_Send!essage says: event code (as returned by Wimp_Poll – often 17, 18 or 19). |
Fred Graute (114) 645 posts |
Yes, and this is mentioned in the PRMs, top of page 3-197 (dead wood edition). Virtual desktops such as MoreDesk use it to move to next screen and to fetch windows (by sending an OpenWindow events). KeyStroke sends MenuSelection events (and more). |
Arno (2152) 9 posts |
Good examples !LaunchApp and TrargetApp, thanks for sharing the code. |
nemo (145) 2546 posts |
The click is the event. It is communicated by a message. SendMessage sends messages. Using it to send messages (even when there wasn’t an event) is not an abuse. |