Jotaf98
Jan 12th, 2001, 05:39 PM
Hi!
I want to make my program start Notepad without the user doing anything (but not instantly, I want it to do it as if the user was doing it!). It's a kind of joke, I can't tell you because if someone tries to trick you with this it won't work :)
I know how to move the cursor smoothly to a location (using the same calculations used to draw lines), but I need the APIs to do it.
At first I wanted it to open up the Start menu, point to Programs » Accessories » Notepad, but I know it would be kinda hard to find the exact positions of all this.
So I thought of another thing: the user can edit the Start menu's shortcut, the shortcuts could be in another language/under another name, sorted in another order or even deleted. So pointing directly at the position where it was suposed to be wouldn't be very efficient.
While writing this (and know that I have re-writen it a dozen times because I'm always having new ideas :p ) I also came to the conclusion that using the mouse would be cool, but it wouldn't be easy (I think) to find all the handles to the objects I wanna point to (mainly submenus). I'll simply send keystrokes instead of moving the cursor *sigh*
So we would find the Start Menu button's handle, give it the focus and send it the Enter key to simulate a click, press the Up Arrow key 3 times to select Run, send the Enter key (to simulate a click again), type "notepad" and send the Enter key again to execute it, wait a couple of seconds and voila, Notepad is open.
Basically I need the API/APIs to find the Start Menu's button and give it focus. Unless you know how to do it using the mouse (by finding submenus' handles)... it would be awsome!
Please, if you have -any- clue on one of these solutions, even if it's just a tiny one, reply here. Thanks!
I want to make my program start Notepad without the user doing anything (but not instantly, I want it to do it as if the user was doing it!). It's a kind of joke, I can't tell you because if someone tries to trick you with this it won't work :)
I know how to move the cursor smoothly to a location (using the same calculations used to draw lines), but I need the APIs to do it.
At first I wanted it to open up the Start menu, point to Programs » Accessories » Notepad, but I know it would be kinda hard to find the exact positions of all this.
So I thought of another thing: the user can edit the Start menu's shortcut, the shortcuts could be in another language/under another name, sorted in another order or even deleted. So pointing directly at the position where it was suposed to be wouldn't be very efficient.
While writing this (and know that I have re-writen it a dozen times because I'm always having new ideas :p ) I also came to the conclusion that using the mouse would be cool, but it wouldn't be easy (I think) to find all the handles to the objects I wanna point to (mainly submenus). I'll simply send keystrokes instead of moving the cursor *sigh*
So we would find the Start Menu button's handle, give it the focus and send it the Enter key to simulate a click, press the Up Arrow key 3 times to select Run, send the Enter key (to simulate a click again), type "notepad" and send the Enter key again to execute it, wait a couple of seconds and voila, Notepad is open.
Basically I need the API/APIs to find the Start Menu's button and give it focus. Unless you know how to do it using the mouse (by finding submenus' handles)... it would be awsome!
Please, if you have -any- clue on one of these solutions, even if it's just a tiny one, reply here. Thanks!