home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / misc / 3516 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  2.2 KB

  1. Path: sparky!uunet!usc!sol.ctr.columbia.edu!spool.mu.edu!agate!doc.ic.ac.uk!uknet!brunel!cs92njc
  2. From: cs92njc@brunel.ac.uk (Nicholas J Clayton)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Visual Basic questions
  5. Message-ID: <Bxwt09.K8@brunel.ac.uk>
  6. Date: 18 Nov 92 11:24:08 GMT
  7. References: <92322.092615SASTPH@vm.sas.com>
  8. Organization: Brunel University, West London, UK
  9. Lines: 38
  10.  
  11. In article <92322.092615SASTPH@vm.sas.com> SASTPH@vm.sas.com writes:
  12. >1.  Append an item to the system menu and get notified when it's
  13. >    selected.  My app doesn't need a full-scale menu bar, so I just
  14. >    append my "About FOO..." menu item to the system menu.
  15.  
  16. Have VB call the Windows procedure othat does this. I don't have the 
  17. code to hand, but if you look in the IconDraw sample program that comes
  18. with VB, and some of the dialog boxes (sic) that are with it, they remove
  19. all but the 'move' and 'close' options from the system menu. It can work
  20. in reverse.
  21.  
  22. >2.  Send messages between forms.  My app uses three windows.   Clicking
  23. >    on a control in the main window causes immediate changes to the
  24. >    other two windows.
  25.  
  26. To alter controls on other forms just preface the control name with the form name,
  27. form1.OKButton for example will refer to the OKButton on form1. You can use global
  28. or shared variables to communicate data between the forms.
  29.  
  30. >3.  Detect when the form is iconized. My app draws on its icon, which
  31. >    I understand can be done in Visual Basic, but when?  In C I just
  32. >    call IsIconic() whenever I get a WM_PAINT message and paint the
  33. >    icon when it (IsIconic) returns TRUE.  While I'm aware that I
  34. >    can call IsIconic from VB, surely I don't need to for such a
  35. >    simple thing?
  36.  
  37. I forget whether you can paint the icon from within VB. I've never tried, but I
  38. don't see any reason why you can't. Anyway, I'm digressing. The file
  39. "constant.txt" defines 3 values, MINIMIZED, MAXIMIZED and NORMAL which you can use
  40. in conjunction with the WindowState property.
  41.  
  42. if Form1.WindowState = MINIMIZED Then...
  43.  
  44. Rgds, Nik
  45.  
  46. PS: Not having VB to hand (and not using it in 2 months) means that the example
  47. above may be a touch off. I'm fairly certain the property is called WindowState,
  48. if not then its something similar and fairly easy to recognise.
  49.