Board index » delphi » Modeless Dialogs using API only

Modeless Dialogs using API only

Hi all,

Does anyone have an example of how to create and display modeless dialog,
using Windows API calls _only_ (i.e., no OWL code at all)?

I want to use a dialog resource for this. I know how to use DialogBoxParam()
to create a modal dialog, and there is no problem in this regard.

I know that I can use CreateDialogParam() to create a modeless dialog;

e.g.,

    i:=CreateDialogParam(HInstance, 'MyDialog', ParentWindow, Proc, Param);
    MyWindow:=i;
    ShowWindow(i, CmdShow);

 - but there is always a problem with the dialog that is thereby created.

Thanks all.

The Chief
--------
Dr. A{*word*73}la A. Olowofoyeku (The African Chief)
Email: la...@keele.ac.uk
Author of: Chief's Installer Pro 2.91 for Win16 and Win32:
           Winner of PC PLUS Magazine Gold Award (April 1995 U.K. edition)
           http://ourworld.compuserve.com/homepages/African_Chief/chief.htm

 

Re:Modeless Dialogs using API only


In article <530eue$...@gerry.cc.keele.ac.uk>,
la...@cc.keele.ac.uk (A.A. Olowofoyeku) says:

Quote
>Does anyone have an example of how to create and display modeless dialog,
>using Windows API calls _only_ (i.e., no OWL code at all)?

Sorry, no example.

Quote
>I want to use a dialog resource for this. I know how to use DialogBoxParam()
>to create a modal dialog, and there is no problem in this regard.
>I know that I can use CreateDialogParam() to create a modeless dialog;
>    i:=CreateDialogParam(HInstance, 'MyDialog', ParentWindow, Proc, Param);
>    MyWindow:=i;
>    ShowWindow(i, CmdShow);

Try changing 'MyDialog' to 'MYDIALOG', since resources are saved
in capitals. Or use
        MakeIntResource(Id_of_MyDialog)
instead of 'MyDialog'

Quote
> - but there is always a problem with the dialog that is thereby created.

What's the return value? If it's zero, one of the parameters is wrong.
Maybe Proc isn't exported?

Bye,
Zweitze.

-----------------------------------------------------------------------
  Zweitze de Vries                           zwei...@cyco.nl
  Cyco Software Development
  Handelskade 49
  Rijswijk, Netherlands                      (+31) 70 3954179

Re:Modeless Dialogs using API only


Zweitze de Vries (zwei...@cyco.nl) wrote:
: In article <530eue$...@gerry.cc.keele.ac.uk>,
: la...@cc.keele.ac.uk (A.A. Olowofoyeku) says:

: >    i:=CreateDialogParam(HInstance, 'MyDialog', ParentWindow, Proc, Param);
: >    MyWindow:=i;
: >    ShowWindow(i, CmdShow);
:
: Try changing 'MyDialog' to 'MYDIALOG', since resources are saved
: in capitals. Or use
:       MakeIntResource(Id_of_MyDialog)
: instead of 'MyDialog'

This is not the cause of the problem - because the dialog is actually
created from the resource, and displayed.

: > - but there is always a problem with the dialog that is thereby created.
:
: What's the return value? If it's zero, one of the parameters is wrong.
: Maybe Proc isn't exported?

My fault for not explaining the problem in full. The dialog appears and then
a GPF. I can make it stay on screen and not GPF by using a GETMESSAGE loop
after the call to ShowWindow() - but I am not sure that this is really how
to do it.

The Chief
--------
Dr. A{*word*73}la A. Olowofoyeku (The African Chief)
Email: la...@keele.ac.uk
Author of: Chief's Installer Pro 2.91 for Win16 and Win32:
           Winner of PC PLUS Magazine Gold Award (April 1995 U.K. edition)
           http://ourworld.compuserve.com/homepages/African_Chief/

Other Threads