I have created a scanning control that uses twain_32.dll .
It works fine if I make the control as user control, since it needs to
access the message pump for it to work properly.
Well I am a little be of a perfectionist and I would rather make it a
componant or a commondialog.
I started developing the commondialog with has the method
Protected Overrides Function OwnerWndProc( _
ByVal hWnd As System.IntPtr, _
ByVal msg As Integer, _
ByVal wparam As System.IntPtr, _
ByVal lparam As System.IntPtr) As System.IntPtr
It seems like this function would track the owner forms message pump.
However it never fires. I am not sure what I need to do to access it.
The class is declaired as
Public Class ScannerComponent
Inherits System.Windows.Forms.CommonDialog
But I am having no luck with the commondialog class setting the owner
thus the ownerwndproc is not fireing.
If anybody has any ideas I would be greatful
Thank
Justin
I have tried it out and it works fine (in VS2005 that is, don't know about
VS2003). Here is the callstack:
CommonDialog.exe!CommonDialog.MyCommonDialog.OwnerWndProc(System.IntPtr hWnd
= 1050430, int msg = 31, System.IntPtr wparam = 0, System.IntPtr lparam = 0)
Line 21 C#
System.Windows.Forms.dll!System.Windows.Forms.CommonDialog.OwnerSublass.WndProc(ref
System.Windows.Forms.Message m = {msg=0x1f (WM_CANCELMODE) hwnd=0x10073e
wparam=0x0 lparam=0x0 result=0x0}) + 0x19 bytes
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr
hWnd, int msg = 31, System.IntPtr wparam, System.IntPtr lparam) + 0x75 bytes
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadWindows.Enable(bool
state = false) + 0x155 bytes
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.DisableWindowsForModalLoop(bool
onlyWinForms = false, System.Windows.Forms.ApplicationContext context =
null) + 0x35 bytes
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.BeginModalMessageLoop(System.Windows.Forms.ApplicationContext
context) + 0x70 bytes
System.Windows.Forms.dll!System.Windows.Forms.Application.BeginModalMessageLoop()
+ 0x10 bytes
System.Windows.Forms.dll!System.Windows.Forms.CommonDialog.ShowDialog(System.Windows.Forms.IWin32Window
owner) + 0xa8 bytes
CommonDialog.exe!CommonDialog.Form1.button1_Click(object sender = {Text =
"button1"}, System.EventArgs e = {X = 65 Y = 20 Button = Left}) Line 20 +
0xf bytes C#
>I have created a scanning control that uses twain_32.dll .
> It works fine if I make the control as user control, since it needs to
[quoted text clipped - 21 lines]
> Thank
> Justin
justengland@gmail.com - 29 Nov 2005 18:16 GMT
I am using 2003 I will test it in 2005 to see if that is the issue.
Thanks for your reply
Justin