subclassing at the top level? 
Author Message
 subclassing at the top level?

how would I go about subclassing at the top level, instead of a specific
window?

i.e. I want to know whenever a mouse is moved, a key is pressed etc.  I want
to make a logging program to see if anyone uses my computer when I'm not
around.

I do know how to subclass a specific window.

thanks,

--

~Jake B
Founder of jbNet ( http://www.*-*-*.com/ )



Mon, 15 Jul 2002 03:00:00 GMT  
 subclassing at the top level?

I'm not sure if I'm mixing up terminoligy here, but can't you do that in vb
5+ using the new GetAddress function? I know you can get all messages from a
specific window, I've done it, you can get an example off
http://www.planetsourcecode.com/vb, I'll try setting the hwnd to null and
see what happens [smoke starts pouring out the diskette drive]

thanks!

--

~Jake B
Founder of jbNet (http://jbnet.cjb.net)

Quote:
> To do that, you need to set up a System hook.
> A system hook gets all messages from a specific window, even if it's NOT
> your own processes window! If you set the hWnd to Null, it send you ALL
> messages before they are sent to any program! unfortuantely, you can't
write
> a system hook in Vb, u need to use a dll from another language.
> Jolyon.



> > how would I go about subclassing at the top level, instead of a specific
> > window?

> > i.e. I want to know whenever a mouse is moved, a key is pressed etc.  I
> want
> > to make a logging program to see if anyone uses my computer when I'm not
> > around.

> > I do know how to subclass a specific window.

> > thanks,

> > --

> > ~Jake B
> > Founder of jbNet (http://jbnet.cjb.net)



Mon, 15 Jul 2002 03:00:00 GMT  
 subclassing at the top level?

I tried it, and it won't let me use the null constant or whatever it is in
the api call.  "Improper use of NULL" or somthing.  Is this what you were
talking about?  Is there some other way to do this?

--

~Jake B
Founder of jbNet (http://jbnet.cjb.net)

Quote:

> I'm not sure if I'm mixing up terminoligy here, but can't you do that in
vb
> 5+ using the new GetAddress function? I know you can get all messages from
a
> specific window, I've done it, you can get an example off
> http://www.planetsourcecode.com/vb, I'll try setting the hwnd to null and
> see what happens [smoke starts pouring out the diskette drive]

> thanks!

> --

> ~Jake B
> Founder of jbNet (http://jbnet.cjb.net)


> > To do that, you need to set up a System hook.
> > A system hook gets all messages from a specific window, even if it's NOT
> > your own processes window! If you set the hWnd to Null, it send you ALL
> > messages before they are sent to any program! unfortuantely, you can't
> write
> > a system hook in Vb, u need to use a dll from another language.
> > Jolyon.



> > > how would I go about subclassing at the top level, instead of a
specific
> > > window?

> > > i.e. I want to know whenever a mouse is moved, a key is pressed etc.
I
> > want
> > > to make a logging program to see if anyone uses my computer when I'm
not
> > > around.

> > > I do know how to subclass a specific window.

> > > thanks,

> > > --

> > > ~Jake B
> > > Founder of jbNet (http://jbnet.cjb.net)



Mon, 15 Jul 2002 03:00:00 GMT  
 subclassing at the top level?
To do that, you need to set up a System hook.
A system hook gets all messages from a specific window, even if it's NOT
your own processes window! If you set the hWnd to Null, it send you ALL
messages before they are sent to any program! unfortuantely, you can't write
a system hook in Vb, u need to use a dll from another language.
Jolyon.


Quote:

> how would I go about subclassing at the top level, instead of a specific
> window?

> i.e. I want to know whenever a mouse is moved, a key is pressed etc.  I
want
> to make a logging program to see if anyone uses my computer when I'm not
> around.

> I do know how to subclass a specific window.

> thanks,

> --

> ~Jake B
> Founder of jbNet (http://jbnet.cjb.net)



Tue, 16 Jul 2002 03:00:00 GMT  
 subclassing at the top level?

Quote:

>To do that, you need to set up a System hook.
>A system hook gets all messages from a specific window, even if it's NOT
>your own processes window! If you set the hWnd to Null, it send you ALL
>messages before they are sent to any program! unfortuantely, you can't write
>a system hook in Vb, u need to use a dll from another language.
>Jolyon.

I don't buy this.

I'm almost certain there is a way to take the .obj files VB makes from
modules when it compiles and make a standard DLL from it.  A recent VBPJ
article called "control the compiler" mentioned it is possible, and I
have no reason to doubt it.  Certain VB people associated with the CCRP
have alluded to the possibility and that they are investigating it. (no,
I won't name names, I'll let them volunteer if they wish. . .)

Matthew Cromer
President, SDA Consulting, Inc.

http://www.sdaconsulting.com



Tue, 16 Jul 2002 03:00:00 GMT  
 subclassing at the top level?

Quote:

>I tried it, and it won't let me use the null constant or whatever it is in
>the api call.  "Improper use of NULL" or somthing.

Don't use a bare "Null". That means something different to VB. You can
use a zero instead. Or is there a VB constant, like vbNull? I wouldn't
know, I stopped upgrading VB.

Is the function declaration something like "lpParam as Any"?

Then, it is possible to pass a null pointer using "Byval 0&" as the
argument.

--
        Bart.



Tue, 16 Jul 2002 03:00:00 GMT  
 subclassing at the top level?

I tried vbNull, and I tried 0, btw vbNull equals 1, and in both cases my
callback routine never was called (the one that's called in the case of an
event)  and yes, there were events being fired off.

no, it wasn't lParam as any, the declares are as follows:

Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal
lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal msg As Long, ByVal wParam
As Long, ByVal lParam As Long) As Long

'this is the one that you call in form_load to hook the desired hwnd.  I'm
not sure what nIndex is, but the example
'has it set to GWL_WNDPROC (-4) and lParam is a pointer to the callback
routine.
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal
hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

--

~Jake B
Founder of jbNet (http://jbnet.cjb.net)

Quote:

> >I tried it, and it won't let me use the null constant or whatever it is
in
> >the api call.  "Improper use of NULL" or somthing.

> Don't use a bare "Null". That means something different to VB. You can
> use a zero instead. Or is there a VB constant, like vbNull? I wouldn't
> know, I stopped upgrading VB.

> Is the function declaration something like "lpParam as Any"?

> Then, it is possible to pass a null pointer using "Byval 0&" as the
> argument.

> --
> Bart.



Tue, 16 Jul 2002 03:00:00 GMT  
 subclassing at the top level?
0 is not null. Use Chr$(0) or vbNull for the null value

Quote:

> >I tried it, and it won't let me use the null constant or whatever it is
in
> >the api call.  "Improper use of NULL" or somthing.

> Don't use a bare "Null". That means something different to VB. You can
> use a zero instead. Or is there a VB constant, like vbNull? I wouldn't
> know, I stopped upgrading VB.

> Is the function declaration something like "lpParam as Any"?

> Then, it is possible to pass a null pointer using "Byval 0&" as the
> argument.

> --
> Bart.



Tue, 16 Jul 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. subclassing @ the top level...

2. Subclassing on top

3. Processing Top Level information failed error msg - help needed

4. Parent of root of folder (top level) ?

5. Job Opportunity for 1-2 top-level VB/VBA/Win32API programmers

6. Parent of root of folder (top level) ?

7. Finding the top level folder - Outlook Today

8. How do I add a top level folder using vb

9. Adding a top level task

10. Enumerating Top-level Application Windows

11. Can a top level treeview node have a + ?

12. Cannot find top level window to send a close command

 

 
Powered by phpBB® Forum Software