Sign in to follow this  
Followers 0
ToyleY

OCM_NOTIFY not working

2 posts in this topic

#1 ·  Posted (edited)

Any body ever had any joy trapping OCM_NOTIFY events. The essences of the code I'm working on is below, and I just can't see why it won't work.

; 1. Create the RichText Control
Global $DocEd1 = ObjCreate("RICHTEXT.RichtextCtrl") 
; 2. Create the ActiveX Container
$GUIActiveX = GUICtrlCreateObj($DocEd1, 10, 70)    
; 3 .find the 'Notify' offset for ActiveX control
Global Const $OCM__BASE = ($WM_USER + 0x1c00) 
; 4 .calculate $OCM_NOTIFY
Global Const $OCM_NOTIFY = ($OCM__BASE + $WM_NOTIFY)
;5. register (trap) $OCM_NOTIFY events (like $WM_NOTIFY 
;   events but with the offset for ActiveX objext)
GUIRegisterMsg($OCM_NOTIFY, "OCM_Notify_Events")

OCM_NOTIFY is a reflected Window Message ID (whatever that means)

I get the values:

$WM_USER = 1024

$OCM__BASE = 8192

$OCM_NOTIFY = 8270

when I run the script but the 'OCM_Notify_Events' function is never called? Any ideas?

Ta

EDIT - So, with activex controls, the window with the rich text (the place where I want to trap events) is a reflector window that intercepts some window messages, and sends them to the control with a different name. The reflected messages are:

Message sent by control Message reflected to control

WM_COMMAND .......................... OCM_COMMAND

WM_CTLCOLOR ........................... OCM_CTLCOLOR

WM_DRAWITEM ........................... OCM_DRAWITEM

WM_MEASUREITEM ....................... OCM_MEASUREITEM

WM_DELETEITEM ........................... OCM_DELETEITEM

WM_VKEYTOITEM ........................ OCM_VKEYTOITEM

WM_CHARTOITEM ....................... OCM_CHARTOITEM

WM_COMPAREITEM .................... OCM_COMPAREITEM

WM_HSCROLL .................................. OCM_HSCROLL

WM_VSCROLL ................................. OCM_VSCROLL

WM_NOTIFY ................................... OCM_NOTIFY

WM_PARENTNOTIFY ..................... OCM_PARENTNOTIFY

Might try a different approach to registration of OCM_NOTIFY.

Edited by ToyleY

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0