Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / May 2005



Tip: Looking for answers? Try searching our database.

Modeless Behavior from within VB for Word COM AddIn w/ Certain Modal Functionality?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TMan - 21 May 2005 09:44 GMT
Hey Folks,

I'm sure that you are all well acquainted with how when one uses a modal
form from within Word VBA or the VB environment, one stays within that
routine until the form is closed and the routine can continue.  The opposite
is, of course, true when using a modeless form from within Word VBA or the
VB environment (i.e. the code will run completely through the routine).

However, if one loads a VBA form as modal and then, say, clicks a button
that runs such code as below:

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function EnableWindow Lib "user32" (ByVal hWnd As Long,
ByVal fEnable As Long) As Long

Public Sub Enabler
   'Make the form modeless by enabling Word
   EnableWindow FindWindow("OpusApp", Application.Caption), True
End Sub

The behavior will be to make the form modeless such that the user can move
about in Word but the code will not run until the form is unloaded.

I want to create this same behavior from within the VB environment but it is
not working.

Any suggestions?

Thanks & Regards,

TC
alpine - 21 May 2005 15:43 GMT
Have a look at the following....

[http://groups-beta.google.com/group/microsoft.public.vb.winapi/messages/9d87ac12
57bc0d05,307897e97a10ed09,4bf4caf604aef78c,88b0831b3d4eeef2,1a252100c0086efd,30e
3ec88dfafddc6,0445463fe8ed6bec?hl=en&thread_id=75d3935e7d40248a&mode=thread&nohe
ader=1&q=modal+form+vb+-.net+alpine+showmodal&_done=%2Fgroup%2Fmicrosoft.public.
vb.winapi%2Fbrowse_frm%2Fthread%2F75d3935e7d40248a%2F0445463fe8ed6bec%3Fq%3Dmoda
l+form+vb+-.net+alpine+showmodal%26rnum%3D1%26hl%3Den%26#doc_30e3ec88dfafddc6
]

HTH,
Bryan
____________________________________________________________
New Vision Software                   "When the going gets weird,"
Bryan Stafford                     "the weird turn pro."
alpine_don'tsendspam@mvps.org     Hunter S. Thompson -  
Microsoft MVP-Visual Basic     Fear and Loathing in LasVegas

>Hey Folks,
>
[quoted text clipped - 29 lines]
>
>TC
 
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.