|
-
Jan 14th, 2006, 09:26 AM
#1
Thread Starter
Member
Wm_activateapp !!
Is there a code that prevents the user from activating a particular running application ?
So let's say MS Word is running. I want to prevent Word from being activated either via the TaskBar, ALT + TAB , or any other way.
I have already been experimenting with some subclassing code to intercept the WM_ACTIVATEAPP but I 've had no luck so far.
Any working code anyone ?
Please no DLLs solutions as I am using VBA.
Thanks.
-
Jan 14th, 2006, 09:42 AM
#2
Re: Wm_activateapp !!
Post #6 in this thread shows how I've used wm_activateapp - I got this solution from someone else on the forum here...
In this implementation we are listening for that message on the "main" form of our own app - so we can determine when it is left and returned to. I would venture to guess you could listen for that message on other apps as well.
-
Jan 14th, 2006, 10:42 AM
#3
Thread Starter
Member
Re: Wm_activateapp !!
Thanks,
I think you forgot to add the link to the suggested Post !
Anyway, it is easy to detect when the App is deactivated ...what is difficult is to detect which of the foreign running applications gets activated .
Any thoughts ?
Thanks.
-
Jan 14th, 2006, 10:42 AM
#4
Re: Wm_activateapp !!
Please no DLLs solutions as I am using VBA
How are you doing subclassing in VBA? I didn't know that was possible.
-
Jan 14th, 2006, 10:44 AM
#5
Re: Wm_activateapp !!
 Originally Posted by BLUE_SEA
Thanks,
I think you forgot to add the link to the suggested Post !
Anyway, it is easy to detect when the App is deactivated ...what is difficult is to detect which of the foreign running applications gets activated .
Any thoughts ?
Thanks.
oops - here's the link...
http://www.vbforums.com/showthread.php?p=1975442
Although I know nothing about VBA...
-
Jan 14th, 2006, 10:53 AM
#6
Thread Starter
Member
Re: Wm_activateapp !!
 Originally Posted by Merrion
How are you doing subclassing in VBA? I didn't know that was possible.
Well, Subclassing\Hooking Office applications\VBA is a nightmare and not fully supported but Yes, I have manged to get it working in a limited number of scenarios .
Thanks.
-
Jan 14th, 2006, 11:12 AM
#7
Thread Starter
Member
Re: Wm_activateapp !!
 Originally Posted by szlamany
As I said the callback procedure in your post only detects when the subclassed Application is activated or deactivated by checking the value of the uMsg and WParam .It doesn't actually retrieve the application being activated.
According to the Documentation, If the Subclassed Application is being deactivated ie WParam=False then lParam is the identifier of the thread that owns the window being activated which is what I want to know.
In theory this should work but I just can't make it work :
I have searched this board and found a sugested solution using the RegisterShellHookWindow which I have tried implementing in EXCEL but I have been unsucceful so far.
Any help anyone ?
Thanks.
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
|