Solved

Crazy question

Posted on 2002-03-22
13
138 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 70

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
 
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 70

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 70

Accepted Solution

by:
Éric Moreau earned 300 total points
ID: 6895464
0
 
LVL 70

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

820 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