Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / November 2005

Tip: Looking for answers? Try searching our database.

Help me with the best way to do this

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
justengland@gmail.com - 18 Nov 2005 20:43 GMT
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
Gabriel Lozano-Morán - 20 Nov 2005 19:15 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.