Solved

Crazy question

Posted on 2002-03-22
13
136 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
ID: 6890240
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
ID: 6890248
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
ID: 6890250
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
ID: 6890261
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
ID: 6891116
following Anthony's thinking:
frmMyForm.Show vbModeless, Me
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 6891254
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:dosyl
ID: 6891354
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
ID: 6891577
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
ID: 6891587
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
ID: 6895391
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
ID: 6895464
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 7060605
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
ID: 7065747
Thanks, emoreau  for your help here.

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

Moondancer - EE Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

920 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

16 Experts available now in Live!

Get 1:1 Help Now