Subject: Re: Help needed with BC++ 3.0 Windows Programming without OWL 
Distribution: world
Organization: None
Reply-To: chris@chrism.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Date: Sat, 9 Jan 1993 17:32:35 +0000

In article <115310001@hpcuhe.cup.hp.com> defaria@hpcuhe.cup.hp.com writes:

>Anyways, here are the problems that I haven't been able to resolve and really
>need answered inorder to get my program doing anything useful.

I would *strongly* suggest you get the Microsoft Press book
"Programming Windows 3.1" by Charles Petzold.  This is the "Bible" of
Windows programming.

In the mean time, your questions.....

>
>        How do I write get or set text into a child window?  My application
>        presents a form-like window that has child windows that are TEXT
>        input boxes.  I cannot figure out how to put/get text into or out of
>        these child windows.
>

If you are referring to an edit control, you set the initial contents of the
control by sending it a WM_SETTEXT message, and retrieve the final value
using the WM_GETTEXT message.  The functions SetWindowText and GetWindowText
do the same thing.

>        How does one put text into a dialog box?  I want to do a familiar "Are
>        you sure you want to delete 'thing being deleted'" type of dialog.  I
>        need to construct the message string for the dialog box but I don't
>        know how to do that.
>

The easy way to do this sort of thing is with a MessageBox.  Eg, say:

    wsprintf( szBuffer, "Do you really want to delete %s?", szThing );
    nResult = MessageBox( hWnd, szBuffer, "MyApp",
                          MB_ICONQUESTION | MB_YESNO );
    if (nResult==IDYES) {
        ....
    }

>        How can one get an icon image or a bmp into a button?

Use an "owner draw" button, and paint the bitmap onto it in response to
a WM_DRAWITEM message.

>
>        I tried making what would be called a staticTextWidget in X but it's
>        color is wrong.  I want the color for a staticTextWiget to be the
>        application's background color, not a TEXT boxes' input color.
>

Process the WM_CTLCOLOR message and set whatever colour you want to use
for the control.

>        How would I change the input editing semantics of these text input
>        areas to be as I specify.  I like emacs type editing.  I get this
>        easily in X via translation table and like to implement this in my
>        program.
>

You'd have to "subclass" the edit control.  Quite a lot of work.  Probably
best to stick with the Windows user interface guidelines.

>And a non window related one:
>
>        How does one talk to a modem and dial a number like CARDFILE or
>        TERMINAL does?
>

Assuming your modem is Hayes compatible, just send the text string:

    "ATD 1234"

through the appropriate serial port.  This will make the modem dial the
number "1234".  If you want it to leave the line open for you to pick up
the phone and speak, end the number in a ";".

If you want to do this in Windows, you use the OpenComm/CloseComm/ReadComm/
WriteComm set of functions.

>                                Thanks much
>

Hope this information is of some use.  Windows programming has a *long*
learning curve :)

Chris
-- 
--------------------------------------------------------------------------
| Chris Marriott                           | chris@chrism.demon.co.uk    |
| Warrington, UK                           | BIX: cmarriott              |
| (Still awaiting inspiration              | CIX: cmarriott              |
|  for a witty .sig .... )                 | CompuServe: 100113,1140     |
--------------------------------------------------------------------------