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