🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11894

Re: GINA Development and message catching...

#11894
From: Remy Lebeau (TeamB)
Date: Sat, 10 Jan 2004 02:11
87 lines
4216 bytes
"Mike Collins" <mikec@kr8.co.uk> wrote in message
news:3fff49a8@newsgroups.borland.com...

> I tried Using Application->HookMainWindow which complied
> fine but I still dont get the WLX_WM_SAS message being sent.

All the more reason to think then that you really are using the wrong kind
of dialog window to begin with.

> So based on that, it seems that I will have to opt for using the
> WlxDialogBox option.

It would appear so.

> However one of the parameters to this function is a string
> specifying the resource ID of the template for the dialog

You need to create a dialog template and add it to you project's resources.
A dialog template is basically just a block of text that describes the
window and its controls.  For example:

    103 DIALOG 20, 20, 309, 166
    STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
    CAPTION "DynaZIP Rename File"
    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    FONT 8, "MS Sans Serif"
    {
        CONTROL "", 1152, EDIT, ES_LEFT | ES_AUTOHSCROLL | ES_OEMCONVERT |
WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 5, 34, 114, 12
        // other controls are listed here...
    }

Then, when you call WlxDialogBox(), it loads and reads the specified dialog
data, creates the actual window and its children, and uses the callback
function you provide for handling messages that are sent to it.

> I assume this is the same sort of templete that VC++ uses as
> opossed to the way borland uses the VCL form designer.
> Based on that, is it possible to design a form in VC++, save it
> to my DLL's resource and then point this lpszTemplate at it.

Since I have never used VC++, I am not familiar with how it creates/designs
dialogs or how it stores them prior to compiling.  All I can tell is what
you have to do on the BCB side of things.

You need to create a new text file with an .RC file extension.  Inside that
file, you can include the necessary dialog information, ie:

    --- MyDialog.rc ---

    // you can tweak these values as needed...

    MyDialog DIALOG 20, 20, 309, 166
    STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
    CAPTION "My Dialog"
    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    FONT 8, "MS Sans Serif"
    {
        CONTROL "", 1234, EDIT, ES_LEFT | ES_AUTOHSCROLL | ES_OEMCONVERT |
WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 5, 34, 114, 12
        // other controls listed here...
    }

Look at the Win32 API documentation for more information on what all of the
values do, and what kinds of values can be used.

Then, add the .RC file to your project and it will automatically be compiled
into the executable's resources.  Then later on, when you call
WlxDialogBox(), you can specify "MyDialog" as the dialog name, ie:

    WlxDialogBox(..., (HINSTANCE)hInst, L"MyDialog", ..., MyDlgProc);

Or, if you use a number instead of a name, ie:

    100 DIALOG 20, 20, 309, 166

Then use MAKEINTRESOURCEW(), ie:

    WlxDialogBox(..., (HINSTANCE)hInst, MAKEINTRESOURCEW(100), ...,
MyDlgProc);

In either case, MyDlgProc() is the callback function to use for handling
messages that are send to the dialog.


Gambit
Technical Details
Message-ID: <3fff5dec$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3ffe0272$1@newsgroups.borland.com> <3ffe0de9$1@newsgroups.borland.com> <3fff49a8@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,a212091b844eec5a
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-01-09 18:09:58 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ffe0272$1@newsgroups.borland.com> <3ffe0de9$1@newsgroups.borland.com> <3fff49a8@newsgroups.borland.com>
Subject: Re: GINA Development and message catching...
Date: Fri, 9 Jan 2004 18:11:34 -0800
Lines: 89
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.138.253
Message-ID: <3fff5dec$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1073700332 67.22.138.253 (9 Jan 2004 18:05:32 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail