home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4793 < prev    next >
Encoding:
Text File  |  1993-01-09  |  3.9 KB  |  108 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. From: chris@chrism.demon.co.uk (Chris Marriott)
  3. Path: sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
  4. Subject: Re: Help needed with BC++ 3.0 Windows Programming without OWL 
  5. Distribution: world
  6. References: <115310001@hpcuhe.cup.hp.com>
  7. Organization: None
  8. Reply-To: chris@chrism.demon.co.uk
  9. X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
  10. Lines: 93
  11. Date: Sat, 9 Jan 1993 17:32:35 +0000
  12. Message-ID: <726600755snz@chrism.demon.co.uk>
  13. Sender: usenet@demon.co.uk
  14.  
  15. In article <115310001@hpcuhe.cup.hp.com> defaria@hpcuhe.cup.hp.com writes:
  16.  
  17. >Anyways, here are the problems that I haven't been able to resolve and really
  18. >need answered inorder to get my program doing anything useful.
  19.  
  20. I would *strongly* suggest you get the Microsoft Press book
  21. "Programming Windows 3.1" by Charles Petzold.  This is the "Bible" of
  22. Windows programming.
  23.  
  24. In the mean time, your questions.....
  25.  
  26. >
  27. >        How do I write get or set text into a child window?  My application
  28. >        presents a form-like window that has child windows that are TEXT
  29. >        input boxes.  I cannot figure out how to put/get text into or out of
  30. >        these child windows.
  31. >
  32.  
  33. If you are referring to an edit control, you set the initial contents of the
  34. control by sending it a WM_SETTEXT message, and retrieve the final value
  35. using the WM_GETTEXT message.  The functions SetWindowText and GetWindowText
  36. do the same thing.
  37.  
  38. >        How does one put text into a dialog box?  I want to do a familiar "Are
  39. >        you sure you want to delete 'thing being deleted'" type of dialog.  I
  40. >        need to construct the message string for the dialog box but I don't
  41. >        know how to do that.
  42. >
  43.  
  44. The easy way to do this sort of thing is with a MessageBox.  Eg, say:
  45.  
  46.     wsprintf( szBuffer, "Do you really want to delete %s?", szThing );
  47.     nResult = MessageBox( hWnd, szBuffer, "MyApp",
  48.                           MB_ICONQUESTION | MB_YESNO );
  49.     if (nResult==IDYES) {
  50.         ....
  51.     }
  52.  
  53. >        How can one get an icon image or a bmp into a button?
  54.  
  55. Use an "owner draw" button, and paint the bitmap onto it in response to
  56. a WM_DRAWITEM message.
  57.  
  58. >
  59. >        I tried making what would be called a staticTextWidget in X but it's
  60. >        color is wrong.  I want the color for a staticTextWiget to be the
  61. >        application's background color, not a TEXT boxes' input color.
  62. >
  63.  
  64. Process the WM_CTLCOLOR message and set whatever colour you want to use
  65. for the control.
  66.  
  67. >        How would I change the input editing semantics of these text input
  68. >        areas to be as I specify.  I like emacs type editing.  I get this
  69. >        easily in X via translation table and like to implement this in my
  70. >        program.
  71. >
  72.  
  73. You'd have to "subclass" the edit control.  Quite a lot of work.  Probably
  74. best to stick with the Windows user interface guidelines.
  75.  
  76. >And a non window related one:
  77. >
  78. >        How does one talk to a modem and dial a number like CARDFILE or
  79. >        TERMINAL does?
  80. >
  81.  
  82. Assuming your modem is Hayes compatible, just send the text string:
  83.  
  84.     "ATD 1234"
  85.  
  86. through the appropriate serial port.  This will make the modem dial the
  87. number "1234".  If you want it to leave the line open for you to pick up
  88. the phone and speak, end the number in a ";".
  89.  
  90. If you want to do this in Windows, you use the OpenComm/CloseComm/ReadComm/
  91. WriteComm set of functions.
  92.  
  93. >                                Thanks much
  94. >
  95.  
  96. Hope this information is of some use.  Windows programming has a *long*
  97. learning curve :)
  98.  
  99. Chris
  100. -- 
  101. --------------------------------------------------------------------------
  102. | Chris Marriott                           | chris@chrism.demon.co.uk    |
  103. | Warrington, UK                           | BIX: cmarriott              |
  104. | (Still awaiting inspiration              | CIX: cmarriott              |
  105. |  for a witty .sig .... )                 | CompuServe: 100113,1140     |
  106. --------------------------------------------------------------------------
  107.  
  108.