Solved

Crazy question

Posted on 2002-03-22
13
135 Views
Last Modified: 2010-05-02
Is there a way?
In many application I must to call my forms MODALS,
but I need to be able to click in the form or the  pgm. that call my form(like: Internet Explorer) even if the form called is MODAL!!!!!!!!!

API(maybe)??

300points for the good answer.
Thanks
0
Comment
Question by:dosyl
  • 4
  • 4
  • 3
  • +2
13 Comments
 
LVL 6

Expert Comment

by:anthony_glenwright
Comment Utility
Why do you have to call your forms as modal?  The desired behaviour you describe is that of non-modal forms.
0
 
LVL 1

Author Comment

by:dosyl
Comment Utility
Because It is a ocx to use on Internet Explorer,VB, VFoxPro and anywhere. FoxPro, IE, need Modal form.
0
 
LVL 1

Author Comment

by:dosyl
Comment Utility
Scuse it is LIKE a message, but the user must be able to click in the form that call the "message".
0
 
LVL 6

Expert Comment

by:anthony_glenwright
Comment Utility
So you are calling a method and showing the form with code like:

frmMyForm.Show vbModal ?

Are you specifying an owner?  (as the second parameter to .show).  Do you get a particular error message if you show the form as non-modal?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
following Anthony's thinking:
frmMyForm.Show vbModeless, Me
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
do you want something like a top most window (just like the help files)?

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long,
ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_SHOWWINDOW = &H40

Dim num As Integer
Dim chkChangeByPrm As Boolean

Public Function SetTop()
   SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, _
       SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE _
       Or SWP_NOSIZE
End Function

Public Function SetNOTOP()
   SetWindowPos hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, _
       SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE _
       Or SWP_NOSIZE
End Function
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Author Comment

by:dosyl
Comment Utility
emoreau, My form ia already on the top with: Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
but I must to be able click in the calling form.

anthony_glenwright
my form is call like this:
Form2.Show 1

else If I write it like this:From2.Show, the pgm. doesn't work.I have the message that the Non Modals Forms are not accepted.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
if your form is already on top, remove the 1 after the show and it should work correctly.


>>else If I write it like this:From2.Show, the pgm. doesn't work.I have the message that the Non Modals
Forms are not accepted.

what is the err number? can you send and example of this application?
0
 
LVL 6

Expert Comment

by:anthony_glenwright
Comment Utility
Hmm... I have actually run into this before, with a MS project add-in.  It also doesn't allow non-modal forms, and gives an error if you try to show one.

The bad news is, I never found a solution.
0
 
LVL 1

Author Comment

by:dosyl
Comment Utility
emoreau:
The error is #406. I cannot remove the 1, else I have the error with IExplorer and FoxPro. If I keep the 1, I cannot access to the calling form.!!!!!

I tought something like a timer with the Interval 500 to set the focus to the calling form and set the focus to the called form every .5 second. But how???????????

Thnks anthony
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 300 total points
Comment Utility
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
This question appears to be abandoned. A question regarding it will be left in the Community Support
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <emoreau>.

The link to the Community Support area is:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
Thanks, emoreau  for your help here.

I have finalized this question, and will monitor it for comments.

Moondancer - EE Moderator
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now