home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.ms.programmer,comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!paladin.american.edu!gatech!mailer.cc.fsu.edu!loligo!rekle
- From: rekle@loligo.cc.fsu.edu (Rick Ekle (CompSci))
- Subject: Creating custom messages in Windows 3.1
- Message-ID: <1993Jan7.040719.11710@mailer.cc.fsu.edu>
- Summary: How do I create a new Windows message unique to my program,
- register it with Windows, and call it from within my program.
- Sender: news@mailer.cc.fsu.edu (Usenet News File Owner)
- Nntp-Posting-Host: loligo.cc.fsu.edu
- Organization: Florida State University Computing Center
- References: <1992Dec30.191610.3685@pony.Ingres.COM>
- Distribution: na world
- Date: Thu, 7 Jan 93 04:07:19 GMT
- Lines: 40
-
- I was thinking the other day:
-
- Is this possible? I would like to create a custom message and call it
- from within my program. i.e.
-
- #define WM_MYNEWMESSAGE <integer value>
-
- // ...later in the windows procedure:
- long FAR PASCAL _export WndProc(HWND hwnd, UINT message, UINT wParam,
- LONG lParam)
- {
- int counter=10;
- switch (message)
- {
- case WM_MYNEWMESSAGE:
- // This case statement is basically the body of a simple for loop.
- // The body of this statement is executed counter number of times.
-
- // Print a message to screen
- --count;
- if ( count != 0 )
- SendMessage(hwnd,WM_MYNEWMESSAGE,0,0L);
- return 0;
- default: // Pass message to DefWindowProc
- }
- }
-
- I figured that this technique would be usefull in performing long loops
- without tying up Windows in one program... Other programs get to run and
- the loop still executes.
-
- Is this even possible?
-
- --
- /---------------------------------------------------------------------------\
- | Rick Ekle | rekle@loligo.cc.fsu.edu | Birth, School, Work, Death. |
- |---------------------------------------------------------------------------|
- | "I survived Hurricane Andrew." | This Space For Rent | FSU #1!!! |
- \---------------------------------------------------------------------------/
-
-