|
-
July 31st, 2007, 11:51 AM
#10
Re: Problem with SendKeys ... please help!
 Originally Posted by JonnyPoet
Do you know a way to imitate this click on the icon ? Maybe this would be a workaround ?
As you have mentioned in Bold, if it's going to the wrong application ... well, to cross check this, I added debug.Print for GetForegroundWindow just before the SendKeys and it always returned the same hWnd as previous. So, it's clear that the same Window is active. Still, to make sure that SendKeys is going to the same Window, I used SetForegroundWindow with last active window hWnd (which is a module level variable, declared in the header) before SendKeys ... just to make sure that it sends key sequence to the same application window. But this did not work.
The only thing that I still feel is: I'm using the System Tray Form template from vbAccelerator. There is no logic behind it, but it might be the case that this Object steals the focus and as the form is not visible, GetForegroundWindow will not detect it. So, debug.print is actually the false information given back, saying that the same application window is active.
I'm trying to get the System Tray icon stuff ready in a Module and removing the Form template. Actually, I started working on this sort of application for my personal purpose thinking that it will be easy to accomplish; but it looks like a tricky one! Due to other business work, this project is delayed a bit, I know. But hey, though this is just for personal use, I'm going to take it very seriously; mainly because the problem is not solved yet! Let's see if we all together can get it done or not. (Hopefully Yes!)
-- Ruturaaj.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|