Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Subclassing UserForms !

Is it possible ?

I gave up trying to subclass the Excel App Window as it just seems to be
impossible....But how about subclassing an Ecxel/VBA UserForm ?

Does anyone have a working example ? I am very curious to see one .

Thanks in advance.

Jaafar.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Subclassing UserForms !

I have uploaded an example for you to examine at
http://cjoint.com/data/hCpvjfeoGu.htm

--

HTH

RP
(remove nothere from the email address if mailing direct)


"RAFAAJ2000" wrote in message
...
Is it possible ?

I gave up trying to subclass the Excel App Window as it just seems to be
impossible....But how about subclassing an Ecxel/VBA UserForm ?

Does anyone have a working example ? I am very curious to see one .

Thanks in advance.

Jaafar.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Subclassing UserForms !

Thanks Bob for the prompt reply.

The code you provided doesn't actually use SubClassing, it just uses a timer
to periodically update the Form Styles . What I would like is to trap the the
Windows Messages sent to the Form like the Mouse\Keyboard messages among
others.

So for example, this would allow me to left click the UserForm Title
Bar,trap this mouse event and display a standard MsgBox..... This is
something that can't be achieved by using the Form's native events.

Any more thoughts anyone ?

Thanks.

Jaafar.





"Bob Phillips" wrote:

I have uploaded an example for you to examine at
http://cjoint.com/data/hCpvjfeoGu.htm

--

HTH

RP
(remove nothere from the email address if mailing direct)


"RAFAAJ2000" wrote in message
...
Is it possible ?

I gave up trying to subclass the Excel App Window as it just seems to be
impossible....But how about subclassing an Ecxel/VBA UserForm ?

Does anyone have a working example ? I am very curious to see one .

Thanks in advance.

Jaafar.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Subclassing UserForms !

Try http://tinyurl.com/e22fy




"RAFAAJ2000" schreef in bericht
...
Thanks Bob for the prompt reply.

The code you provided doesn't actually use SubClassing, it just uses a
timer
to periodically update the Form Styles . What I would like is to trap the
the
Windows Messages sent to the Form like the Mouse\Keyboard messages among
others.

So for example, this would allow me to left click the UserForm Title
Bar,trap this mouse event and display a standard MsgBox..... This is
something that can't be achieved by using the Form's native events.

Any more thoughts anyone ?

Thanks.

Jaafar.





"Bob Phillips" wrote:

I have uploaded an example for you to examine at
http://cjoint.com/data/hCpvjfeoGu.htm

--

HTH

RP
(remove nothere from the email address if mailing direct)


"RAFAAJ2000" wrote in message
...
Is it possible ?

I gave up trying to subclass the Excel App Window as it just seems to
be
impossible....But how about subclassing an Ecxel/VBA UserForm ?

Does anyone have a working example ? I am very curious to see one .

Thanks in advance.

Jaafar.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Subclassing UserForms !

Hi Rody,

That code was actually meant to subclass a WorkBook Window NOT a UserForm.
Furthermore,it doesn't actually trap the propper Message "WM_MOUSEMOVE" so
it is not the propper solution...was just a close attempt .

I am experimenting with some code at the moment but the Form keeps freezing
when it is subclassed.

I have been searching the Net as well as the most advanced Books on Excel
for some snippet code on how to Subclass Excel UserForms or Excel for that
matter but can't find anything at all.

Just imagine how much power & control one could get over our Excel Apps if
Subclassing was possible .

Any ideas anyone ?

Thanks.







"Rody Meulman" wrote:

Try http://tinyurl.com/e22fy




"RAFAAJ2000" schreef in bericht
...
Thanks Bob for the prompt reply.

The code you provided doesn't actually use SubClassing, it just uses a
timer
to periodically update the Form Styles . What I would like is to trap the
the
Windows Messages sent to the Form like the Mouse\Keyboard messages among
others.

So for example, this would allow me to left click the UserForm Title
Bar,trap this mouse event and display a standard MsgBox..... This is
something that can't be achieved by using the Form's native events.

Any more thoughts anyone ?

Thanks.

Jaafar.





"Bob Phillips" wrote:

I have uploaded an example for you to examine at
http://cjoint.com/data/hCpvjfeoGu.htm

--

HTH

RP
(remove nothere from the email address if mailing direct)


"RAFAAJ2000" wrote in message
...
Is it possible ?

I gave up trying to subclass the Excel App Window as it just seems to
be
impossible....But how about subclassing an Ecxel/VBA UserForm ?

Does anyone have a working example ? I am very curious to see one .

Thanks in advance.

Jaafar.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Subclassing UserForms !


check out SetWindowHook or SetWindowHookEx.

those allow you to monitor a subset of all messages
and you dont need to "passthru" the original message.

best bet is WH_MOUSE or WH_CBT


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


RAFAAJ2000 wrote :

Hi Rody,

That code was actually meant to subclass a WorkBook Window NOT a
UserForm. Furthermore,it doesn't actually trap the propper Message
"WM_MOUSEMOVE" so it is not the propper solution...was just a close
attempt .

I am experimenting with some code at the moment but the Form keeps
freezing when it is subclassed.

I have been searching the Net as well as the most advanced Books on
Excel for some snippet code on how to Subclass Excel UserForms or
Excel for that matter but can't find anything at all.

Just imagine how much power & control one could get over our Excel
Apps if Subclassing was possible .

Any ideas anyone ?

Thanks.







"Rody Meulman" wrote:

Try http://tinyurl.com/e22fy




"RAFAAJ2000" schreef in
bericht ...
Thanks Bob for the prompt reply.

The code you provided doesn't actually use SubClassing, it just
uses a timer
to periodically update the Form Styles . What I would like is to
trap the the
Windows Messages sent to the Form like the Mouse\Keyboard
messages among others.

So for example, this would allow me to left click the UserForm
Title Bar,trap this mouse event and display a standard
MsgBox..... This is something that can't be achieved by using the
Form's native events.

Any more thoughts anyone ?

Thanks.

Jaafar.





"Bob Phillips" wrote:

I have uploaded an example for you to examine at
http://cjoint.com/data/hCpvjfeoGu.htm

--

HTH

RP
(remove nothere from the email address if mailing direct)


"RAFAAJ2000" wrote in

message
... Is
it possible ?
I gave up trying to subclass the Excel App Window as it just

seems to be
impossible....But how about subclassing an Ecxel/VBA UserForm ?

Does anyone have a working example ? I am very curious to see

one .
Thanks in advance.

Jaafar.






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Subclassing UserForms !

Thanks KeepItCool,

So Hooking should then work instead of Subclasssing...That sounds good .

I have to say I am not familiar with this thecnic and I find it more
difficult that Subclassiing but I'll learn how to use it if it gives results
in Excel.

If someone has an example, please, let me know about it.

I'll get back as soon as I find something interesting.

Thanks again everybody.








"keepITcool" wrote:


check out SetWindowHook or SetWindowHookEx.

those allow you to monitor a subset of all messages
and you dont need to "passthru" the original message.

best bet is WH_MOUSE or WH_CBT


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


RAFAAJ2000 wrote :

Hi Rody,

That code was actually meant to subclass a WorkBook Window NOT a
UserForm. Furthermore,it doesn't actually trap the propper Message
"WM_MOUSEMOVE" so it is not the propper solution...was just a close
attempt .

I am experimenting with some code at the moment but the Form keeps
freezing when it is subclassed.

I have been searching the Net as well as the most advanced Books on
Excel for some snippet code on how to Subclass Excel UserForms or
Excel for that matter but can't find anything at all.

Just imagine how much power & control one could get over our Excel
Apps if Subclassing was possible .

Any ideas anyone ?

Thanks.







"Rody Meulman" wrote:

Try http://tinyurl.com/e22fy




"RAFAAJ2000" schreef in
bericht ...
Thanks Bob for the prompt reply.

The code you provided doesn't actually use SubClassing, it just
uses a timer
to periodically update the Form Styles . What I would like is to
trap the the
Windows Messages sent to the Form like the Mouse\Keyboard
messages among others.

So for example, this would allow me to left click the UserForm
Title Bar,trap this mouse event and display a standard
MsgBox..... This is something that can't be achieved by using the
Form's native events.

Any more thoughts anyone ?

Thanks.

Jaafar.





"Bob Phillips" wrote:

I have uploaded an example for you to examine at
http://cjoint.com/data/hCpvjfeoGu.htm

--

HTH

RP
(remove nothere from the email address if mailing direct)


"RAFAAJ2000" wrote in
message
... Is
it possible ?
I gave up trying to subclass the Excel App Window as it just
seems to be
impossible....But how about subclassing an Ecxel/VBA UserForm ?

Does anyone have a working example ? I am very curious to see
one .
Thanks in advance.

Jaafar.







  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Subclassing UserForms !


For an example of Hooking have a look here

http://www.xcelfiles.com/API_Userform_MenuMaker.htm

--
Ivan F Moal

-----------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195
View this thread: http://www.excelforum.com/showthread.php?threadid=39092

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Subclassing UserForms !

Thanks Ivan,

This is actually Subclassing in Excel Not Hooking and still it does WORK !!!
with no appearant adverse effect ! ....first time I see Subclassing in an
Excel environement without freezing or crashing the whole application
:)....Beautiful work Ivan.

I'll study the code and see if I can adapt the same concepts to different
scenarios.

Ivan, do you have any code that subclasses the XL application (or any of its
child objects) as opposed to a UserFom ?

Regards.

Jaafar.



"Ivan F Moala" wrote:


For an example of Hooking have a look here

http://www.xcelfiles.com/API_Userform_MenuMaker.html


--
Ivan F Moala


------------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954
View this thread: http://www.excelforum.com/showthread...hreadid=390920


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subclassing in Excel ! ...So frustrating ! RAFAAJ2000[_2_] Excel Programming 12 May 4th 05 12:54 PM
Subclassing Excel !!! So frustrating !! RAFAAJ2000[_2_] Excel Programming 0 May 1st 05 07:38 AM
Two Userforms MBlake Excel Programming 4 April 25th 05 07:23 PM
Userforms??? John Baker Excel Programming 2 October 21st 04 03:53 PM
Subclassing the EXCEL7 window Timster Excel Programming 0 August 12th 04 12:54 PM


All times are GMT +1. The time now is 06:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"