System Arial Arial Print Window Dialog Page 1 Print Window prnXRes prnYRes scrnXRes scrnYRes BREAKS C&File &Open... Ctrl+O &Save Ctrl+S Save &As... saveas &Import... import &Export... export Print Set&up... printsetup &Print Pages... Ctrl+P printpages Prin&t Report... printreport Send &Mail... sendmail &Run... E&xit Alt+F4 &Edit &Undo Ctrl+Z Cu&t Ctrl+X &Copy Ctrl+C &Paste Ctrl+V paste C&lear Del clear Select &All Shift+F9 selectall Select Pa&ge Shift+F12 selectpage &Size to Page F11 sizetopage F&ind... F5 search Re&place... replace Aut&hor F3 author &Text &Character... F6 character &Paragraph... F7 paragraph &Regular Ctrl+Space regular &Bold Ctrl+B &Italic Ctrl+I italic &Underline Ctrl+U underline Stri&keout Ctrl+K strikeout Superscrip&t/Subscript super/subscript &Normal Script normalscript Su&bscript Ctrl+L subscript Su&perscript Ctrl+Shift+L superscript &Show Hotwords F9 showhotwords &Page &Next Alt+Right &Previous Alt+Left previous &First Alt+Up first &Last Alt+Down &Back Shift+F2 &History... Ctrl+F2 history N&ew Page Ctrl+N newpage &Help &Contents F1 contents Status &Bar F12 statusbar 1993,1994. Asymetrix Corporation. All Rights Reserved. * 9gives you permission e, revise, reuse the * --* individual scripts your own * --* applications. You may P entire --* substantial part redistribution i product. * retains copyright on original elements . Include notice: --* "Portions 1993, 1994. they contain copied --* Original Author: Ned Baker --* Updated By: Michael Florence linksysbook linkDlls initMenus printWindow LOCAL STACK winList, nameList, , handleList status whatWin = "dialog" LOGPIXELSX = 88 LOGPIXELSY = 90 device metrics driverInfo = getWinIniVar("windows", " *NULL "There no printer attached." deviceName = deviceFile = devicePort = hDC = createIC( prnXRes getDeviceCaps( prnYRes deleteDC( h"DISPLAY", scrnXRes scrnYRes = sysopenwindows windowhandle = getViewerName( media running multimedia toolbook sysOpenMedia <> " mediaList = whatClip = mmDeviceHandle dropdownitems combobox "openWindows" currentpage listtotextline( parentwindow %modal isOpen prnWindow = hWnd = windowHandle printArea = area" printMode = mode" X = Y = toTop = update = statusB = B"statusBar" close oldSys = sysSuspendMessages = TRUE oldStatus = statusbar -- pallettes NOT sysRuntime lineEndsPalette toolbar bringWindowToTop( hWnd1 = InvalidateRect( ",0,0) updateWindow( yield() = doPrintWindow( , X, Y) <> 0 Request "An error occurred during printing:"&CRLF&DIBError( -- * -- * Description: -- * This function prints the specified default -- * -- * Parameters: -- * WORD - Specifies emust xbe iconic be topmost on display. -- * `fPrintArea - Must be : 1 (corresponds PW_ALL) PW_CLIENT) -- * fPrintOpt z options. PW_BESTFIT) PW_STRETCHTOPAGE) PW_SCALE) -- * wXScale, wYScale - X Y scaling factors parameter. If 1 are these two parameters ( ) should be 0 (zero). -- * STRING szJobName - that would like job ( pshows up Manager %well "Now Printing..." box). (Still working on implementing version does xhave -- * Return Value: 0 successful, a z> 0 corresponding -- * , wPrintArea, wPrintOpt, ErrNo _ < 1 h > 2 < 1 hDib CopyWindowToDIB ( != 0 wReturn PrintDIB ( DestroyDIB ( -- * -- * -- * - specifies -- * independent bitmap -- * -- * - identifies -- * -- * copies -- * hRectWnd GlobalAlloc (66, 8) lpRectWnd GlobalLock ( GetWindowRect ( CopyScreenToDIB ( = 2 -- client GetClientRect ( .(0, .(2, .(4, .(6, clientRect ScreenFromClient ( , x1 & "," & y1 & "," & x2 & "," & y2) .(0, .(2, .(4, .(6, GlobalUnlock ( GlobalFree ( CopyWindowToDib -- * -- * -- * POINTER -- * -- * -- * -- * -- * hBitmap CopyScreenToBitmap ( #= 0 hPalette GetSystemPalette () BitmapToDIB ( DeleteObject ( -- * -- * -- * None -- * -- * 4palette -- * -- * returns a . which represents -- * 4RGB values logical -- * GetSystemPaletteEntries -- Find out how many entries we want. GetDC (0) nColors PalEntriesOnDevice (hDC) -- Allocate memory -- sizeof(LOGPALETTE) = 64 PALETTEENTRY) = 32 hLogPal 64 + ( * 32)) -- If we didn't ?= 0 ReleaseDC (0, -- Get a lpLogPal -- Fill palVersion palNumEntries fields structure. x300 (dec = 768) 3.0 later. 2(0, , 768) 2(2, palPalEntry tempPointer lpPalPalEntry (hDC, 0, -- Create Once done we 't need -- so free CreatePalette ( -- Do clean up. -- * -- * -- * context -- * -- * INT -- * -- * gets -- SIZEPALETTE = 104 GetDeviceCaps ( -- For non- devices, we will no. -- colors -- NUMCOLORS = 24 -- * -- * -- * -- * -- * -- * -- * -- * IsRectEmpty ( ) <> 0 hScrDC CreateDC (" 0, 0, 0) hMemDC CreateCompatibleDC ( .(0, .(2, .(4, .(6, screen resolution. xScrn , 8) -- HORZRES yScrn , 10) -- VERTRES -- Make sure nX < 0 nY < 0 nWidth nHeight compatible CreateCompatibleBitmap ( -- Select hOldBitmap SelectObject ( -- Bitblt ]SRCCOPY 0x00CC0020L = 13369376 BitBlt ( , 0, 0, , nX, nY, 13369376) -- Do DeleteDC ( -- * -- * Purpose: Frees associated fa DIB -- * Returns: Nothing -- * -- * -- * routine actual -- * PrintBand() 7(see below), procedure drives the -- * operation. () has code ;banding -- * printers. can be distinguished -- * () API ( -- * repeatedly call NEXTBAND escape -- * supports BANDINFO -- * used determine whether "wants" -- * graphics ( ignore -- * -- * -- * be printed -- * - tells , OR -- * (integers) p output -- * -- * errors.h description) -- * One : ERR_INVALIDHANDLE ERR_LOCK ERR_SETABORTPROC ERR_STARTDOC ERR_NEWFRAME ERR_ENDDOC ERR_GETDC ERR_STRETCHDIBITS wErrorCode validation. lpDIBHdr bits. lpBits FindDIBBits ( hPrnDC GetPrinterDC () <> 0 -- COLORONCOLOR = 3 SetStretchBltMode ( X, 3) -- Determine -- . fill -- CalculatePrintRect) hPrintRect lpPrintRect .(0, * 100) .(2, * 100) biWidth /(4, biHeight /(8, -- Call Escape() (10) strlenszJobName StringEscape ( , 10, 0, 0) -- Something went wrong. Do -- BANDINFOSTRUCT. hBandInfo lpBandInfo -- initial AStructure -- "% we -- also ! we .(0, , 1) -- bGraphics .(2, -- bText .(4, .(0, )) -- bRectLeft .(6, .(2, )) -- bRectTop .(8, .(4, )) -- bRectRight .(10, .(6, )) -- bRectBottom -- a rect -- funtion -- Check If we z, loop through -- each , calling -- ( supported) Else, -- )clipping -- -- -- QUERYESCSUPPORT = 8 -- ) = 2 hNEXTBAND lpNEXTBAND .(0, PointerEscape ( , 8, 2, ?, 0) -- -- -- -- = 24 -- .(0, , 24) -- bBandInfoDevice , 8, 2, -- -- = 24 .(0, , 24) , 8, 2, <> 0 -- Do (3), -- returned Y% where we -- exits empty. c(DwordPointerEscape ( , 3, 0, 0, ) > 0) ) = 0) -- Do needed. PointerPointerEscape ( , 24, 12, -- Pass -info flags -- data Note pass U" bandinfo -- stuff above (i.e. .(0, .(2, -- #whole .(0, .(0, )) -- .(2, .(2, )) -- .(4, .(4, )) -- .(6, .(6, )) -- , 1, 1, -- Non- (1). DwordEscape ( , 1, 0, 0, 0) -- End Only (11) -- we did xabort , 11, 0, 0, 0) -- We errored , but don't ,- we still -- z- box, instances, etc. -- -- * -- * U#a DC ¤tly selected -- * . on -- * History: GetWinIniVar (" printDevice printDriver printPort hdcPrint CreatePrinterDC ( 7, 0) += 0 -- * -- * Given (DIB, k, on the -- * *(image /coordinates). -- * -- * 1WORDs specify -- * Y directions, respectively. ', cxDIB, cyDIB information cxPage 8) -- pixels ( cyPage 10) -- cxInch 88) -- N/inch - X ( cyInch 90) -- -- * Best Fit =1 a preserves -- * *DIB's aspect fills horizontally. -- * -- * )formula S*"-> calculates -- * $, based on *ize -- * *width *relative -- * a ) = 1 -- myTop myLeft myBottom ) / ( myRight .(0, .(2, .(4, .(6, -- * Scaling * -- -- * multipliers multiply height/ * = 3 -- cxMult .(0, cyMult .(2, .(0, .(2, .(4, i/ 100)) .(6, s/ 100)) -- .(4, / 100)) -- .(6, / 100)) -- + = 2 -- .(0, .(2, .(4, .(6, -- * -- * *ALL called -- * -- * lpRectClip .rectangular -- * x2 we (i.e. we -- * fDoText fDoGraphics -- * appropriately ( -- * Normally -- * !lpRectOut, , lpDIBBits rectOutLeft .(0, rectOutTop .(2, rectOutRight .(4, rectOutBottom .(6, /(4, /(8, dblXScaling dblYScaling M-we up a holds >0paper WILL be intersect |0lpClipRect 8 we NEED Then, we IntersectRect ( *) = 0 rectLeft .(0, rectTop .(2, rectRight .(4, rectBottom .(6, rectInLeft + 0.5) rectInTop + 0.5) rectInRight + 0.5) rectInBottom + 0.5) StretchDIBits ( , 0, 13369376) -- DestDC -- DestX -- -- DestY -- -- DestWidth -- -- DestHeight -- SrcX - (rectInBottm - ) -- ScrY -- SrcWidth -- SrcHeight -- lpBitInfo 0 -- DIB_RGB_COLORS -- wUsage 13369376) -- -- dwROP -- * -- * -- * packed- ])block -- * -- * -- * -- * 5address -- * ) + PaletteSize ( -- * -- * -- * -- * -- * -- * -- * required store -- * multiplying RGBQUAD ( -- * :< 3.0-style RGBTRIPLE ( OS/2- -- * DIBNumColors ( ) * 4 -- -- * -- * -- * -- * -- * ,( table -- * -- * -- * Hfinding !Win3.0 OS/2- -- * DIB). If (=2, (=16, (=256, -- * 24, no -- If 9biClrUsed BITMAPINFOHEADER -- otherwise -- on dwClrUsed ,(32, wBitCount 2(14, -- * -- * -- * convert -- * -- * -- * -- * -- * :creates a 1= 0 hBitmapStruct lpBitmapStruct -- 2nd = 14 GetObject ( x, 14, -- If no e2 = 0 GetStockObject (15) -- DEFAULT_PALETTE bmPlanes )(8, bmBitsPixel )(9, biBits -<= 1 @> 1 H<= 4 [> 4 c<= 8 v> 8 ~<= 24 hBitmapInfo lpBitmapInfo =BITMAPINFOSTRUCTURE ,(0, ;, 40) /(4, .(2, /(8, .(4, 2(12, 2(14, ,(16, , 0) -- 3rd BI_RGB ,(20, /(24, /(28, ,(32, ,(36, biSize ,(0, /(4, /(8, biPlanes 2(12, biBitCount 2(14, biCompression ,(16, biSizeImage ,(20, biXPelsPerMeter /(24, biYPelsPerMeter /(28, ,(32, biClrImportant ,(36, dwLen 40 + realize SelectPalette ( Q6, 0) RealizePalette ( = 0 6, 1) lpbi -- Use ,(0, /(4, /(8, 2(12, 2(14, ,(16, ,(20, /(24, /(28, ,(32, ,(36, I&GetDIBits )@, so q7= 0. FirstGetDIBits ( 8, 0, &, 0, -- If ,(20, ) = 0 ,(20, -- Realloc Bbuffer big enough -- Setting ,(0, ,(20, GlobalReAlloc ( h = 0 fa NON- actually SecondGetDIBits ( `;, 0, /(8, -- Clean up ;, 1) $<, 1) wB < 0) B >= 28)) -- tequivalent MB_OK | MB_ICONSTOP MessageBox(0, "Undefined F!", "", 16) C = 0 C = 1 ErrString "Not a uBfile!" GC = 2 "Couldn't allocate sC = 3 G reading C = 4 G locking C = 5 G opening C = 6 H creating D = 7 -H getting a DC!" -D = 8 6@ ( L, INT) SetDlgItemText ( ( SendMessage ( O UpdateWindow ( M, INT, IntEscape = -e = INT tb40win.dll" tb40dlg. NlistToTextline ( 7NtextlineToList ( V whatViewer "&"E& initmenus = FALSE menuItemEnabled( ,) = Y..." alias buttonclick printmode lockScreen e= TRUE printMode enabled B"X" = FALSE B"Y" = "X" = "Y" = "X" = LIGHTGRAY "Y" = "X" = "0" "Y" = "0" B"X" = B"Y" = "X" = "Y" = "X" = WHITE "Y" = "X" = "1.0" "Y" = "1.0" = 3 B"X" = B"Y" = "X" = "Y" = "X" = "Y" = "X" = prnXRes "dialog"/scrnXRes "Y" = prnYRes print dialog print dialog 15,15 lastUnits inside outside frameupdate notifybefore frameupdate x = syspageunitsperpixel y = "inside" "outside" H(2*x) H(2*y) outside inside Print &Mode print mode printmode Actual Size Fit to Page Stretch to Page Custom Scale frame openWindows frameUpdate notifyBefore frameUpdate b = combobox "openWindows" x = syspageunitsperpixel y = b)-x,( b)-y, ( b)+x, ( acceptDrop draggable This field shows the keyword to search for. helpInfo Available Viewers inside outside frameupdate notifybefore frameupdate x = syspageunitsperpixel y = "inside" "outside" H(2*x) H(2*y) outside inside openWindows Viewer id 0 of Book "D:\JXWORK\TODO.TBK"9 Viewer id 0log" Viewer id 0ttons" Viewer id 0r id 0 of Book "D:\JXWORK\TODO.TBK"WND.SBK"BK.TBK" Viewer id 0 of Book "D:\JXWORK\SCRAPBK\SCRAPBK.TBK" &X Scale 6.255 6.255 &Y Scale inside outside frameupdate notifybefore frameupdate x = syspageunitsperpixel y = "inside" "outside" H(2*x) H(2*y) outside inside print area printarea buttonclick buttonclick printarea printarea Entire Window Client Area Print &Area toTop Bring Window to Top update Update All Windows statusBar Include Status Bar buttonclick buttonclick &Print buttonclick buttonclick close &Cancel frameUpdate lastUnits frameUpdate lastUnits enterpage frameUpdate sysPageUnitsPerPixel <> lastUnits '= TRUE frameUpdate '= FALSE enterpage notifyBefore buttonClick enterpage *ClassTbl* *ClassEntry* *PTABLE* *WINDOWSEG* Viewer *ICONRESTAB* *ICONRESSEG* *ICONRES* Background *OBJTABLE* *IDTABLE* *NAMETAB* Rectangle Ellipse RoundedRectangle Polygon IrregularPolygon AngledLine Curve Field RecordField ComboBox Button PaintObject Picture Hotword *RHOTWORD* Group Stage *TbxBase* *V"V"V gm>wj'E^K.P initMenus wjlinkDlls linksysbook initMenus enterBook ,&H.& ,&H.& ,&H.& w, #> fd device An error occurred during printing: colorTray lineEndsPalette DISPLAY deviceFile printArea scrnYRes printMode kInvalidateRect YprnXRes openwindows deviceName statusBar driverInfo patternPalette kScreateIC toolPalette mediaList NdeleteDC yield prnWindow LOGPIXELSY printArea ^KgetViewerName bringWindowToTop update whatClip printMode sysOpenMedia LOGPIXELSX print mode .updateWindow linePalette windows statusbar toolbar toTop listtotextline ZprnYRes jdoPrintWindow dialog hWnd1 polygonPalette openWindows 4getDeviceCaps devicePort whatWin scrnXRes print area gDIBError *getWinIniVar There is no printer attached. printWindow .'+ +F .'+ +F .'+ +F wReturn DestroyDIB OjPrintDIB CopyWindowToDIB gDIBError doPrintWindow 1,#"m 1,#"m 1,#"m 1,#"m GlobalUnlock GlobalAlloc ScreenFromClient EGetClientRect GlobalFree GlobalLock lpRectWnd y[GetWindowRect CopyScreenToDIB hRectWnd clientRect CopyWindowToDIB GetSystemPalette DeleteObject hPalette H:CopyScreenToBitmap hBitmap BitmapToDIB CopyScreenToDIB ,"J Y ;&PalEntriesOnDevice GlobalAlloc lpPalPalEntry }ReleaseDC W2GetSystemPaletteEntries GlobalFree nColors GlobalLock GetDC GlobalUnlock lpLogPal tempPointer 4>CreatePalette hLogPal GetSystemPalette 4GetDeviceCaps nColors ErrNo gDIBError PalEntriesOnDevice SelectObject DISPLAY NDeleteDC yScrn hOldBitmap nHeight hScrDC 4GetDeviceCaps CreateCompatibleBitmap xScrn nWidth hMemDC BitBlt hBitmap jOCreateDC 4 IsRectEmpty CreateCompatibleDC CopyScreenToBitmap GlobalFree DestroyDIB ,"JdY ,"JdY _2DwordPointerEscape bBandInfoDevice lpBits GlobalAlloc biWidth GlobalUnlock bGraphics SetStretchBltMode lpDIBHdr lpPrintRect GlobalLock z GetPrinterDC StringEscape PointerPointerEscape PrintBand biHeight 6+CalculatePrintRect GlobalFree hPrintRect hNEXTBAND JPointerEscape NDeleteDC lpBandInfo ErrNo FindDIBBits bText lpNEXTBAND hRect strlenszJobName DwordEscape 4 IsRectEmpty lpRect hPrnDC hBandInfo gDIBError PrintDIB device printPort hdcPrint ErrNo windows printDevice printDriver CreatePrinterDC *GetWinIniVar gDIBError GetPrinterDC cyPage cyInch 4GetDeviceCaps cxPage cxInch CalculatePrintRect wReturn GlobalUnlock GlobalAlloc RStretchDIBits GlobalLock rectInLeft rectLeft GlobalFree ErrNo TUIntersectRect lpRect hRect 4 IsRectEmpty rectTop gDIBError PrintBand lpBits PaletteSize FindDIBBits T%DIBNumColors PaletteSize dwClrUsed wBitCount DIBNumColors GlobalUnlock lpBits GlobalAlloc lpBitmapStruct GSelectPalette }ReleaseDC biHeight lpBitmapInfo hBitmapStruct FirstGetDIBits GlobalLock GetDC SecondGetDIBits GetObject PaletteSize /GlobalReAlloc hBitmapInfo ruGetStockObject GlobalFree dwLen vRealizePalette BitmapToDIB Error getting a DC! Error creating printer DC! Printer: StartPage failed! MessageBox Error creating DIB from specified window. Printer: SetAbortProc failed! Error opening file! Undefined Error! Printer: StartDoc failed! Printing: GetModuleHandle() couldn't find GDI! StretchBlt() failed! Error: Invalid Print Option! StretchDIBits() failed! Printer: NEWFRAME failed! Error reading file! File Not Found! Not a Windows DIB file! ErrString Invalid Handle Error locking memory! SetDIBits() failed! Error creating palette! SetDIBitsToDevice() failed! General Error on call to DIB function Couldn't allocate memory! Printer: EndPage failed! Error: Invalid Print Area! Error getting number of colors, check the device you are using. Error creating Device Dependent Bitmap Printer: EndDoc failed! DIBError tb40win.dll tb40dlg.dll BringWindowToTop GetClientRect GetDC GetWindowRect IntersectRect IsRectEmpty MessageBox ,$Taile-# RealizePalette ReleaseDC SelectPalette SetDlgItemText SendMessage UpdateWindow InvalidateRect ScreenFromClient , Uaileg GetWinIniVar BitBlt CreateCompatibleBitmap CreateCompatibleDC CreateDC CreateDC CreatePrinterDC CreatePalette DeleteDC DeleteObject Escape PointerEscape ,'T fin-# Escape DwordEscape Escape IntEscape Escape StringEscape Escape DwordPointerEscape Escape PointerPointerEscape GetDeviceCaps GetDIBits FirstGetDIBits GetDIBits SecondGetDIBits ,$Tter:-# GetObject GetStockObject GetSystemPaletteEntries ,CT~4 SelectObject SetStretchBltMode StretchDIBits createIC getDeviceCaps listToTextline textlineToList GlobalAlloc GlobalLock GlobalUnlock GlobalFree GlobalReAlloc getModuleHandle LoadLibrary , Tiled-$ Yield kernel linkDlls viewer getViewerName printWindow Print Window... initmenus printMode ZprnYRes printmode scrnXRes YprnXRes scrnYRes dialog printMode buttonclick false goPage qkinitializePage Zselected pageID buttondown [darkBlue selected checkref false Cvisited subPages curID pageID pageID OBmypages value updateChecks pageID pageID label updateLabels