Professional Documents
Culture Documents
MSJ 1986 10
MSJ 1986 10
Special
Windows
Issue
SystemsJournal
a Advanced Reuter Terminal Gives
Traders Windows on Financial World
The Advanced Reuter Terminal (ART), a dedicated hardware and software system that
runs under Microsoft® Windows, enables currency traders to view and analyze up-to-the-
minute financial data. An exclusive interview reveals the developing team's experiences .
[gJ Bordet·
0 Capti on II Latest Dialog Editor Speeds
Windows Application Development
An improved version of the Microsoft Windows Dialog Editor (supplied with the
0 Group Bi t software development kit) simplifies designing and testing a dialog box-one of the key
[gJ Tab Stop Bi t elements of a Windows application . Here's how to use it and what to watch out for.
pcjs.org
EDITOR'S NOTE
his first issue of the Microsoft Systems Journal is devoted in its
entirety to Microsoft Windows operating environment, Microsoft's most im-
portant system software product since MS-DOS®.
Windows has encountered remarkable success both as a retail product and
as a development environment since its release last November. While much
of the product's initial popularity can be attributed to its flexibility as a "switcher" for tradi-
tional applications and the included sample applications, its ultimate success will depend on
the acceptance of native Windows applications.
Reuters' ART
As a definitive example of the capabilities of Microsoft Windows and its flexibility to serve
particular user interface designs, we examine the Advanced Reuter Terminal (ART), the
most sophisticated Windows application to date. A superb example of design and coding
craftsmanship, the ART would be worth featuring even if it were not based on Windows.
We also present profiles of two graphics processors that will have a significant impact on
future graphics systems: the Intel 82786 and the Texas Instruments TMS34010. And we
take a look at DDE, a new standard for interprogram data exchange, as well as examine the
improved Dialog editor. In addition, Dr. Bob tackles some questions about Windows from
developers. In sum, we hope to present a developer's view of Microsoft Windows.
Future Issues
In future issues we will focus on other areas of interest to developers, including C program-
ming, device drivers, extended and expanded memory, debuggers, code portability, and the
inside view of MS-DOS and Microsoft XENJX®. We will tackle the subjects that interest
serious developers most-from user interface design to guidelines for writing terminate-and-
stay-resident programs. Our aim is to confront rhe real issues confronting serious developers.
Write to Us
We invite you to write to us, to subscribe, and equally important, to tell us what you think
we should include in the Journal. Beginning in January 1987, our issues will expand to full
size, more than twice the length of this special issue.
We hope the Journal will become one of the most important publications you receive.
-Ed.
The Microsoft Systems Journal (ISSN #0889-9932) 1s published every other month by Microsoft Corporation, 10611 NE 36th Way. Box 97017, Redmond , Washington
98073-9717 . Officers : William H. Gates. Il l. Chairman of the Board and Ch ief Executive Officer: Jon Shirley . President and Chief Operating Officer: Francis J. Gaudette.
Treasurer : William Neukam . Secretary. Subscription rate : $50.00 per year (single copies $10.00). To order subscriptions or report change of address . write to the
Circulation Department, Microsott Systems Journal. Box 97017 , Redmond , Washington 98073-9717 . Manuscript submissions and all other correspondence should
be addressed to H. Roark & Associates , Suite804 , 141 East 44th St. , New York., NY 10017.
Copyright © 1986 Microsoft Corporation. All rights reserved; reproduction in part or in whole without permission is prohibited.
pcjs.org
ART Showcases
Microsoft Windows
D
MSJ Interview
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
JOURNAL
pcjs.org j
? . 000
DMPA +rrlt I ~.7300
II
? . 01" 400
1. 010 3~0
7 . 0(, ~ • ,00
? . 060
21SO
IH2 't3Q4
XAU
RHBG 376.00/377.30
PBlJS 3/6. 70/377. 70
RHOG :r/6.70/377.20
CSS(, 376.90/377.40
RHOG 3/6.80/377.30
XAG
17 : 12
17 : 04
16 ! 39
16 !41
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
JOURNAL
pcjs.org
OCTOBER 1986
Dynamic Data Exchange
Enhances Application
Connectivity
Harvey Berger
WINDOWS DYNAMIC
DATA EXCHANGE (DOE) IS
ment.
INTENDED TO FACILITATE
The Windows Clipboard is IMPLEMENTATION OF
what serves as the intermediate
repository for such information MORE COMPLEX
exchanges among applications.
A Step Forward
TRANSFERS THAN ARE
At your direction, information
is placed on the Clipboard by a The Clipboard's facilities are POSSIBLE WITH SINGLE
CUT or COPY operation in quite flexible, but they require
manual intervention for each
OR EVEN MULTIPLE
one application and then insert-
ed into the context of a second transfer, and the Clipboard can CLIPBOARDS.
application with a PASTE hold only one "item" at a time.
operation. In a multitasking environment
On the surface the process like Windows , the need rapidly
seems straightforward-a selec- develops for more sophisticated
tion, a CUT or COPY, and data exchange facilities. Win-
then a PASTE-and manual. dows Dynamic Data Exchange
But behind the scenes the two (ODE) is intended to facilitate
applications and Microsoft implementation of more com-
Windows combine to effect the plex information transfers than
actual transfer. The donating ap- are possible with single or
plication takes control of the even multiple clipboards.
Clipboard and places the ODE is a formal, public
selected information on it in protocol for data exchange built
one or a series of formats. The on Windows messaging. and
receiving application then the shared memory facility .
selects a format and requests the DOE is much more an
data from the Clipboard. agreement among cooperating
In many cases, to save applications than it is a partie-
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
JOURJ\'AL
pcjs.org
OCTOBER 1986
Names and Topics
typedef s t ruct (
When requesting or supply- WORD wDDEMODE ;
ing data, the names are provided WORD wFormat ;
DDEADVISEBLOCK ;
to allow the communicating typedef struct (
task to identify the source or WORD wClientRelease ;
WORD wFormat ;
disposition of the data item. WORD hServerWnd ;
Names describe either the loca- WORD ClipData ;
tion or the contents of a data UPD ATE I NFO ;
ATOM aCompare ;
item. In a spreadsheet, each cell
BOOL bAccepted ;
has an address (for example, lo ng FAR PASCAL Sa mpleRcvrW ndProc ( hWnd , message , wParam , lParam)
R2C3 for the cell in the second switch (message)
row and third column). Some
spreadsheets also have named
cell ranges (R I :4C5 , for ex- case WM_DDE_ ACK :
ample, might be named aCompare ~ HIWORD(lParam) ;
bAccepted ~ LOWORD ( lParam) ;
TOTALS). In either case, a /* Is this acknowledgement of first inquire message? */
natural relationship exists be- if ( (aCompare ~~ aStockinfo) && bAccepted)
hwndServer = wParam ;
tween names and data items. else I
With other kinds of applica- /* is this the acknowledgement of an advise message? * /
for (i ~ 0 ; i<NUMSTOCKS ; i++) (
tions, like word processors , if (aCompare ~~ stockinfo [ i] . Atom ) I
names are likely be to more /* Record Server ' s response to Stock Symbol * /
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
.JOURNAL
pcjs.org
OCTOBER 1986
APPI with an ACK (acknow-
ledgement) message.
3. APPI then sends a RE-
QUEST message specifying
WATER as the desired item
P r ocessNe wDa ta (h wnd ,
HW ND hwnd ;
DWORD lStu ff ;
I
ATOM
HANDLE
aData
lStuff )
: HIWORD ( lStuff );
hDDEData: LOWORD ( lStuff ) ;
UPDATEIN FO far *lpDataBloc k ;
ID
name.
LPSTR lpData ;
4 APP2 responds with a text HDC h d c ;
string OAT A message pointing int i , c ;
/ * Make sure we ' re getting info only fro m our server * /
to WATER=H20. / * Note : hwndServer is a global variable * /
5. APPI then sends a if (h wnd !: h wn dServer )
re t ur n ;
REQUEST message for SALT. lpDataBlock : (UPDATEINFO far *) Global Loc k( hDDEData ) ;
6. APP2 responds with an for ( i : 0 ; i<NUMSTOCKS ; i++ ) {
if (aData : : stockinfo[i] . Atom )
OAT A message specifying
SALT=NaCI.
·A~:( r-.:..:
S3" S?- 0 S2 ::; S.3 0 .''"·K ti }l "i H ~-
The selected data is then ana- part. !1:: F"A: SB SB- 5 '"8: i: SB .;; ~:. !: ::' !-l ·; ti ·
u:-: ;,:~f .:.l e1 o ".? " t-~ o ~:: t: r :: ~- 1; ,'
lyzed to determine the required ,J,.r':!EY~c: s-1: ssos..;..:. <t-··i:t<!::~:: v
.U:: FF.!I 2>~ :0 i ~Q 7 ::0.4 S4·f: N !IN::')
A~:( r!.S -: -:- : 2 73 S 72 l l':!M: S 1i N f: D
action. One of the first demon- ADVISE-OAT A Ai:C EA: t.: 12 :< l3 ~ 11 :> ':'1111·: ? !1 Y H ';
•
and respond to ODE messages. with NY STOCK PRICES.
A simple bar-charting program
was then written to receive the
DOE DATA messages.
2. The Signal Monitor
Application Four (APP4) re-
sponds with an ACK.
I
Interestingly the SIGNAL 3. APP3 sends APP4 an
monitor program was written ADVISE message that specifies
in New York City by consult- IBM.®
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
.JOURNAL
pcjs.org
OCTOBER 1986
Figure 6: Foreign Intrigue
~ <€]
CLIENT AGENT NETWORK AGENT SERVER
K K
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
.JOURNAL
The Future
The fact that Microsoft Win-
dows is independent of any
physical device permits applica-
tions to take full advantage of
the capabilities of a wide var-
iety of current and future
displays, printers, and pointing
devices. Application devel-
opers are freed from having to
pcjs.org
OCTOBER 1986
Figure 9: Server's Response to Advise Request
be concerned in their programs
with the peculiarities of partic-
ular devices. ODE extends the
same concept to data exchange.
If an application honors DOE
requests, it's then able to com-
void
HWN D
WORD
DWORD
{
dde_advise( hwnd , hwndClient , lData )
hwnd ;
hwndClient ; /*Contains client ' s window handle •/
lData ;
ATOM
BOOL
GLOBALHAND LE
atom ;
b;
gh;
m
municate with all other applica- DDEADVISEBLOCK FAR * lpDDEAdviseBlock ;
int i ' j ' k;
tions that do so, without hav- LPSTR lps ;
ing to consider their pecu- char * p;
char sz[ 20 J ;
liarities. b ~
FALSE ;
DOE is an important step atom = (ATOM) HIWORD ( lData ) ;
/* Lookup Symbol in Table */
forward m inter-application if ( SymbolisAvailable ( atom ) ) {
communication, since it pro- gh (HANDLE) LOWORD( lData ) ;
vides a public protocol that ap- lpDDEAdviseBlock ~ (DDEADVISEBLOCK FAR*) GlobalLock( gh ) ;
if( b break ;
GlobalUnlock( gh ) ;
return ;
OCTOBER 1986
pcjs.org
MICROSOFT
SYSTEMS
.JOURNAL
General Electric Information Services' worldwide teleprocessing network is offering 24-hour on-line support for
Windows software applications developers through GENIE (General Electric Network for Information
Exchange). Access to GENIE and its variety of GE computer support services is through PCs and terminals via
a local phone line available in 450 U.S. cities.
The keystone of GENIE is the Microsoft Windows Developers RoundTable, an electronic interchange for
Windows developers. The RoundTable is sponsored and maintained by Microsoft and allows applications
developers to scan posted messages on the most recent Windows applications developments, access and
download technical updates on Windows, and electronically discuss with experts and other developers ideas on
multitasking, visual interface, and hardware independence capabilities.
GENIE's Developers RoundTable also includes such topics as Business-Band Real Time Conferencing,
electronic bulletin boards, and a downloadable library of software programs.
Additionally, GENIE supplies a full-service electronic mail system, GE Mail and current news about the
personal computing industry through the ISIS High Tech News Wire, the Networker's Journal, and Computing
Today! through GENIE's News and Commentary.
Requirements: IBM PC or compatible computer, asynchonous modem (either 300 or 1200 baud),
communication software package, telephone.
Current subscription rates for GENIE are $18.00 one-time enrollment charge, $35.00 per connect hour during
prime time (8 a.m. to 6 p.m. daily, including weekends and holidays), $5.00 per connect hour during
nonprime time (6 p.m. to 8 a.m. daily, including weekends and holidays).
Forfurther information about GENIE, call (800) 638-9636.
pcjs.org
SEPTEMBER 1986
New Intel Graphics
Coprocessor Makes
m
Windows Sparkle
Joe Desposito
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
JOURNAL
pcjs.org
OCTOBER 1986
points out, "As Windows
evolves, we expect that it will
be ideally suited for desktop
publishing. And since the
82786 is so well suited as a
GDI device, we believe that the
82786 is also applicable to that
market." Many of the desktop
publishing packages currently
on the market take quite a long
time to reformat information
on the screen. And displaying a
variety of fonts on the screen is
time consuming and awkward.
Continues Bader, "The speed of
the 82786 will change all that.
Microsoft Windows in conjunc-
tion with the 82786 will give a
good performance."
The 82786 supports a wide
range of monitors, which is that 17-inch high-resolution
also a plus for desktop pub- monochrome monior. They're
lishing. It easily supports sys- looking for extremely crisp,
tems that are 640 by 480 with stable, high-performance text
64 colors. Additionally, Bader displays, and that's exactly
points out, "We can also sup- what the 82786 is capable of
port large-format screens, full- providing."
page displays, with a resolution Intel and Microsoft have
in the order of 1200 by 800, entered a cooperative program
1400 by 1400, or 1000 by 800 to provide Microsoft Windows
with gray scales. What we've software driver technology for
found in a number of instances systems designs using the Intel
is that people are looking for 82786. •
Graphics Instruction
64 Bit-Block Transfer Within Bit-Map 53 Draw Point
AE Bit-lock Transfer Across Bit-Maps B4 Draw Incremental Points
06 Define Texture: Opaque BA Draw Series of Horizontal Lines
07 Define Texture: Transparent 54 Draw Line
OA Define Character Set: Word 58 Draw Rectangle
OB Define Character Set: Byte 73 Draw Polygon
lA Define Bit-Map 74 Draw Polyline
3D Define Colors 8E Draw Circle
41 Define Logical Combination A6 Draw Character String: Opaque
46 Define Clip Rectangle A7 Draw Character String: Transparent
4D Define Inter character Space 44 Enter Pick Mode
4E Define Character Orientation 45 Exit Pick Mode
68 Draw Arc: Exclusion 4F Move to Absolute Position
69 Draw Arc: Inclusion 52 Move to Relative Position
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
.JOURNAL
Corporate software developers can receive introductory and advanced hands-on instruction on Windows
applications by participating in Windows development classes offered through Boeing Computer Services.
Microsoft Windows-Overview (Course No. 005)
This two-day course is designed for project managers, application development managers, application
designers, and programmers. Attendees should have experience in application development software.
Through lecture, instructor-led demonstrations, and student hands-on exercises, the course is a
comprehensive introduction to the Microsoft Windows environment. Subjects covered include the use of
Windows, the impact of a visual interface, resource management, use of the mouse, and basic application
development techniques.
Microsoft Windows-Application Programming Workshop (Course No. 006)
A five-day, hands-on workshop, this course is intended for software designers and programmers who are
interested in developing or converting applications to be used in the Microsoft Windows environment. To
take advantage of the many festures of Microsoft Windows, applications must be designed and written using
the Windows Development Tooolkit. This course covers the toolkit, structure of Windows' application,
and steps involved in builing the application. Team exercises are used to lead attendees through the
capabilities and complexities of Windows programming. The C programming language is used for all
exercises. Prerequisites for the course are successful completion of UNIX-C Programming Language
(Course No. 397), IBM PC/XT Hardware and Advanced DOS Concepts (Course No. 166), and Microsoft
Windows-Overview (Course No. 005), Applicable work experience may be substituted for the C
Programming.
Boeing Computer Services also offers its Windows training programs to developers on an on-site basis.
For additional information and scheduling, contact:
Boeing Computer Services
Education and Training Division
National Training Center
375 Corporate Drive South
Tukwila, Washington 98188.
Call, toll free, (800) 342-7700, or in Washington state, call collect, (206) 575-7700.
pcjs.org
OCTOBER 1986
Programmable Graphics
Processor from Tl
m
Perks up PC Pixels
I
Joe Desposito
,·•:
/.NOR
(J "
DST-
tl
NOR
!il
DR
0
[l·iT
;(i
ONE
~
-DR
9J
NAND
-<"".
•
,.
s~
struction set. cessors. Thirty 32-bit registers ..-mu ADDS SUB SUBS MA/. tt!N
The chip, which will en- are divided into an A fi le and a
2 2 PiHel Processing Options
hance all graphics applications, B file . This large number
is of particular interest to devel- prevents the shifting of bits
opers using Microsoft Win- between registers that often
dows on the IBM PC and com- occurs with graphics pro-
THE TMS3401 0 IS A
patibles, where up until now cessing. It uses a barrel shi fter 32-BIT MICROPROCESSOR
performance has been less than for high-speed bit rotations and
spectacular. The TMS340 l 0 can rotate a field of up to 32- THAT EXECUTES 6
will be contained in an add-on bits in a single instruction MILLION INSTRUCTIONS
board that will handle all the cycle.
graphics processing, replacing The microprocessor uses a PER SECOND,
the monohrome color graphics four-segment instruction cache ADDRESSES UP TO 4
or enhanced graphics display for loading instructions from
adaptor. memory before they are exe- GIGABYTES OF
cuted. Each segment has eight MEMORY, AND
Inside the TMS3401 0 subsegments, each holding
Like most microprocessors, eight bytes of code. Thi s 256- INCLUDES SPECIAL
the TMS34010 has an ALU, byte instruction cache speeds PIXEL-PROCESSING
general registers, stack pointer, up the execution of graphics
program counter, instruction algorithms by capturing loops INSTRUCTIONS IN
decoder, and control unit. How- of instructions. Once a loop is ADDITION TO A
ever, it also contains compo- captured, "fetch" memory
nents that optimize the chip for cycles in the loop halt. Loop GENERAL-PURPOSE
graphics processing. execution is fast because the
INSTRUCTION SET.
It has a far greater number of ch ip can access instruction
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
.JOURNAL
pcjs.org
OCTOBER 1986
support products, including low- Microsoft's GDI (graphics de-
level assembly language tools, vice interface), many applica-
a C compiler with a run-time tions can be ported by using
support package, a function these standards.
library, and support of the CGI One way that developers can
(computer graphics interface) tap the potential of the chip is T HE DISTINGUISHING
standard. Hardware and software to port a graphics environment FEATURE OF THE
development systems are also like Microsoft Windows to it
available. at GDI levels. Thus any TMS34010 IS THAT THE
software application running PROCESSOR IS NOT
Building Applications through Windows could be ac-
Since the TMS340 lO is a celerated by a 32-bit graphics LIMITED TO A FEW
microprocessor, a software de- processor.
veloper has a great deal of However, many of the graph-
ALGORITHMS.
flexibility in determining what ics cards being developed are
runs on the graphics processor relatively "soft" cards, in that
and what runs on the host pro- they are RAM based. In effect,
cessor. Since the chip will also the command set for the board
support a number of graphics will be downloaded to it. As
standards such as CGI and Kevin McDonough of Texas In-
Graphics Instruction
ADDXY RS,RD Add Registers in XY Mode
CMPXY RS,RD Compare X and Y Halves of Registers
CPW RS,RD Compare Point to Window
CYXYL RS,RD Convert XY Address to Linear Address
DRAY RS,RD Draw and Advance
FILL L Fill Array with Processed Pixels: Linear
FILL XY Fill Array with Processed Pixels: XY
MOVX RS,RD Move X Half of Register
MOYY RS,RD Move Y Half of Register
PIXBLT B,L Pixel Block Transfer: Binary to Linear
PIXBLT B,XY Pixel Block Transfer: Binary to XY
PIXBLT L,L Pixel Block Transfer: Linear to Linear
.
r
PIXBLT
PIXBLT
L,XY
XY,L
Pixel Block Transfer: Linear to XY
Pixel Block Transfer: XY to Linear
PIXBLT XY,XY Pixel Block Transfer: XY to XY
PIXT RS,*RD Pixel Transfer: Register to Indirect
PIXT RS,*RD.XY Pixel Transfer: Register to Indirect XY
PIXT *RS,RD Pixel Transfer: Indirect to Register
PIXT *RS,*RD Pixel Transfer: Indirect to Register
PIXT *RS.XY,RD Pixel Transfer: Indirect XY to Register
PIXT *RS.XY, *RD.XT Pixel Transfer: Indirect XY to Indirect XY
SUBXY RS,RD Subtract Registers in XY Mode
LINE z Line Draw
Key to abbreviations: S (source register), D (destination register), R (register file select),
K (constant) , Z (draw option)
pcjs.org
OCTOBER 1986
:\11CROSOFT
SYSTEMS
.JOUR~AL
• Programmable 1-,2-,4-,8-, or
16-bit pixel size with 16 struments points out, "This performing data compression
Boolean and 6 arithmetic pixel will give the cards tremendous algorithms. "You know that
processing options flexibility and tremendous when you draw images, they
(Raster-Ops) performance advantages. For ex- have to be stored on disk . And
ample, a program such as Auto- since the images take up a lot of
• 31 general-purpose 32-bit CAD running under Microsoft disk space, it makes sense to
registers Windows will run much faster compress them. Data com-
in the Windows environment. pression mostly involves bit
• 256-byte LRU on-chip You can probably gain another manipulation , which the TMS-
instruction cache performance factor of I 0 by 340 I 0 excels at, so it turns out
doing specific algorithms and that this chip is better than any
• Direct interfacing to both downloading them to the general-purpose processor for
conventional DRAM and graphics processor for specific doing image compression ."
multipart video RAM applications." Texas Instruments and Micro-
According to McDonough , soft have entered a cooperative
• Dedicated 8/16-bit host graphics boards incorporating program to provide Microsoft
processor interface and the TM340 I 0 processor are cur- Windowssoftwaredrivertechnol-
HOLD/HLDA interface rently under development at Vi- ogy for systems designs using
deo 7, Number 9, and other ven- the TMS340 I 0.
• Programmable CRT control dors. With graphics boards that
(HSYNC,VSYNC,BLANK) The distinguishing feature of incorporate the TMS340 I 0 pro-
the TMS340 I 0 is that the pro- cessor now under development,
• High-level language support cessor is not limited to a few a new world of graphics will
algorithms. Rather, any algo- soon open up to personal com-
• Full line of hardware and rithm, be it line , ellipse, circle, puter users. •
software development tools or whatever, can be program-
including a C compiler med . And similarly, for text,
the chip can be programmed for
• 68-leaded packaging (PLCC) any f01mat.
Karl Guttag, also of Texas
• 5-volt CMOS technology Instruments , points out that the
chip is also excellent at
pcjs.org
OCTOBER 1986
Developers' Aid :
Dialog Editor
Charles Petzold
,,
' "
he Microsoft Windows dialog box file Edit Stoles Control ODtlORS
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
.JOURNAL
selecting New from the File with something else, and assign
menu. To start a new dialog an ID to each control. These IDs
template, select New Dialog are usually macro definitions
from the Edit menu and switch from the application's header
between dialog templates by (.H) file. Your source program
using the View Dialog option can then reference each control
THE STYLES MENU of the File menu. by these names.
ALLOWS YOU TO FURTHER To fill up the dialog box Although DIALOG can read a
with various controls, use the header file and let you use the
REFINE THE CONTROLS, Control menu, which lists 12 name (rather than the number),
REPLACE THE WORD TEXT basic types of controls (such as it asks for the header file only
Check Box , Radio Button, when reading an existing RES
WITH SOMETHING ELSE, Push Button). If the control file. So, before you get too far,
AND ASSIGN AN ID TO uses text, it will simply show you'll want to save a new fi le
the word TEXT. You can select using the Save As option from
EACH CONTROL. the control for editing simp ly the Files menu , create a header
by clicking on it. By hooking file with define statements for
Glob•l W1ndow S t y l e s - - - - - -- - - - - , the sides or corners you can the IDs , read the file back into
0 CI ose Box I Sys tlenu Box 2
Border stretch and size it, and by DIALOG with File Open, and
0Horz Scroll Style 0 Capt 1on hooking the center you can enter the name of the header file
[]Group B1t
8 UPrt Scr oll Style
D1alo9 fr•.,.. rJ lab Stop B1t
move it around. when DIALOG asks for it.
From the Styles menu you
W1ndow !ext: [ 9 [
A Matter of Style have a choice of Class Styles
L---------------~ The Control menu lets you and Standard Styles. The op-
Ok Cance I se lect from the basic types of tions here let you refine the way
controls. The Styles menu the control appears on the screen
al lows you to further refine and how it works.
them, replace the word TEXT For instance, you might
llol lllll=-:
pcjs.org
OCTOBER 1986
fi.
select Push Button from the stop also, but you can pick
Control menu, which will dis- another control as the tab stop [dit Control Styles-----------,
play text in a rounded rectangle if you'd like the c ursor to jump ~ Left Aliqned 0 ~ltiple Lines
and is often used for things like to the middle of a group. r,Centered 0 Auto Uert. Scroll
OK and CANCEL If you want ~Right Ahgned O Auto Horz . Scroll
a default setting for the push Make Sure It Works
· 0 Ho Hide Selection
button (which has a bold out- Of course, now you' ll have Vindow Text: 9
line) , you first select the push to recompi le to see if the thing ID Syllt10l: r.jll~l========~
button control for editing, works right. Well, not quite
bring down the Class Styles yet. You can now pick Test Ok Cancel
option of the Styles menu , and Mode from the Options menu
select Def Push Button. An- and test the tab stops and
other example: The d ialog box groups from within DIALOG. Group I Control Ordering
itself is initially shown with a Thi s test mode is one of the
simple frame. You can add a nicest features of the program.
caption bar and a system menu DIALOG is not perfect. You
box by selecting those options
from Standard Styles.
Controls in a Windows dia-
log box are generally organized
by "groups" and "tab stops."
should watch out for a few
things: If yo u want to delete a
specific control from the dialog
box , first se lect it and then
pick Clear Control from the
. Col -llise
Hatural
I S~
I SS
a 10
I Radio B
I Radio 8
I Radio B
) ------------- ----- -- ----------------- .
Controls marked as tab stops Ed it menu. The Cut Dialog
can be navigated using the tab option of the Edit menu deletes
key . Within a group, however, the who le dialog box and every-
you can use the arrow keys.
You can mark controls as
thing in it. You can get it back
by selecting Paste Dialog from
You cAN
groups and tab stops from the the Edit menu, but it's a little REORDER THE
Standard Styles option of the disconcerting to see the whole
Styles menu. However, if thing disappear.
CONTROLS AND
you've been designing you r Icons do not work right. SELECT GROUPS AND
dialog box in a free-form You should be able to identify
manner, you'll find that the tab an icon by typing the name in TAB STOPS THROUGH
stops will bounce around from the Text field of the C lass THE ORDER GROUP
item to item in the order that Styles box . However, DIA-
you've created them rather than LOG will ignore this name. OPTION OF THE
a visually logical order. You can either avoid using OPTIONS MENU.
Fortunate! y, you can both re- icons in dialog boxes or enter
order the controls and select in the name later using a text
groups and tab stops through ed itor.
the Order Groups option of the The worst problem does not
Options menu . This shows a lie wi th DIALOG. Preferably,
li st of all the contro ls you've you should be able to include
Chapter 7 (pages 14 7 to 174) of the
created. Selecting a control the .DLG fi le created by
Microsoft Windows So./fware Del'e!op-
with the mouse and placing the DIALOG in the application's
ment Kit Programming Guide (for a
horizontal black bar cursor in a Resource Script (.RC) fi le, as:
general discussion of controls and dialog
different location moves the
boxes).
control. To define a group, yo u #include " myprog . dlg " Section 6.2.6 (pages 292 to 307) of the
have to mark only the first and
Programmer's Reference (for the forma t
last control of the group. You However, the RC.EXE re-
of the DIALOG template).
wou ld usually flag the first source compi ler version 1.00
contro l of the group as a tab will not correctly process an
pcjs.org
OCTOBER 1986
MICROSOFT
SYSTEMS
.JOUR~AL
Microsoft Direct Information Access Line, DIAL, is an on-line data service offering Microsoft product users
electronic access to Microsoft's Customer Support Engineers. The program provides for the preparation,
transmission, and administration of Technical Assistance Requests used to report problems, request infor-
mation, make suggestions, and receive solutions and answers to inquiries.
In addition, DIAL provides direct acccess to Microsoft electronic mail (email) for communication with account
managers as well as access for bulletin boards that have information about known bugs, common questions and
answers, application notes by product, as well as other information.
DIAL also provides automatic code updates and the ability to transmit binary and ASCII files along with
Technical Assistance Requests.
Requirements: IBM PC or compatible with at least 128K of memory, asynchronous communications adapt-
er (RS232 card) or modem card, 1200- or 300-bps modem connected to a good-quality telephone line.
Additional information about DIAL can be obtained by calling: (206) 882-8080.
pcjs.org
OCTOBER 1986
Ask Dr. Bob!
message, the Windows appli-
Multitasking? cation dispatches it to the
Dear Dr. Boh, appropriate procedure in the pro-
I'm confused: Is Microsoft gram. This procedure can either
Windows a multitasking envir- act on the message or ignore it.
WHEN IT GETSA
onment or not? Sometimes it Microsoft Windows switches
seems like it is, and sometimes between applications when an MESSAGE, THE
it seems like it isn't. What's application polls for a message
the story, Dr. Bob ? -Confused by using the GetMessage call WINDOWS APPLICATION
or the similar WaitMessage
call. Once it has the message, DISPATCHES IT TO THE
Dear Confused, the application can take as long
Most people think of multi- as it wants, without interrup-
tasking as a process requiring tion. In the interim other appl-
APPROPRIATE
time-slicing. In a traditional ications (for instance, the
multitasking environment, the CLOCK) will stop working.
PROCEDURE IN THE
operating system switches be- Polite Windows applications
tween different tasks by allo- check frequently for messages
PROGRAM. THIS
cating short periods of time to while performing lengthy
each. Microsoft Windows does chores. This way they can yield
PROCEDURE CAN
not yet time-slice between ap- control to other applications
plications. Windows will proba- and give them an opportunity EITHER ACT ON THE
bly use time-slicing for multi- to run.
tasking only when MS-DOS However, if a Windows MESSAGE OR
also does so. application needs an unbroken
Instead, Windows has a non- chunk of time (say, for high- IGNORE IT.
preemptive multitasking sched- speed real-time data acquisi-
uler for running Windows appli- tion) , it can take it. The ap-
cations (programs written plication can interrogate the
specifically for Microsoft Win- mouse and the keyboard, write
dows) . A Windows application to the screen, and do everything
will not be interrupted if it does it needs to do-all without
not want to be interrupted; only interruption. It just has to
when it specifically relin- avoid looking for more
qui shes control do other appli- messages.
. cations get a chance to run . So Microsoft Windows is
A Windows application nor- multitasking , but it's up to the
mally sits in a loop waiting to individual Windows applica-
receive messages, usually exe- tions when to allow multitask-
cuting a GetMessage call. The ing with other applications and
messages it receives cover all when not to.
the events (keystrokes , mouse For "good old applications"
movements , window resizing, (MS-DOS applications that
and so forth) that affect the don't write directly to the dis-
application. When it gets a play and that can run in a
pcjs.org
OCTOBER 1986
I
MICROSOFT
SYSTEMS
JOURNAL
window), Windows yields con- segment references after moving included only graphics sup-
trol to other applications during data. port-would have to be more
keyboard input and screen complex.
output. But for old applications No Software
that do write directly to the
display , Microsoft Windows
Interrupt Executive
suspends all multitasking but Dear Dr. Boh, Dear Dr. Boh :
still allows the user (in most Is there some kind ()/' S()ftware Can I execute a Windows appli-
cases) to switch among appli- interrupt or other hook I can cation .fi"om within another
cations. use to access Microsoft Wind- Windows application?
ows procedures fi'om within a -Stumped
Compilers program I write in another Dear Stumped ,
language , such as BASIC or Sure. That's what the MS-DOS
Dear Dr. Boh. Turho Pascal ? Can I get at Executive does . The rec-
Why do I need to use Microsoft Windm1's graphics fi111ctions ommended method for executing
compilers for dneloping any other way? a program from a Windows ap-
Windows applications.? - Fmstrated plication is with an assembly
- Pu::::led language subroutine using the
Dear Frustrated, EXEC function call Ox4B .
Dear Puzzled , No. Windows functions are not Windows intercepts this MS-
Right now the only compilers accessed through a software DOS call and can correctly load
that support Microsoft Win- interrupt. The Windows loader the new format executable.
dows are the Microsoft C and resolves all function references The EXEC function call
Pascal compilers. You can also in the new format executable at returns to the calling program
program Windows applications load time. This means that right after the child process has
in assembler, but the most only programs in the new EXE been loaded . Under MS-DOS,
convenient way to do that format can access Microsoft the calling program doesn't get
would be to use assemb ler Windows functions. control back until the child
routines called from a C pro- It might be possible to write process has tenninated.
gram. Microsoft has made a shell program as a Windows You can even execute an old
public the relatively minor application that would provide application from a Windows ap-
support for Windows that a C a path for other programs that plication or vice versa. You can
compiler requires, and so other are not Windows applications to get a little sense of what hap-
compilers may also support call Windows procedures. But pens in this latter case by run-
Microsoft Windows. this task would be very diffi- ning COMMAND.COM from
A C compiler for Windows cult. Moveover, these programs Microsoft Windows. If you lie
requires procedures to be "Pas- would almost certainly have to in the PIF file and say that
cal" (arguments are pushed on be fixed in memory and could COMMAND.COM writesdirect-
the stack from left to right and not be moved . ly to the screen, you'll find that
that the procedure itself adjusts The WINOLDAP module executing a Windows appli-
the stack). Normally , C pushes allows some old applications to cation from the MS -DOS com-
arguments right to left and ad- run in a window, by providing mand level results in the "This
usts the stack after returning one type of shell that intercepts program requires Microsoft Win-
from the procedure . The C com- DOS and BIOS calls and trans- dows" message.
piler must also allow mixed- lates these calls into Windows If you run COMMAND-
model programming with the functions . This shell is one of .COM in a window and enter
"near" and "far" key words. Windows' more complex fea- the name of a Windows appli-
Procedures called from Micro- tures , since it must deal with cation , however. it wi II load cor-
soft Windows must have a many of the nasty things that rectly and take over the area of
small prolog and epilog so that old applications do. A more the screen occupied by
Windows can adjust data extensive shell--even one that COMMAND.COM. When you
pcjs.org
OCTOBER 1986
bring up COMMAND.COM These temporary files begin
again, you'll see the cursor with a tilde(-) and have the ex-
sitting at the MS-DOS prompt. tension TMP.
The Windows application has If you do Windows program
been loaded, and Windows has development, you should also
include the following statement
WINDOWS CAN TAKE
returned control back to
COMMAND.COM. in your AUTOEXEC.BAT:
SET TMP=D : \ ADVANTAGE OF A RAM-
This statement directs the
Expanded RAM Microsoft C Compiler to use DISK ON AN EXPANDED
Dear Dr. Boh. the RAM-Disk for its tem-
Can Microsoft Windows use Gil porary files. MEMORYBOARDBUTNOT
e.1panded memory hoard.7 To use drive D: as a swap-
- Fu::y
SwapDisk=? OF EXPANDED MEMORY
Dear Fuzzy,
with
Yes and no. Microsoft Win- ITSELF. HOWEVER ,
SwapDisk=D
dows can take advantage of a
RAM-Disk on an expanded ping disk for old applications,
memory board but not of ex- replace the line in your
WINDOWS SUPPORTS THE
panded memory itself. How- WIN.INI file that reads
ever, Windows supports the use Beyond using a RAM-Disk USE OF EXPANDED
of expanded memory by old ap- in expanded memory, neither
plications by preserving and Microsoft Windows nor Win- MEMORY BY OLD
restoring the state of the Ex- dows applications use expanded
panded Memory Manager. memory directly. (A future APPLICATIONS .
Let's look at these two version of Windows may have
topics separately. more support for expanded
The presence of any high- memory.)
speed disk storage will improve However, Microsoft Win-
Windows' performance. Win- dows can detect the presence of
dows uses the disk for storing an expanded memory board. If
temporary files from Windows it finds one, Windows can let
applications and for swapping old applications use expanded
old applications in and out of memory in the multitasking
memory . The disk used for environment without memory
these purposes can be any real contlicts. Windows will save
or virtual disk on your system , the contents of the expanded
including any type of RAM- memory board registers and
Disk. A RAM-Disk installed in restore them when switching
expanded memory is ideal. among applications.
If your RAM-Disk is in- Some early Expanded Mem-
.. stalled as drive D: (for in- ory Managers did not include
stance) , put the following state- full support of the "Get/Set
ment in your AUTOEXEC- Page Map" (function I 5) of the
.BAT: Expanded Memory Speci-
SET TEMP=D : \ fication Release 3.20. This call
This statement directs is the one Microsoft Windows
Microsoft Windows applica- uses to save the contents of the
tions to store temporary files expanded memory board reg-
(for instance , those created by isters. For this reason, Release
WRITE) on the RAM-Disk. 3.20 versions of the Expanded
OCTOBER 1986
pcjs.org
MICROSOFT
SYSTEMS
JOURNAL ~
Memory Manager are included subset of the IEEE standard, is If you need to write formatted
with Windows. These drivers faster and . smaller (but less text output to the screen, you
are called EMM.PC and accurate) than the 8087 -emula- can use sprintf and display the
EMM.AT; they work only tion code of the other floating resultant string with Windows
with the Intel Above Boards. point math libraries. The alter- TextOut procedure.
You can also use any Expanded nate math library does not use
Memory Manager, Release an 8087 even if one is present.
3.20 or later, supplied with an When the 8087 floating point
Intel Above Board. Before libraries are eventually modified Instances
using any other expanded for Windows, upgrading the pro- Dear Dr. Bah.
memory board, check with the gram should only require re- What happens when I run the
manufacturer to determine if the linking it with LINK4. same program simultaneously
Expanded Memory Manager In the interim, you could in Microsoft Windows? Are the
provides Release 3.20 support define your own floating point two versions entirely distinct or
of the "Get/Set Page Map" call. routines that use either the do they share code and data ?
regular C library routines or the --Unclear
assembly language subroutines
Math using the 8087, depending on Dear Unclear,
Coprocessor the presence of the math co- When an application is loaded
Dear Dr. Bah, processor. more than once, the loadings of
Can Windows applications use the application are referred to as
an 8087 or 80287 math different "instances." Generally,
coprocessor? Printf multiple instances of the same
-Pe1plexed Dear Dr. Bah, application share the same code
What happens in a Windows segment but have different data
Dear Perplexed, application if I try to write to segments. Windows applica-
Yes. Microsoft Windows pro- the Display in the conventional tions also share resources such
vides full support for saving way using the C function as menus, icons, cursors, and
the state of the math copro- printf? -Stymied bitmaps, since such resources
cessor and restoring it when are read-only data.
switching among applications. Dear Stymied, During initialization, an ap-
That's the good news. Nothing. Microsoft Windows plication can determine whether
However, Windows applica- intercepts all DOS and BIOS or not it is the first instance of
tions cannot yet use the 8087 output headed for the display that application. If it is not the
floating point libraries provided and dumps it into the bit first instance, it can retrieve
with the Microsoft C Compiler bucket, where it is never seen some data that must be shared
(version 3 or 4). This problem again. from the previous instance. •
lies with the libraries them-
selves rather than with Win-
dows support of the 8087.
If you want to use floating
point in a Windows application
written in C, you must cur- Dr. Bob wants to hear from you. Send him your questions
rently use the /FPa compiler and comments about Windows, DOS, C, Xenix, applications
switch and link with the development, romance, life after 40, life after death, love and
SLIBFA.LIB, MLIBFA.LIB, or money, life after marriage, war and peace, life on other
LLIBFA.LIB-depending on planets, the best restaurants, and life after applications devel-
your memory model-alternate opment. Address them to Dr. Bob, c/o H. Roark & Asso-
math library. The alternate ciates, 141 E. 44th St., Suite 804, New York, N.Y. 10017.
math library, which uses a
pcjs.org
OCTOBER 1986
Microsoft Corporation assumes no liability for any damages resulting from
. the use of the information contained herein .
pcjs.org
MICR~SOFt
pcjs.org
0000-00-201