The pages in this book function as shown to the right. Instructions in a green shadowed box tell you what to do next. The buttons at the bottom of the page help you navigate.
When the cursor turns to further explaination is available with a single click.
When the cursor turns to some action is avaible with a single click.s avaible with a single click.e action is avaible with a single click......
Click the right arrow to begin the next chapter.in the next chapter.ext chapter....
Illustrations and demonstrations
Explanation
Buttons to turn pages and return to the table of contents
Button
Table of Contents
Table of Contents
Instructions
Example: Window Controller
link
"Controller"
fillapps
enabled
FALSE
ActivateInstance
terpage
leavepage
enterpage
ActivateInstance
enterpage
Controller
o?ifillapps
Controller
enabled
leavepage
enabled
ActivateInstance
o?ifillapps
Controller
sectionNumber
startSection
Example: Window controller
Dynamic link librariesn
At right is an example of how the Windows system DLLs can be used to control the size and position of other application windows.
Click the Maximize button and see what happens. Click Restore to restore the window to its normal size. Click Minimize to iconize the window. Drag the handle on the outline box and see what happens.
Click the Maximize button and see what happens. Click Restore to restore the window to its normal size. Click Minimize to iconize the window. Drag the handle on the outline box and see what happens. Choose Exit from the File menu to exit the About Application Integration book........
controller
position
175,127
243,3806
Position::::::::
Size:ion::::::::
Window Title:
title
WinMem- 9/20SDK
MinimizeIt
buttonUp
buttonUp
MinimizeIt
Minimize
MaximizeIt
buttonUp
buttonUp
MaximizeIt
Maximize
RestoreIt
buttonUp
buttonUp
RestoreIt
Restore
Screen
Applications:
AppList
ChooseApp
oselectedtextlines
buttonUp
buttonUp
ChooseApp
WinMem
Program Manager
File Manager
Dr. Watson
Microsoft Mail - Monitor
window
windowbox
item 1 of my objects
resizebox
item 2 of my objects
Window
resize
to pa
Purpose of this book
sectionNumber
startSection
Purpose of this book
Introductionwing and speeded
This book describes the keys to application integration with ToolBook: OpenScript's Dynamic Data Exchange (DDE) and dynamic link library (DLL) support.
Examples of both are given... given.roughout.t.on.ntegration.ok gives examples of both aspects of application integration...of application integration.n integration..cts of application integration. fields more quickly. Since the response of a book
Click the right arrow.
Dynamic Data Exchange (DDE)
Dynamic link libraries (DLLs)
Click the right arrow to continue.t page.hapter.in the next chapter.ext chapter....
Title
E v a l u a t i o n E d i t i o n
E v a l u a t i o n E d i t i o n
Table of Contents
--This
Draw Objects
asure
'other
running
toolbook
M"ttdde.ebk"
"ok"
strRunToolBookButton()
--note how commands are concatonated together
takes slightly longer
working, but once
does,
finishes faster than issuing separate
,;" & \
;" & \
;" & \
60,50,100;" & \
315,190
840,715;" & \
510,325
525,355;" & \
630,325
645,355;" & \
~Arc
405, 505
405, 640
570, 640;" & \
780, 475;" & \
face;
drawDirect
FALSE;" & \
0,100,0;" & \
-15,490
8675,785;" & \
buttonup
buttonup
this book
ttdde.ebk
strRunToolBookButton
set syslevel to author;
set sysSuspend to false;
select all;send clear to system;set syslevel to reader;
set sysFillColor to 60,50,100;
draw ellipse from 315,190 to 840,715;
draw rectangle from 510,325 to 525,355;
draw rectangle from 630,325 to 645,355;
draw Arc from 405, 505 to 405, 640 to 570, 640;
set items 3 to 4 of vertices of selection to 780, 475;
select all;send group;set name of selection to face;set drawDirect of selection to FALSE;
set sysFillColor to 0,100,0;
draw field from -15,490 to 8675,785;
set name of selection to f;set drawDirect of selection to FALSE;
set layer of selection to 1
ttdde.ebk
toolbook
How to read this book
--This
Run ToolBook
4RunEntireDemo
--quit
runtime version
strNoRuntime()
other instances
toolbook
M"ttdde.ebk"
"OK"
DDE"
xTRUE
strAlreadyRunning()
x"85,10"
85,10
--force a
8, despite their startUpBook
DoesFileExist("TTDDE.EBK")
.exe
FALSE
DEFAULT
bar,
setRemote "
"85,345,561,425"
"100,345"
sysChangesDb"
--bring us
bringWindowToTop(
buttonup
buttonup
strNoRuntime
caption of this book
ttdde.ebk
ToolBook to ToolBook DDE
strAlreadyRunning
85,10
TTDDE.EBK
DoesFileExist
toolbook.exe ttdde.ebk
bounds of mainWindow
85,345,561,425
ttdde.ebk
hide scrollbar;hide menubar;hide statusBox
ttdde.ebk
position of toolpalette
100,345
ttdde.ebk
sysSuspend
false
ttdde.ebk
sysChangesDb
false
ttdde.ebk
bringWindowToTop
DEFAULT
toolbook
RunEntireDemo
--This
Bounce
asure
*other
running
face"
toolbook
M"ttdde.ebk"
"ok"
c"Denied"
strDrawObjectsButton()
strRunToolBookButton()
default
was made
recorder,
Fmodified
, these commands are concatenated
performance
;" & \
"Set
225, 1170-800, 750, 1530-800;" & \
225, 1335-800, 750, 1530-800;" & \
225, 1455-800, 750, 1530-800;" & \
225, 1065-800, 750, 1530-800;" & \
225, 825-800, 750, 1530-800;" & \
"Move
585, -15-800;" & \
585, -15-800, 1110, 285-800;" & \
585, -15-800, 1110, 570-800;" & \
645, 405-800;" & \
720, 945-800;" & \
720, 1155-800, 1245, 1530-800;" & \
720, 990-800, 1245, 1530-800;" & \
990, 405-800;" & \
990, 405-800, 1515, 900-800;" & \
1095, 45-800;" & \
1140, 645-800;" & \
1200, 1035-800;" & \
1350, 450-800;" & \
1470, 150-800;" & \
1500, 450-800;" & \
1545, 885-800;" & \
1560, 1035-800;" & \
1785, 405-800;" & \
1905, 210-800;" & \
1980, 465-800;" & \
2040, 870-800;" & \
2085, 1035-800;" & \
2280, 495-800;" & \
2355, 345-800;" & \
2385, 495-800;" & \
2430, 915-800;" & \
2445, 1035-800;" & \
2550, 630-800;" & \
2670, 405-800;" & \
2715, 570-800;" & \
2790, 990-800;" & \
2820, 1035-800;" & \
2955, 600-800;" & \
3045, 435-800;" & \
3120, 645-800;" & \
3165, 975-800;" & \
3180, 1035-800;" & \
3315, 675-800;" & \
3525, 465-800;" & \
3585, 645-800;" & \
3675, 960-800;" & \
3690, 1035-800;" & \
3990, 600-800;" & \
4155, 510-800;" & \
4350, 690-800;" & \
4485, 1005-800;" & \
4500, 1035-800;" & \
4815, 615-800;" & \
4935, 510-800;" & \
5100, 780-800;" & \
5160, 1035-800;" & \
5280, 750-800;" & \
5370, 570-800;" & \
5460, 840-800;" & \
5520, 1035-800;" & \
5640, 795-800;" & \
5655, 750-800;" & \
5700, 885-800;" & \
5745, 1035-800;" & \
5835, 825-800;" & \
5910, 750-800;" & \
6015, 900-800;" & \
6120, 1035-800;" & \
6345, 870-800;" & \
6510, 840-800;" & \
6675, 960-800;" & \
6750, 1035-800;" & \
6915, 900-800;" & \
7095, 975-800;" & \
7335, 945-800;" & \
7380, 945-800;" & \
7575, 990-800;" & \
7650, 1035-800;" & \
7845, 960-800;" & \
7950, 1005-800;" & \
8070, 1035-800;" & \
8100, 990-800;" & \
8025, 945-800;" & \
7935, 975-800;" & \
7875, 1035-800;" & \
7740, 975-800;"
buttonup
buttonup
group face
ttdde.ebk
Denied
strDrawObjectsButton
strRunToolBookButton
set sysSuspend to false;
Set bounds of group face to 225, 1170-800, 750, 1530-800;
Set bounds of group face to 225, 1335-800, 750, 1530-800;
Set bounds of group face to 225, 1455-800, 750, 1530-800;
Set bounds of group face to 225, 1065-800, 750, 1530-800;
Set bounds of group face to 225, 825-800, 750, 1530-800;
Move group face to 585, -15-800;
Set bounds of group face to 585, -15-800, 1110, 285-800;
Set bounds of group face to 585, -15-800, 1110, 570-800;
Move group face to 645, 405-800;
Move group face to 720, 945-800;
Set bounds of group face to 720, 1155-800, 1245, 1530-800;
Set bounds of group face to 720, 990-800, 1245, 1530-800;
Move group face to 990, 405-800;
Set bounds of group face to 990, 405-800, 1515, 900-800;
Move group face to 1095, 45-800;
Move group face to 1140, 645-800;
Move group face to 1200, 1035-800;
Move group face to 1350, 450-800;
Move group face to 1470, 150-800;
Move group face to 1500, 450-800;
Move group face to 1545, 885-800;
Move group face to 1560, 1035-800;
Move group face to 1785, 405-800;
Move group face to 1905, 210-800;
Move group face to 1980, 465-800;
Move group face to 2040, 870-800;
Move group face to 2085, 1035-800;
Move group face to 2280, 495-800;
Move group face to 2355, 345-800;
Move group face to 2385, 495-800;
Move group face to 2430, 915-800;
Move group face to 2445, 1035-800;
Move group face to 2550, 630-800;
Move group face to 2670, 405-800;
Move group face to 2715, 570-800;
Move group face to 2790, 990-800;
Move group face to 2820, 1035-800;
Move group face to 2955, 600-800;
Move group face to 3045, 435-800;
Move group face to 3120, 645-800;
Move group face to 3165, 975-800;
Move group face to 3180, 1035-800;
Move group face to 3315, 675-800;
Move group face to 3525, 465-800;
Move group face to 3585, 645-800;
Move group face to 3675, 960-800;
Move group face to 3690, 1035-800;
Move group face to 3990, 600-800;
Move group face to 4155, 510-800;
Move group face to 4350, 690-800;
Move group face to 4485, 1005-800;
Move group face to 4500, 1035-800;
Move group face to 4815, 615-800;
Move group face to 4935, 510-800;
Move group face to 5100, 780-800;
Move group face to 5160, 1035-800;
Move group face to 5280, 750-800;
Move group face to 5370, 570-800;
Move group face to 5460, 840-800;
Move group face to 5520, 1035-800;
Move group face to 5640, 795-800;
Move group face to 5655, 750-800;
Move group face to 5700, 885-800;
Move group face to 5745, 1035-800;
Move group face to 5835, 825-800;
Move group face to 5910, 750-800;
Move group face to 6015, 900-800;
Move group face to 6120, 1035-800;
Move group face to 6345, 870-800;
Move group face to 6510, 840-800;
Move group face to 6675, 960-800;
Move group face to 6750, 1035-800;
Move group face to 6915, 900-800;
Move group face to 7095, 975-800;
Move group face to 7335, 945-800;
Move group face to 7380, 945-800;
Move group face to 7575, 990-800;
Move group face to 7650, 1035-800;
Move group face to 7845, 960-800;
Move group face to 7950, 1005-800;
Move group face to 8070, 1035-800;
Move group face to 8100, 990-800;
Move group face to 8025, 945-800;
Move group face to 7935, 975-800;
Move group face to 7875, 1035-800;
Move group face to 7740, 975-800;
ttdde.ebk
default
toolbook
Example: ToolBook
to ToolBook
4RunEntireDemo,s_NoUserDLL,hProgMan
FALSE
linkDLL "user"
WORD SetActiveWindow(
FindWindow(DWORD,STRING)
INT
ShowWindow(
BringWindowToTop(
c"Cannot load
default
strNoDLL("
endDemo
""ToolBook
DDE"";
toolbook
unlinkDLL "
terpage
endDemo
enterpage
leavePage
enterpage
SetActiveWindow
FindWindow
ShowWindow
BringWindowToTop
Cannot load DLL
strNoDLL
default
RunEntireDemo
s_NoUserDLL
hProgMan
endDemo
if caption of this book is "ToolBook to ToolBook DDE";send exit to system;end
toolbook
RunEntireDemo
leavePage
+endDemo
s_NoUserDLL
h v"*&
sectionNumber
startSection
Example: ToolBookok to ToolBookk
Dynamic Data Exchange
With DDE, one instance of ToolBook can run and control another instance. Using "multiple instances" you can coordinate ToolBook applications and develop more sophisticated multi-window applications....s.ations..........ped. buttons in order to see DDE at work. Or click the Run Entire Demo button.ce. Its script was made from a script recording..... how to animate objects in another instance. Its script was made from a script recording.....stance.
The Bounce button's script shows how to animate objects in another instance. Its script was made from a script recording...bjects in another instance.
The Bounce button's script shows how to animate objects in another instance. Its script was made from a script recording.cript shows how to draw and modify objects in another instance.
The Bounce button's script shows how to animate objects in another instance. Its script was made from a script recording.
Click the buttons to see DDE at work. Or click the Run Entire Demo button. Click the captions to the right of the numbers for more information. Click the right arrow below to continue to the next page.
Explain 4
buttonUp
buttonUp
This button's script shows how to animate objects in another instance. Its script was made from a script recording.
(Click me to dismiss.)miss.))
B"Bounce"
buttonUp
buttonUp
Bounce
Explain 1
buttonUp
buttonUp
This button's script shows how to run other instances of ToolBook. It starts a new untitled book instead of the startup book and gets the window handle of the new instance.
(Click me to dismiss.)
B"Run ToolBook"
buttonUp
buttonUp
Run ToolBook
Explain 2
buttonUp
buttonUp
This button's script shows how to position windows and bring a window to the top. It uses the Microsoft Windows function bringWindowToTop().
(Click me to dismiss.)
eshuffle"
buttonup
buttonup
window shuffle
Explain 3
buttonUp
buttonUp
This button's script shows how to draw and modify objects in another instance.
(Click me to dismiss.)to dismiss.))
B"Draw Objects"
buttonUp
buttonUp
Draw Objects
Run Toolbook
Window Shuffle
--This
Window Shuffle
ZotherWindowHandle
asure
running
toolbook
M"ttdde.ebk"
"ok"
strRunToolBookButton()
place
x"85,10"
85,10
setRemote "
"116,300,516,465"
"220,300,413,465"
H0,-50"
"220,-166,413,-1"
--bring
bringWindowToTop(
H0,100"
"85,345,561,425"
buttonup
buttonup
sysWindowHandle
ttdde.ebk
strRunToolBookButton
85,10
bounds of mainWindow
116,300,516,465
ttdde.ebk
bounds of mainWindow
220,300,413,465
ttdde.ebk
move mainWindow by 0,-50
ttdde.ebk
bounds of mainWindow
220,-166,413,-1
ttdde.ebk
bringWindowToTop
move mainWindow by 0,100
ttdde.ebk
bounds of mainWindow
85,345,561,425
ttdde.ebk
toolbook
otherWindowHandle
Draw Objects
Bounce
4RunEntireDemo
buttonList
) ToolBook", "Window Shuffle",\
"Draw Objects", "Bounce"
endDemo
buttonup
buttonup
Run ToolBook
Window Shuffle
Draw Objects
Bounce
buttonUp
+endDemo
buttonList
RunEntireDemo
Run Entire Demo
Bounce
huffle
Palettes dance
Draw objects
Bounce
Bounce
tttttt
"Explain 4"
buttonUp
buttonUp
Explain 4
Explain 4
Explain 1
Explain 2
Explain 3
Run ToolBook
Window shuffle
Palettes dance
Draw objects
Bounce
tttttt
Run ToolBook
"Explain 1"
buttonUp
buttonUp
Explain 1
Explain 1
Explain 2
Explain 3
Explain 4
Draw objects
Bounce
es dance
Draw objects
Bounce
Bounce
tttttt
"Explain 3"
buttonUp
buttonUp
Explain 3
Explain 3
Explain 1
Explain 2
Explain 4
Default
"Explain 5"
ouseEnter
mouseLeave
mouseEnter
buttonUp
mouseEnter
mouseLeave
Default
buttonUp
Explain 5
Explain 5
Explain 1
Explain 2
Explain 3
Explain 4
Shuffle windowssssssss
Run ToolBook
"Explain 2"
buttonUp
buttonUp
Explain 2
Explain 2
Explain 1
Explain 3
Explain 4
-- When a chapter
clicked update the section list.
4s_DidDoubleClick
updateSectionList
oselectedTextLines
strip(
-- If
user presses a key that
reflect
-- Algorithm:
-- Get
currently
. Forward
keystroke
ToolBook
default processing. Check
-- changed. If so,
message
sections.
causes
respond
-- Update
4s_currentSection
-- Set
"Chapter
3Name"
"Sections"
commandLine
sectionList
" && "
-- Clear
buttonDoubleClick
buttonUp
keyDown
updateSectionList
buttonUp
updateSectionList
s_DidDoubleClick
buttonDoubleClick
strip
s_DidDoubleClick
keyDown
updateSectionList
updateSectionList
Chapter Name
strip
set sectionList to
Sections
of this page
Sections
Sections
sectionList
commandLine
s_currentSection
Welcome
uy ToolBook
Application Integration
Application Integration
4s_NoDlgDLL,s_NoUserDLL
FALSE
linkDLL "tbkdlg.dll"
dialog(
setValue(
getValue(
c"Cannot load
default
strNoDLL("
user"
WORD SetActiveWindow(
FindWindow(STRING,DWORD)
INT
ShowWindow(
BringWindowToTop(
FindProgMan
unlinkDLL "
ShowProgman
4hProgMan
"Yield"
ShowToolBook
setactivewindow(syswindowHandle)
[,s_NoProgMan,
DoesFileExist("PROGMAN.EXE",strNoProgMan())
showWindow(
activateInstance
enterpage
ShowProgman
ShowToolBook
leavepage
FindProgMan
activateInstance
enterpage
tbkdlg.dll
dialog
setValue
getValue
Cannot load DLL
tbkdlg.dll
strNoDLL
SetActiveWindow
FindWindow
ShowWindow
BringWindowToTop
Cannot load DLL
strNoDLL
FindProgMan
default
s_NoDlgDLL
s_NoUserDLL
leavepage
tbkdlg.dll
s_NoDlgDLL
s_NoUserDLL
ShowProgman
BringWindowToTop
Yield
hProgMan
ShowToolBook
setactivewindow
FindProgMan
ProgMan
FindWindow
PROGMAN.EXE
strNoProgMan
DoesFileExist
PROGMAN.EXE
setactivewindow
showWindow
showWindow
setactivewindow
hProgMan
s_NoProgMan
s_NoUserDLL
activateInstance
FindProgMan
Dynamic Data Exchange
Example: ToolBook
Example: Program Manager
Example: Program Manager
What is a DLL?
utines
sectionNumber
startSection
What is a DLL?
Dynamic link librariesn
A dynamic link library (DLL) is a set of routines or functions written in a programming language (often C or Pascal).
ToolBook is fully extensible, providing a completely open architecture for linking to any DLL. You gain full connectivity and access to an ever-growing set of libraries..f libraries......... open architecture for linking to any DLL. You gain full connectivity and access to an ever-growing set of libraries.g set of libraries.es.raries.es.
int FAR PASCAL LibMain (hModule, wDataSeg, wHeapSize, lpCmdLine)
HANDLE hModule ;
WORD wDataSeg, wHeapSize ;
LPSTR lpCmdLine ;
return(TRUE) ;
int FAR PASCAL WEP(int bSystemExit)
return(TRUE) ;
return(TRUE) ;
bout );
FreeProcInstance(lpfnSaveAsDlgProc);
FreeProcInstance(lpProModifyList );
DeleteObject(hBM_Logo);
DeleteObject(hBM_ColorLogo);
return(TRUE) ;
ce(lpProModifyList );
DeleteObject(hBM_Logo);
DeleteObject(hBM_ColorLogo);
return(TRUE) ;
SCAL WEP(int bSystemExit)
FreeProcInstance(lpProcAbout );
FreeProcInstance(lpfnSaveAsDlgProc);
FreeProcInstance(lpProModifyList );
DeleteObject(hBM_Logo);
DeleteObject(hBM_ColorLogo);
return(TRUE) ;
:PHYSSIZE
Dynamic
link library=
Click the right arrow to continue.t page.hapter.in the next chapter.ext chapter....
Example: Program Manager
sectionNumber
startSection
Example: Program Manager
Dynamic Data Exchange
The Windows Program Manager is an example of an appplication that supports DDE.
Click the buttons to the right to use DDE to add an item to a Program Manager group, or create, show, or delete a group.+
Click the buttons to the right to use DDE to add an item to a Program Manager group, or create, show, or delete a group.
Click the captions to the right of the numbers for more information.
Click the right arrow to continue.
Explain 4
buttonUp
buttonUp
This button's script shows how to send an executeRemote command to display a Program Manager group in a variety of ways.
(Click me to dismiss.) (Click me to dismiss.)ismiss.)
B"Show Group"
buttonUp
buttonUp
Show Group
Explain 3
buttonUp
buttonUp
This button's script shows how to send an executeRemote command to delete a Program Manager group.
(Click me to dismiss.) (Click me to dismiss.))to dismiss.)ick me to dismiss.)
B"Delete Group"
buttonUp
buttonUp
Delete Group
Explain 2
buttonUp
buttonUp
This button's script shows how to send an executeRemote command to create a new Program Manager group.
(Click me to dismiss.) (Click me to dismiss.)to dismiss.)smiss.))))
B"Create Group"
buttonUp
buttonUp
Create Group
Explain 1
buttonUp
buttonUp
This button's script shows how to link TBKDLG.DLL, call the dialog function, and send an executeRemote command to add an item to a Program Manager group.
Even minor changes at Author level could cause this
book to work incorrectly. Go to Author level anyway?
Cancel
s_Author
Table of contents
strip
moveImage
div_1
endPosY
endPosX
division
endPos
startPos
image
showObjects
group
objList
yOffset
xOffset
startTime
GetCurrentTime
s_testTime
showElapsedTime
GetCurrentTime
This test took
seconds.
faster
slower
It was
than the previous test.
relation
deltaTime
prompt
thisTestTime
s_testTime
s_lastTestTime
strNODLL
Cannot find DLL
rtStr
dllName
strRunToolBookButton
Please press the 'Run ToolBook' button first.
strDrawObjectsButton
Please press the 'Draw objects' button first.
strMustHaveCmdLine
You must enter a 'Command Line' to add an item.
strMustHaveGroupInfo
You must enter either a 'Group Name' or a 'Group File' to create a group.
strMustHaveGroupName
You must enter a 'Group Name' to execute this command.
strAlreadyRunning
An application of ToolBook is already running.
strOtherInstance
Please close all other instances of ToolBook before pressing this button.
setupMenu
&Help
&How To Read This Book
RemoveMenuItemsByPosition
RemoveMenuItemsByPosition
8,7,6,5,4,3,2,1,0
RemoveMenuItemsByPosition
7,6,5,4,3,2,1,0
RemoveMenuItemsByPosition
unlink
saveSLS
showhotwords
Show Hotwords
checked
show hotwords
show hotwords
GetSystemMenu
GetMenu
GetSubMenu
EnableMenuItem
RemoveMenu
unlink
RemoveMenuItemsByPosition
GetSystemMenu
GetMenu
GetSubMenu
menuitemPosList
EnableMenuItem
RemoveMenu
RemRet
EnaRet
MenuItemPos
hMainMenu
hMenu
MenuItemPosList
MenuPos
HowToReadThisBook
How To Read This Book
DoesFileExist
TBKFile.dll
FileExists
TBKFILE.DLL
strNODLL
FileExists
strCantFind
TBKFile.dll
TBKFile.dll
strSpecialMessage
fileName
strCantFind
Cannot find the file:
Please check that it is in the current directory.
strFileName
strNoProgMan
Cannot find "PROGMAN.EXE". This demonstration
is not available without the Program Manager
application. Please continue to the next page.
getData
dataPath
"PathToData"
currentSpot
?)/2)
1" + 1)
ktextlineCount(
FALSE
ChartData
"PathToChart"
currentValue
1" + 1
value
DocumentData
"PathToDocs"
spinTape
"MainFrame"
flashLights
artData
getData
DocumentData
ChartData
getData
PathToData
Data 1
Data 1
Data 1
Data 2
Data 1
Data 3
Data 1
currentSpot:to
currentSpot
dataPath
ChartData
PathToChart
Chart
Data 1
Chart 1
value
Data 1
Chart 2
value
Data 2
Chart 3
value
Data 3
currentValue
currentSpot:to
currentSpot
dataPath
DocumentData
PathToDocs
Data 1
Doc 1
Doc 2
Doc 3
currentValue
currentSpot:to
currentSpot
dataPath
o(qspinTape
MainFrame
flashLights
MainFrame
Table of Contents
Sections3
What is a DLL?
Windows DLL routines
Example: Window controller
Sections2
What is DDE?
DDE & application integration
Example: ToolBook
Example: Program Manager
Sections1
Purpose of this book
How to read this book
Purpose of this book
How to read this bookple: Window controller Example: Program Manageragerollererase
ToolBook as a database front end
Application Integrationructed record fields
* Obstructed fields and scrolling
* The drawTextDirect property
* Metafiles
* User interface conventions
* General page tips
Introduction librariesn
Application Integration of Contentss
Introduction
Dynamic Data Exchange
Dynamic link librariessssne ToolBook Differenceiggie at home
Designing for speed
Design examplesspeed
background and direct draw
Design examples
-- Hide
help information
clicked.
default
buttonDoubleClick
buttonDoubleClick
default
Instructions:
Click a chapter name on the left to see the chapter's sections on the right.
Double-click a chapter name to go to the beginning of the chapter.
Double-click a section name on the right to go directly to the section.
Completed sections and chapters will be marked with an asterisk.e-click this text to make it disappear.ear....ear.ar.ppear.....in the Workbook window to return to the Workbook.
Click this text to make it disappear.r..e it disappear..
Table of Contents
Application Integration Book
1991 Asymetrix Corporation
All rights reserved.
Asymetrix Application Integration Book team:
Laurel McComber Harriet Landrum
Tom Arnold Nanette Wright
Carol Buchmiller Brad Gaub
Jeff Day
Special thanks to:
Bob Galluppp
Table of Contents
-- Go
the Table
Contents
buttonUp
buttonUp
What is DDE?
Exchange
4systemSpot,ShowExample
xTRUE
"Data"
a + 1)
m"Path")/2)
currentSpot
"Receive 2"
"Send 1"
"2" + 1)
+ 1)
0.15
Receive 2
Send 1
Send 2
Send 2
Send 2
Send 2
Receive 1
Send 2
Send 1
Send 1
Send 1
Send 1
333333
currentSpot
systemSpot
ShowExample
sectionNumber
startSection
What is DDE?
Dynamic Data Exchange
Windows Dynamic Data Exchange (DDE) is a communication protocol that defines how two Windows applications interoperate.
DDE provides Windows applications--including ToolBook--with a mechanism to get data from and give data to other applications and to execute commands...lications to execute commands.her applications to execute commands.
The power of DDE is that it can be used as a means to integrate Windows applications. Windows applications can use features in other Windows applications by communicating with those applications. DDE is used to communicate between two or more instances of ToolBook, providing a method to link several ToolBook instances together into a single integrated application.
Click the right arrow.
:PHYSSIZE
:PHYSSIZE
Receive:
Receive 2
Apples
Oranges
Pears
Grapes
Peaches
Send:ve:
Send 2
Horses
Birds
Receive:
Receive 1
Horses
Birds
Send:ve:
Send 1
Apples
Oranges
Pears
Grapes
Peaches
ToolBook Application
Windows Application
Click Show DDE Example to see example.
Or click the right arrow to continueeeeeee.
4ShowExample
DDE
"Stop
FALSE
buttonUp
buttonUp
Show DDE Example
Stop DDE Example
Show DDE Example
ShowExample
Show DDE Example
Chapter Head
-- If
moved,
a user-defined property, home,
-- the
graphic covering
"Arrow"
-- When
Fmouse
pressed,
B"pushButton"
released,
w. Finally,
-- Move
-- depending on
parameter, x, which can be
H15,15
buttonDown
moved
buttonUp
press
moved
Arrow
buttonDown
pushButton
press
buttonUp
press
press
Arrow
pushButton
2291,4043
pushButton
Arrow
Title
Table of Contents
-- Go
the Table
Contents
buttonUp
buttonUp
Table of Contents
Click the right arrow to continue.rrrrrrrrr
previous
-- If
moved,
a user-defined property, home,
-- the
graphic covering
"Arrow"
-- When
Fmouse
pressed,
B"pushButton"
released,
w. Finally,
Previous
-- Move
-- depending on
parameter, x, which can be
H15,15
buttonDown
moved
buttonUp
press
moved
Arrow
buttonDown
pushButton
press
buttonUp
press
Previous
press
Arrow
pushButton
1917,4043
pushButton
Arrow
Topic
4s_Chapters
sectionNumber
3 Name"
strip(
enterPage
enterPage
sectionNumber
Chapter Name
strip
s_Chapters
Chapter Name
Title
getLine loc
getLine
getLine
textFromPoint
-- If
moved,
a user-defined property, home,
-- the
graphic covering
"Arrow"
-- When
Fmouse
pressed,
oenabled
B"pushButton"
released,
w. Finally,
-- Move
-- depending on
parameter, x, which can be
H15,15
logVal
excludeTab
0,50,0
buttonDown
moved
buttonUp
enabled
press
enabled
moved
Arrow
buttonDown
enabled
pushButton
press
buttonUp
enabled
press
press
Arrow
pushButton
enabled
pushButton
pushButton
Arrow
0,0,0
Arrow
logVal
enabled
pushButton
home
2291,4043
pushButton
Arrow
Table of Contents
-- Go
the Table
Contents
buttonUp
buttonUp
Table of Contents
previous
-- If
moved,
a user-defined property, home,
-- the
graphic covering
"Arrow"
-- When
Fmouse
pressed,
B"pushButton"
released,
w. Finally,
Previous
-- Move
-- depending on
parameter, x, which can be
H15,15
buttonDown
moved
buttonUp
press
moved
Arrow
buttonDown
pushButton
press
buttonUp
press
Previous
press
Arrow
pushButton
1917,4043
pushButton
Arrow
Dynamic Data Exchange
startSection
sectionNumber
Title
Dynamic Data Exchange
Topic
arning ToolBook
enScript Exercises
s Rmn
3^D|D|
-- a
renumbering a
n > 0
enterBook
renumber
enterBook
sizeToPage
renumber
:REPORTDATA
:CONDITIONDATA
Text of RecordField "Instructions" is "null" As Text
Text of RecordField "Instructions" is null
defaultSize
9315,5745
plication Integration
System
y`D|D|
`D|D|
gD|D|E
gD|D|
]D|D|
`D|D|
fD|D|E
fD|D|E
fD|D|E
`D|D|
rminal
`D|D|
`D|D|
`D|D|
fault
9_D|D|
pageNumber is 103 or pageNumber is 104
pageNumber is 103 or pageNumber is 104
pageNumber is 103 or pageNumber is 104
pageobjs
]D|D|
:PRINTLAYOUT
`D|D|
u`D|D|
`D|D|
aB|B|
Title
q\D|D|
\D|D|
gD|D|E
gD|D|
gD|D|
About Application Integration
fD|D|%
fD|D|%
QuikTour.v
~pUnable to return to the Quick Tour.
launchedFrom
s_launchedFrom
DDE & Application Integration
sectionNumber
startSection
DDE and application integration
Dynamic Data Exchange
With DDE and ToolBook, you can fully integrate Windows applications that also support DDE.
ToolBook can be used to execute commands in other Windows applications, including menu commands and macros that allow for the passage of data between applications..
Click the right arrow.
:PHYSSIZE
data 1
data 2
data 3
Data Retrievalonn
GetData
buttonUp
buttonUp
*GetData
Get Data
ChartData
buttonUp
buttonUp
ChartData
Chart
DocumentData
buttonUp
buttonUp
DocumentData
Document
MainFrame
spinTape
"Tapes"
flashLights
spinTape
flashLights
spinTape
Tapes
Tapes
Tapes
Tapes
Tapes
Tapes
flashLights
Lights
Lights
Lights
Lights
Lights
Lights
Lights
Lights
tapes
lights
PathToData
PathToDocs
PathToChart
Click these buttons to see example of DDE in use.
Click the right arrow to continue.
Click the right arrow to continue.t page.hapter.in the next chapter.ext chapter....
chart
:PHYSSIZE
chart
Chart
chart 1
value
-- Original
=2715,2460,5430,2565
=+ 2715/600*
value
value
chart 2
value
-- Original
=2715,2460,5430,2565
=+ 2715/600*
value
value
chart 3
value
-- Original
=2715,2460,5430,2565
=+ 2715/600*
value
value
Chartingplication
:PHYSSIZE
Sales for November were the following:
East Central Westtt
Documentation Application
doc 1
doc 2
doc 3
Dynamic Link Libraries
DLLs & Application Integration
DDE & Application Integration
theBounds
syslockScreen
x1,y1,x2,y2
x2-100,y2-100,x2,y2
FALSE
{location
"resize"
ostate
resizebox
windowbox
(x -
odx),(y -
(x -
odx),(y -
(x -
odx),(y -
SizeWinFromTBGroup
(x -
odx),(y -
MoveWinFromTBGroup
uttonDown
buttonStillDown
buttonDown
buttonUp
theBounds
theBounds
buttonDown
resize
state
resize
window
state
location
buttonStillDown
state
resize
state
windowbox
resizebox
location
buttonUp
state
resize
2YSizeWinFromTBGroup
state
BUMoveWinFromTBGroup
state
windowbox
resizebox
location
-- Table
Contents -
-- The
may be entered
8. That
's section
saved
-- s_currentSection
handler.
used
displayed.
-- There
also a
-- marks a completed
chapter
Hplacing
-- asterisk beside its
-- When entering
(entry
-- corresponding
recorded
4s_didDoubleClick
-- Clear
}click flag
-- Switch
Reader level
-- Highlight
selectedTextLines
J"Chapters"
J"Sections"
-- Place
front
identified
x. If
sections
, place
markSection x
chapterNum
sectionNum
-- Get
list
--
propertyName
commandLine
" &&
5&& "
--
fore
" &&
-- If
chapterDone
chapters
x"*"
-- Remove All asterisks
ClearAllSections
ChapterNum
" &&
SectionList
SectionNum
" &&
terPage
markSection
enterPage
ClearAllSections
enterPage
reader
Chapters
buttonUp
Chapters
Sections
Sections
currentSection
s_didDoubleClick
s_currentSection
markSection
Sections
of page "Table of Contents"
of page "Table of Contents" to it
Chapters
Table of Contents
chapters
chapterDone
commandLine
propertyName
sectionNum
chapterNum
ClearAllSections
Chapters
Table of Contents
Chapters
Table of Contents
Chapters
Table of Contents
Sections
of page "Table of Contents"
sectionNum
of page "Table of Contents" to SectionList
SectionNum:to1
SectionNum
SectionList
commandLine
propertyName
ChapterNum:to
ChapterNum
Chapter Head
Introduction
Introduction
startSection
sectionNumber
linkDLL "user"
INT
GetWindowText(WORD,STRING,
ShowWindow(
GetWindowRect(
DPOINTER)
MoveWindow(
SetWindowPos(
IsIconic(
IsZoomed(
IsWindowVisible(
SetActiveWindow(
GetSystemMetrics(
kernel"
GlobalAlloc(
DWORD)
GlobalLock(
GlobalUnlock(
GlobalFree(
IsValidAppWindow hWnd
-- This will
modify
behavior simply change
^returnSelf
FALSE
GW_OWNER
Owner
AND \
(WindowTitle(
NextWindow
GW_HWNDFIRST
GW_HWNDNEXT
"First"
"No More Windows"
returnString
returnVal
T,45)
SetWindowPosition
WinSize
WindowSize(
,x,y,xS,yS,1)
SetWindowSize
WinPosition
,xP,yP,x,y,1)
returnValue
hRect
0,10)
lpRect
pointerINT(0,
GlobalUnLock(
x&","&y
0,10)
(x2-x1)&","&(y2-y1)
ShowInfo
4CurrentApp
"title"
currentApp)
Direction
direction
y - 10
"Down"
y + 10
"Left"
x - 10
"Right"
x + 10
,x,y)
Resize
y - 10
y + 10
x - 10
x + 10
,x,y)
DrawWindowImage
WndPos
TBFromWin(
WndSize
"Screen")
k+ x1
WndIsIconic
WndIsZoomed
x0 )
theBounds
x1&","&y1&","&x2&","&y2
ScreenDX
SM_CXSCREEN
ScreenDY
SM_CYSCREEN
coordinates
Winx
Winy
WinDx
WinDy
RatioX
RatioY
&","&
WinFromTB
&","&
MinimizeIt
showInfo
MaximizeIt
syswindowHandle)
RestoreIt
WindowMoved
fillScreenBox
WindowSized
fillApps
4windowHandles,
currentWindow
"AppList"
"No Applications"
firstApp
x"No
CRLF&
selectedtextlines
ChooseApp AppNumber
,WindowHandles
SizeWinFromTBGroup
^" -
WinCoor
n(TBx&","&TBy)
MoveWinFromTBGroup
nimizeIt
MaximizeIt
Resize
RestoreIt
ShowInfo
WindowMoved
WindowSized
DrawWindowImage
fillApps
ChooseApp
SizeWinFromTBGroup
MinimizeIt
MoveWinFromTBGroup
alidAppWindow
SetWindowPosition
SetWindowSize
WindowPosition
NextWindow
WindowSize
ScreenDX
WindowTitle
ScreenDY
TBFromWin
IsValidAppWindow
WinFromTB
GetWindowText
GetWindow
ShowWindow
GetWindowRect
MoveWindow
SetWindowPos
IsIconic
IsZoomed
IsWindowVisible
SetActiveWindow
GetSystemMetrics
kernel
GlobalAlloc
GlobalLock
GlobalUnlock
GlobalFree
IsValidAppWindow
GetWindow
WindowTitle
IsWindowVisible
Owner
GW_OWNER
returnSelf
NextWindow
First
GetWindow
IsValidAppWindow
GetWindow
No More Windows
IsValidAppWindow
GetWindow
No More Windows
IsValidAppWindow
GW_HWNDNEXT
GW_HWNDFIRST
WindowTitle
No More Windows
GetWindowText
returnVal
returnString
SetWindowPosition
WindowSize
MoveWindow
WinSize
SetWindowSize
WindowPosition
MoveWindow
WinPosition
WindowPosition
GlobalAlloc
GlobalLock
GetWindowRect
GlobalUnLock
GlobalFree
lpRect
hRect
returnValue
WindowSize
GlobalAlloc
GlobalLock
GetWindowRect
GlobalUnLock
GlobalFree
lpRect
hRect
returnValue
ShowInfo
title
currentApp
WindowTitle
position
currentApp
WindowPosition
currentApp
WindowSize
CurrentApp
Position
Position
direction
direction
direction
direction
Right
SetWindowPosition
uxShowInfo
CurrentApp
Direction
Resize
direction
direction
direction
direction
Right
SetWindowSize
uxShowInfo
CurrentApp
Direction
DrawWindowImage
Window
Window
WindowPosition
TBFromWin
WindowSize
TBFromWin
Screen
Screen
IsIconic
IsZoomed
Window
Window
window
theBounds
WndIsZoomed
WndIsIconic
WndSize
WndPos
ScreenDX
GetSystemMetrics
SM_CXSCREEN
ScreenDY
GetSystemMetrics
SM_CYSCREEN
TBFromWin
ScreenDX
ScreenDY
Screen
Screen
Screen
Screen
RatioY
RatioX
WinDy
WinDx
coordinates
WinFromTB
ScreenDX
ScreenDY
Screen
Screen
Screen
Screen
RatioY
RatioX
WinDy
WinDx
coordinates
MinimizeIt
ShowWindow
DrawWindowImage
currentApp
uxshowInfo
CurrentApp
MaximizeIt
ShowWindow
DrawWindowImage
currentApp
uxshowInfo
SetActiveWindow
CurrentApp
RestoreIt
ShowWindow
ShowWindow
DrawWindowImage
currentApp
uxshowInfo
SetActiveWindow
SetActiveWindow
CurrentApp
WindowMoved
fHfillScreenBox
WindowSized
fHfillScreenBox
fillApps
First
NextWindow
No More Windows
AppList
No Applications
DrawWindowImage
DrawWindowImage
WindowTitle
AppList
NextWindow
No More Windows
WindowTitle
AppList
NextWindow
No More Windows
AppList
uxShowInfo
firstApp
currentWindow
windowHandles
currentApp
ChooseApp
DrawWindowImage
uxShowInfo
currentApp
WindowHandles
AppNumber
SizeWinFromTBGroup
Window
Window
Window
Window
WinFromTB
SetWindowSize
uxShowInfo
WinCoor
CurrentApp
MoveWinFromTBGroup
Window
Screen
Window
Screen
WinFromTB
SetWindowPosition
IsIconic
ShowWindow
ShowWindow
uxShowInfo
WinCoor
CurrentApp
Windows DLL Routines
sectionNumber
startSection
Windows DLL routiness
Dynamic link librariesn
You can link to the Windows system DLLs to gain powerful memory and window management functions. For example, the Shuffle Windows demonstrated on the Example: ToolBook page uses both DDE and a Windows DLL.
For more information on Windows DLLs and other DLLs, see the Prototyping application. You can display it from the Application Sampler book..functions. For more information on Window's DLLs and DLLs in general, see the Prototyping application.
Memory management
GlobalAlloc
GlobalLock
GlobalUnlock
GlobalFree...
Window management
BringWindowToTop
MoveWindow
ShowWindow..........
Click the right arrow to continue.t page.hapter.in the next chapter.ext chapter....