Add an event on runtime
-
Hello I am working with MFC. I am loading an external DLL using LoadLibrary and call a function within this DLL. This function opens a dialog box and this dialog box has several controls. I have the HWND and ids of the dialog box and controls. I want to register to the getFocus event of one of the controls (On runtime). I was looking for a long time and couldn't find any helpful function or example, could any one help ?
-
Hello I am working with MFC. I am loading an external DLL using LoadLibrary and call a function within this DLL. This function opens a dialog box and this dialog box has several controls. I have the HWND and ids of the dialog box and controls. I want to register to the getFocus event of one of the controls (On runtime). I was looking for a long time and couldn't find any helpful function or example, could any one help ?
what are you exactly trying to achieve by registering for onfocus()? afaik every control is derived from CWnd and every CWnd receives a WM_SET_FOCUS event when it receives a focus. if your control is child of dialog and you dont want to override the default class of control, then maybe you need to check whether your dialog received the WM_SET_FOCUS when one of its child gets the focus as a dialog can never have focus - only its child can have focus. And if you can get the setfocus function call, you can easily signal your main application from the dll.. or not??
-
what are you exactly trying to achieve by registering for onfocus()? afaik every control is derived from CWnd and every CWnd receives a WM_SET_FOCUS event when it receives a focus. if your control is child of dialog and you dont want to override the default class of control, then maybe you need to check whether your dialog received the WM_SET_FOCUS when one of its child gets the focus as a dialog can never have focus - only its child can have focus. And if you can get the setfocus function call, you can easily signal your main application from the dll.. or not??
There is the login dll of windows GinaDLL.dll In this DLL there is a function that opens a dialog box for entering the login username and password. I want to use the functionallity of this DLL and not override the whole DLL. I want to know when the user is typing in the username edit box and when he is typing in the password edit box. Since this is an external dll, I can't use the DECLARE_MESSAGE_MAP, BEGIN_MESSAGE_MAP and END_MESSAGE_MAP macros.
-
There is the login dll of windows GinaDLL.dll In this DLL there is a function that opens a dialog box for entering the login username and password. I want to use the functionallity of this DLL and not override the whole DLL. I want to know when the user is typing in the username edit box and when he is typing in the password edit box. Since this is an external dll, I can't use the DECLARE_MESSAGE_MAP, BEGIN_MESSAGE_MAP and END_MESSAGE_MAP macros.
check if http://msdn.microsoft.com/en-us/library/aa374744(VS.85).aspx or Hooks and DLLs are of any use to you. Hooking msgina.dll will not be that easy and I dont know if there's any other way of doing this.
-
Hello I am working with MFC. I am loading an external DLL using LoadLibrary and call a function within this DLL. This function opens a dialog box and this dialog box has several controls. I have the HWND and ids of the dialog box and controls. I want to register to the getFocus event of one of the controls (On runtime). I was looking for a long time and couldn't find any helpful function or example, could any one help ?
You may go through subclassing, see, for instance [^]. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]