programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: color of a progress bar

From: Mike Ghan <mikeghan_at_logix-controls.com>
Date: Wed, 5 Mar 2003 08:43:54 -0800

Sorry, I was a bit hasty quick with "cut and paste". The Windows
environment has *thousands* of constants defined, mostly in .H header
files. Many of the most common constants (e.g. WM_PAINT) are resolved
by SwiftForth using the WinCon.DLL library (part of the SwiftForth
install). Basically, the SwiftForth compiler/interpreter attempts to
find a word in the current search order. If not found it attempts to
convert the word into a number. If that is unsuccessful, SwiftForth
will attempt to "lookup" the constant in the WinCon.DLL file. This
method has advantages: dictionary searches are minimized and your
SwiftForth program is not bloated with thousands of unused constants.

Unfortunately, not all possible constants are defined in the DLL, many
newer or specialized constants are missing.

Fortunately, defining a new constant (as in the example below) is not
difficult. First, you'll need to download the rather huge (200MB+)
Windows SDK (include the "Core" components and build environment).
The SDK installer will create a subdirectory named \Include which will
contain over 600 .H header files. Search these files for the Windows
constant of interest.

Hope this was useful,
Mike

\ From the CommCtrl.H header file
\ #define PBS_SMOOTH 0x01
\ #define PBM_SETBARCOLOR (WM_USER+9) // lParam = bar color

$0001 CONSTANT PBS_SMOOTH \ IE 4.0+ Style
WM_USER 9 + CONSTANT PBM_SETBARCOLOR \ Set Bar Color Message

-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On
Behalf
Of Roger Dube
Sent: Wednesday, March 05, 2003 8:06 AM
To: sftalk_at_forth.com
Subject: [sftalk] Re: color of a progress bar

Hmmm. doesn't work - Forth doesn't recognize the word PBM_SETBARCOLOR.
It
seems similar to a DLL error if you forget to IMPORT a function... I
copied
and pasted your word into progress.f to avoid typing errors...

I also looked at the MS link and many other examples of sendmessage,
and
don't see what's wrong here. Any suggestions?

- Roger

At 07:13 AM 3/5/2003 -0800, you wrote:
>: PROGRESS-COLOR ( rgb -- )
> PB IF >R PBAR PBM_SETBARCOLOR 0 R> SendMessage THEN DROP ;
>
>... 255 ( Red ) PROGRESS-COLOR

----------------------------------------------------------------------
Dr. Roger Dube

rdube_at_entropylock.com

President/CEO
Digital Authentication Technologies, Inc.

http://www.entropylock.com

TEL +1.561.392.7404

PO Box 811564
Boca Raton, FL 33481-1564

----------------------------------------------------------------------

This E-mail message and any attachments have been scanned for viruses
and
are believed to be free of any virus or other defect that might affect
any
computer system into which it is received and opened. However, it is
the
responsibility of the recipient to ensure that it is virus free and no
responsibility is accepted by Digital Authentication Technologies,
Inc. for
any loss or damage arising in any way from its use.

This email message is for the sole use of the intended recipient(s)
and may
contain confidential and privileged information. Any unauthorized
review,
use, disclosure or distribution is prohibited. If you are not the
intended
recipient, please contact the sender by reply email and destroy all
copies
of the original message. Any views expressed in this message are those
of
the individual sender, except where the sender specifically states
them to
be the views of Digital Authentication Technologies, Inc.

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Wed Mar 05 2003 - 08:46:57 PST

This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:08 PST