`~ 1~
`
`AL A I
`I URoG
`~~l~~IER S
`UIDE To,~~ THE
`I1\TD O~~1TS
`
`~:
`
`.,..
`
`•r~~
`
`IC R
`«l~llot
`
`" ~ •
`
`ii
`
`•'
`
`Turn your Visual Basic
`knowledge into Windows
`programming expertise
`bx .tapping into the
`powerful tools of the
`Windows application
`programming interface
`(aPl). Master programmer
`Daniel Appleman can
`mike you a Windows
`developer in less time
`than you ever thought
`possible—even if you've
`Herter programmed
`111~~dows before.
`
`` ~D~~S
`~Va~~oS~6
`y `~
`
`,~
`Daniel Appleman
`~./~~
`
`Facebook's Exhibit No. 1006
`Page 1
`
`
`
`SPRY OF 41yGq~
`ss
`~~B 0 5 i99~
`~aP~'R1GNT O~ ~G~3
`
`Facebook's Exhibit No. 1006
`Page 2
`
`
`
`•
`
`g z
`P 1~~1~ a lne
`v
`isual B is
`,.
`Pao ~a~~~~e~s
`g
`Guide ~o the
`indowsAPl
`TAU
`
`PLEASE NOTE-USE OFTHE DISKS) AND THE PROGRAMS INCLUDED ON THE DISKS) PACKAGED WITH THIS BOOKAND
`THE PROGRAM LISTINGS INCLUDED IN THIS BOOK IS SUBJECT TO AN END-USER LICENSE AGREEMENT (THE
`"AGREEMENT') FOUND AT THE BACK OF THE BOOK. PLEASE READ THE AGREEMENT CAREFULLY BEFORE MAKING
`YOUR PURCHASE DECISION. PURCHASE OF THE BOOKAND USE OFTHE DISKS, PROGRAMS, AND PROGRAM LISTINGS
`WILL CONSTITUTE ACCEPTANCE OF THE AGREEMENT.
`
`+.
`
`}i.t
`
`Facebook's Exhibit No. 1006
`Page 3
`
`
`
`0
`
`~~ G~ Z~Z~
`~ ~
`G~ ~~'SlC
`~''G~!~~Y~~lel'~,~'
`~e t0 the
`OI~VSA.PI
`
`Daniel Appleman
`. ~
`
`T ~
`
` I t 1
`
`~ I ■ 1C : '
`-. '1
`
`Ziff-Davis Press
`Emeryville, California
`
`Facebook's Exhibit No. 1006
`Page 4
`
`
`
`~ ~;
`
`~ l ~t~
`~~~ ,
`~~~~
`~' ~,~'~ Gam'
`
`i'J ~p (c~
`
`1~r~~~ ~ ~~-`
`
`Editor
`Technical Reviewer
`Project Coordinator
`Proofreader
`Cover Design
`Cover Illustration
`Book Design
`Technical Illustration
`Screen Graphics Editor
`Word Processing
`Page Layout
`Indexer
`
`Terry Somerson
`Don Malin
`Sheila McGill
`Pat Mannion
`Ken Roberts
`Ken Roberts
`Laura Lama;/MAX, San Francisco
`Cherie Plumlee Computer Graphics &Illustration
`Dan Brodnitz
`Howard. Blechman and Cat Haglund
`Steph Bradshaw, Anna. L. Marks, M. D. Barrera, and Tony Jonick
`Mark Kmetzko
`
`This book was produced on a Macintosh IIfx, with the following applications: FrameMaker~, Microsoft
`Word, MacLink~Plus, Aldus FreeHandT"' ,Adobe PhotoshopTA1, and Collage P1usT~^.
`Ziff-Davis Press
`5903 Christie Avenue
`Emeryville, CA 94608
`
`Copyright ~ 1993 by Ziff-Davis Press. All rights reserved.
`PC Magazine is a registered trademark of Ziff Communications Company. Ziff-Davis Press, ZD Press, and
`PC Magazine Guide To are trademarks of Ziff Communications Company.
`All other product names and services identified throughout this book are trademarks or registered
`trademarks of their respective companies.They aze used throughout this book in editorial fashion only and
`for the benefit of such companies. No such uses, or the use of any trade name,.is intended to convey
`endorsement or other affiliation with the book.
`No part of this publication may be reproduced in any form, or stored in a database or retrieval system, or
`transmitted or distributed in any form by any means, electronic, mechanical photocopying, recording, or
`otherwise, without the prior written permission of Ziff-Davis Press, except as permitted by the Copyright
`Act of 1976 and the End-User License Agreement at the back of this book and except that program listings
`maybe entered, stored, and executed in a computer system.
`EXCEPT FOR THE LIMITED WARRANTY COVERING THE PHYSICAL DISKS) PACKAGED
`WITH THIS BOOK AS PROVIDED IN THE END-USER LICENSE AGREEMENT AT THE BACK
`OF THIS BOOK, THE INFORMATION AND MATERIAL CONTAINED IN THIS BOOK ARE
`PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND; EXPRESS OR IMPLIED,
`INCLUDING WITHOUT LIMITATION ANY WARRANTY CONCERNING THE ACCURACY,
`ADEQ~JACY, OR COMPLETENESS OF SUCH INFORMATION OR MATERIAL OR THE
`RESULTS TO BE OBTAINED FROM USING SUCH INFORMATION OR MATERIAL. NEITHER
`ZIFF-DAMS PRESS NOR THE AUTHOR SHALL BE RESPONSIBLE FOR ANY CLAIMS
`ATTRIBUTABLE TO ERRORS, OMISSIONS, OR OTHER
`INACCURACIES IN THE
`INFORMATION OR MATERIAL CONTAINED IN THIS BOOK, AND IN NO EVENT SHALL
`ZIFF-DAMS PRESS OR THE AUTHOR BE LIABLE FOR DIRECT; INDIRECT, SPECIAL,
`INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF SUCH
`INFORMATION OR MATERIAL.
`
`ISBN 1-56276-073-4
`
`Manufactured in the United States of America
`~ The paper used in this book exceeds the EPA requirements for postconsumer recycled paper.
`10987654321
`
`X13 ~171~07~
`
`Facebook's Exhibit No. 1006
`Page 5
`
`
`
`CONTEtVTS AT A GLANCE
`
`Part 1
`
`Part 2
`
`-
`
`Part 3
`
`Introduction xxi
`The Windows API
`1. DLLs and APIs 3
`2. Getting a Handle on Windows 13
`3. The Visual Basic—Windows Interface 35
`Windows API Functions
`4. Windows Control and Information Functions 63
`.5. Hardware and System Functions 149
`6. Device Contexts 201
`7. Drawing Functions 265
`8. Bitmaps, Icons, and Raster Operations 323
`9. Working with Menus 379
`10. Text and Fonts 423
`11. Printing 479
`12. Memory, Task, and Resource Management 527
`13. File Operations 569
`14. Serial Communications 621
`15: The Clipboard, Sound Drivers, and Other Topics 661
`16. Advanced Topics 691
`Windows Messages
`17. General Windows Messages 741
`18. Edit Control Messages 783
`19. List Box, Combo Box, and Button Messages 809
`Appendix A: Using APIGUIDE.DLL and CBK.VBX 853
`Appendix B: Windows Data Structures 871
`Appendix C: Windows File Formats 904
`,
`Appendix D: Visual Basic-to-DLL Calling Conventions: A Technical
`Review 909
`Appendix E: Index of API Functions and Declarations 917
`Appendix F: Index,of Windows Messages and Values , 957
`Appendix G: Raster Operation Table 969
`Appendix H: About the Accompanying Disk 982
`Index 987
`
`',;;,~
`'~~
`,;
`",
`
`I'
`II I
`j
`'
`~!'
`~!~
`I'
`
`i~
`
`Facebook's Exhibit No. 1006
`Page 6
`
`
`
`TABLE OF CONTENTS
`
`Introduction xxi
`What Is in This Book xxi
`A Quick Tour of the Contents xxii
`How to Use This Book Dui
`Visual Basic Compatibility xxiii
`Conventions HIciv
`Closing Notes xxiv
`
`Part 1
`
`The Windows API
`
`1. DLLs and APIs 3
`Moving from DOS to Windows 3
`Dynamic Link Libraries (DLLs) 4
`Static Linking 5
`Dynamic Linking 6
`Visual Basic and DLLs 8
`Application Programmer's Interface (API) 9
`The Windows API and Visual Basic 9
`The Major Windows DLLs 10
`2. Getting a. Handle on Windows 13
`Relating Visual Basic to Windows '13
`An Overview of Visual Basic 13
`• An Overview of Windows 14
`Translating Visual Basic Concepts to,Windows 15
`Inside Windows 16
`What Is a Window? 16
`Windows Have Class 16
`Windows Have Style 18
`Other Windows Attributes 18
`The Windows Function 20
`Superclassing and Visual Basic Controls 21
`The Visual Basie-Windows Connection Revisited 25
`Graphic Output in Windows 26
`The Graphical Device Interface 26
`
`Facebook's Exhibit No. 1006
`Page 7
`
`
`
`viii
`
`Device Contexts 27
`Memory Device Contexts 29
`A Handle for Every Object 30
`Using Handles 31
`The Next Step 31
`3. The Visual Basio-Windows Interface 35
`The•Declare Statement 35
`Argument Lists 36
`DLL Parameters 38
`DLL Parameter'I~pes and Notation 39
`Eight- and 16-Bit Numeric Parameters 40
`32-Bit Numeric Parameters 42
`Currency Parameters 43
`Floating-Point Parameters 43
`Variants 43
`Object Handles 43
`Flags and Bitfields 44
`Strings 48
`Pointers to Numeric Values 49
`Pointers to Structures 50
`Pointers to Arrays 51
`Pointers to Functions 51
`Parameters Accepting More Than One Type 52
`Programming Techniques 53
`Aliasing 53
`Sending Messages 55
`Software Support 56
`Avoiding General Protection Faults 57
`
`Part 2 Windows API Functions
`4. Windows Control and Information Functions 63
`Rectangle and Point Functions 63
`RECT Type Definition 63
`POINTAPI Type Definition 65
`
`Facebook's Exhibit No. 1006
`Page 8
`
`
`
`Ix
`
`Rectangle Functions 65
`Example: RectPlay 65
`Window Control and Information Functions 74
`Window Hierarchy and Identification Functions 75
`Window Location and Size Functions 77
`Window Information Functions and Styles 79
`Other Window Functions 80
`Example: WinView 81
`Window Style Reference 101
`General Windows Style Bits Table 102
`Extended Windows Style Bits Table 103
`Dialog Box Style Bits Table 104
`MDIClient`Class Style Bits Table 10S
`Button Class Style Bits Table 105
`ComboBox Class Style Bits Table 106
`Edit Class Style Bits Table 107
`ListBox Class Style Bits Table 109
`ScrollBar Class Style Bits Table 110
`Static Class Style Bits Table 110
`Function Reference 112
`
`5. Hardware and System Functions 149
`Mouse, Cursor, and Caret Functions 149
`Cursor Clipping 149
`Cursor Position 149
`Other Mouse and Cursor Functions 150
`Caret Functions 151
`Keyboard and Other Input Functions 152
`The OEM and Windows Character Sets 152
`Scan Codes and Virtual Keys 153
`Virtual Key Codes 155
`Input Control, Functions 158
`Time and System Functions 158
`Time Functions 158
`System Information and Control Functions 159
`
`Facebook's Exhibit No. 1006
`Page 9
`
`
`
`x
`
`Example: SysInfo—A System Information Viewer 160
`Using SysInfo 160
`Project Description 162
`Form Description 162
`SysInfo Listing 165
`Function Reference 174
`
`6. Device Contexts 201
`Introduction to Device Contexts 201
`The Philosophy behind the Device Context 201
`Obtaining a Device Context 205
`Device Context Attributes 207
`Using Device Contexts with Visual Basic 207
`Device Context Information Functions 212
`Example: DevView—A Device Information Viewer 212
`Scaling and Coordinate Systems 218
`Logical versus Device Coordinates 218
`Mapping Modes 220
`Windows and Viewports—Extents and Origins 221
`Windows Coordinate Systems and Visual Basic 225
`Clipping, Regions, and Other'Device Context Control Functions 225
`Regions 225
`Clipping 226
`Validation 227
`Performance Considerations 22~
`Example: C1ipView—A Brief Clipping Demonstration 228
`Function Reference 232
`
`7. Drawing Functions 265
`Overview of Graphic Output 265
`GDI Drawing Objects 265
`Creation of GDI Drawing Objects 266
`Selection and Deletion Rules for GDI Objects 266
`Pens 268
`Brushes 268
`GDI Objects and Visual Basic 270
`
`Facebook's Exhibit No. 1006
`Page 10
`
`
`
`xi
`
`,
`
`Drawing Attributes 271
`Line Raster Operations 271
`Background Mode 272
`Current Position 272
`Drawing Functions 272
`Metafiles 273
`Example: QuikDraw—Drawing with API Functions 274
`Using QuikDraw 275
`Project Description 276
`Form Description 276
`QuikDraw Program Listings 282
`Suggestions for Modifying QuikDraw 292
`Function Reference 293
`
``
`
`8. Bitmaps, Icons, and Raster Operations 323
`Bitmaps 323.
`Displaying Pixels 323
`Color Planes and Device Palettes 323
`Device-Dependent Bitmaps '326
`Using Bitmaps 329
`~'
`Color Conversions 330
`Using B.itmaps with Visual Basic 330
`Device-Independent Bitmaps 330
`Icons and Cursors 332
`Raster Operations 334
`Using Raster-Ops 335
`Example: StockBMs — A Stock Bitmap and Icon Viewer 336
`Using StockBMs 337
`Project Description 337
`Form Description 337
`StockBMs Listing 338
`Example: Puzzle — A Tiled Bitmap Puzzle ~Garne 343
`Using Puzzle. 343
`Project Description 344
`Description of PUZZLE.FRM 344
`Description of PUZZLE2.FRM 346
`
`Facebook's Exhibit No. 1006
`Page 11
`
`
`
`xii
`
`Puzzle Listing 348
`Suggestions for Improvements 359
`Function Reference 360
`9. Working with Menus 379
`Inside the Menuing System 379
`How Windows Menus Work 379
`How Visual Basic Menus Work 382
`Using the Menu API Functions with VB 386
`Creating Custom Checkmark Symbols 386
`Using Bitmaps to Customize Menus 386
`Tracked Popup Menus 387
`Creating a Pool of VB Menu Controls 387
`Obtaining Information about the VB Menu Structure 388
`Example: MenuLook—A Menu Structure Viewer 388
`Using MenuLook 388
`Project Description 390
`Form Description 391
`MenuLook Listings 394
`Function Reference 407
`
`10. Text and Fonts 423
`Using Fonts 423
`Introduction to Fonts 423
`Understanding Font Attributes 425
`Working with Fonts 432
`Font Parameters Used in Functions and Data Structures 435
`Drawing Text, 439
`The Process of Drawing Text 439
`Text Extents and Alignment 440
`Example Program: FontView 441
`Using FontView 441
`Project Description 443
`Form Description 443
`FontView Listings 446
`Example Program: TextDemo 450
`Using TextDemo 450
`
`~
`
`Facebook's Exhibit No. 1006
`Page 12
`
`
`
`X111
`
`Project Description 451
`Form Description 452
`TextDemo Listings 453
`Function Reference 458
`
`11. Printing 479
`Printing in Windows 479
`Printer Device Contexts 479
`Printer Configuration 480
`The Printing Sequence 481
`Aborting the Print Operation 482
`Printing and Visual Basic 483
`compatibility Issues 483
`Driver Quirks 484
`Printer Settings and the DEVMODE Structure 484
`Printer Escapes 487
`Escape, EscapeBynum, EscapeBystring 48'7
`Escape Function Operations 488
`Example: PicPrint—Prints a Bitmap and Shows Printer
`,
`Configuration 494
`Using PicPrint 494
`Project Description 496
`PicPrint' Form Description 497
`AbortForm Form Description 498
`PicPrint Listings 499
`Reference for APIGUIDE.DLL Functions 516
`Reference for API Functions 521
`
`12. Memory, Task, and Resource Management 527
`Global Memory 527
`Using Visual Basic Strings as Buffers 527
`The Windows Global Memory Heap 529
`Using Global Memory Blocks from Visual Basic 531
`Resources 537
`Resources and Windows Applications 537
`Resources and Visual Basic 538
`Resource API Functions 540
`
`Facebook's Exhibit No. 1006
`Page 13
`
`
`
`xiv
`
`Task and Module Functions 541
`Modules 542
`Instances 543
`Tasks 543
`Example: ExecDemo—A Program Launcher 544
`Using ExecDemo 545
`Project Description 545
`Form Description 545
`ExecDemo Listings 546
`Function Reference 549
`
`13. File Operations 569
`Initialization Files 569
`Version Stamping 570
`Version Stamping and Visual Basic 571
`The Version Data Structures 572
`File and Directory Operations 577
`The OpenFile Function and the OFSTRUCT Structure 578
`File Access Functions 581
`Compressed'File Operations 582
`Example: FileDemo—Initialization File and Version Stamping
`Program 584
`Using FileDemo 584
`Project Description 585
`Form Description 586
`FileDemo Listings 587
`Function Reference 594
`
`14. Serial Communications 621
`Introduction to Serial Communications 621
`Serial Data Format 622
`The RS-232 Standard 623
`Flow Control 626
`The Windows Serial Communications Driver 626
`Architecture of a Serial Driver 626
`Using the Serial Driver 627
`Configuring Serial Ports and the Device Control Block 630
`
`Facebook's Exhibit No. 1006
`Page 14
`
`
`
`xv
`
`Obtaining Serial Port Status 633
`The Serial Driver API Functions 634
`Example: CommDemo—A Simple Terminal Program 635
`Using CommDemo 635
`Project Description 636
`Form Description 637
`CommDemo Listings' 640
`Function Reference 650
`
`15. The Clipboard, Sound Drivers, and 'Other Topics 661
`Clipboard Operations 661
`_
`How the Clipboard Works 661
`Clipboard Formats 662
`Accessing the Clipboard 665
`Use with VB 666
`Sound Capabilities and Multimedia 666
`Multimedia 667
`Windows Sound Driver 669
`Scroll Bars, Port I/O, and Online Help 672
`Scroll Bars 672
`Port I/O 672
`Online Help 673
`Function Reference 674
`
`-
`
`16. Advanced Topics 691
`Inside Strings and Structures 691
`String Functions 691
`Organization of Data in Variables 692
`Organization of Data in Structures 692
`Color Palettes 694
`Hardware Palettes and Logical Palettes 694
`Drawing with Palettes 695
`Using Logical Palettes 696
`Using Palette Functions with Visual Basic 698
`- Example: PalTest—A Palette Demonstration Program 699
`Using PalTest 699
`Project Description 700
`
`Facebook's Exhibit No. 1006
`Page 15
`
`
`
`XYI
`
`PalTest Listings 703
`Message Processing and File Dragging 709
`Using PeekMessage 710
`Dragging Files 711
`Atoms and Properties 713
`Atoms 713
`Property Functions 714
`Miscellaneous Functions 715
`Function Reference 717
`
`Part 3 Windows Messages
`17. General Windows Messages 741
`Message Handling 741
`Windows Event Messages 741
`Messages That Perform Operations 742
`Message Organization 742
`Sending Messages 743
`Message Parameters 743
`Messages That Return Values 743
`The WM_COMMAND Message 744
`Messages That Are Useful with Visual Basic 744
`Message Reference 746
`18. Edit Control Messages 783
`The Text Control 783 ,
`Undo Capability 783
`Text Formatting 783
`Selection and Display 784
`Example: TextMsgs—A Demonstration of Edit Control Messages 786
`Using TextMsgs 787
`Project Description 787
`Form Description 787
`TextMsgs Listings 790
`Notification Messages 796
`Edit Control Messages 798
`
`Facebook's Exhibit No. 1006
`Page 16
`
`
`
`xvii
`
`,
`
`19. List Box, Combo Box, and Button Messages 809
`The List Control 809
`Selection and Data Functions 809
`Display Functions 810
`The Combo Box Control 813
`Button Controls 815
`Example: APICons—A Tool to Select API Constants 816
`Using APTCons 817
`Project Description 819
`Form Description 819
`APICons Listings 822
`Notification Messages 829
`Combo Box Control Messages 834
`List Box Control Messages 839
`Button Control Messages 850
`' Appendix A: Using APIGUIDE.DLL and CBK.VBX 853
`CBK.VBX—Generic Callback Custom Control 853
`How Do Callback Functions Work? 853
`Using CBK.VBX 855
`Callback Types and Events 857
`APIGUIDE.DLL 863
`Appendix B: Windows Data Structures 871
`Appendix C: Windows File Formats J04
`Bitmap File Format 904
`Icon File Format 904
`Cursor File Format 906
`Metafile Format (.WMF extension) 908
`Appendix D: Visual Basio-twDLL Cail~ng Conventions: A Technical
`Review 909
`Calling Conventions 909
`Calling Conventions by Data Type 909
`Numeric Data Types 910
`Currency Data Types 910
`
`.
`
`~
`
`Facebook's Exhibit No. 1006
`Page 17
`
`
`
`XV111
`
`String Data Types 910
`Forms anti Controls 912
`User-Defined Types 912
`Arrays 912
`Variants 913
`Summary of Parameter Passing Conventions 914
`Avoiding General Protection Faults 915
`
`Appendix E: Index of API Functions and Declarations 917
`
`Appendix F: index of Windows Messages and Values 957
`
`Appendix G: Raster Operation Table 969
`
`~. IO;'~ Appendix H: About the Accompanying Disk 982
`~4;u~
`Installation 982
`Disk Contents 982
`Distributing Files 986
`
`Index 987
`
`Facebook's Exhibit No. 1006
`Page 18
`
`
`
`C H A P T E R
`
`'`'
`
`L~.. .., -.~: .
`
`DLLs and APIs
`
`;~~ ~~
`
`i
`
`Moving from DOS
`to Windows
`Dynamic Linlc Libraries
`(DLLs)
`Application
`Prograrn~raer',s Interface
`(API)
`
`~~'
`
`Facebook's Exhibit No. 1006
`Page 19
`
`
`
`~~ Application Programmer's Interface (ARi)
`
`Application Programmer's Interface (API)
`API is one of those acronyms that seems to be used primarily to intimidate
`people. An API is simply a set of functions available to an application
`programmer. The DOS interrupt functions can technically be considered the
`DOS API. If you write database programs in dBase, the dBase functions you
`use can be considered the dBase API.
`The term is most often used to describe a set of functions that are part of
`one application but are being accessed by another application. When a Visual
`Basic program uses Dynamic Data Exchange to execute an Exeel spread-
`sheet function, you can say that it is accessing the Excel API.
`So, the Windows API refers to the set of functions that are part of Win-
`dows and are accessible to any Windows application. It is difficult to over-
`state the significance of this concept. Consider the following example.
`Bring up the Windows Program Manager and invoke the About com-
`mand under the Help menu. A dialog box will come up showing information
`about the system including the amount of memory free in Windows.
`Obviously there is a method within Windows for determining how much
`free memory is present. As it turns out, that function is called GetFYeeSpace
`and is exported by Windows (thus it is part of the API and is available to any
`Windows application).
`Try the following trivial Visual Basic program:
`
`' Create .a new project
`
`' In the global module place the following statement:
`Declare Function GetFreeSpace& Lib "KERNEL" (byval wFlags%)
`
`' In the form_Click event for forml place the following line:
`P rint Int(GetFreeSpace&(0)/1 24); "KB Free"
`Now run the program. When you click anywhere on the form, it will dis-
`play the amount of available system memory. Almost every aspect of the Win-
`dows environment and the API functions associated with it are accessible
`from Visual Basic.
`
`The Windows API and Visual Basic
`When you consider that the Windows API has literally hundreds of functions,
`it becomes apparent that there is a great deal of capability available.
`
`,,~•..
`
`link
`
`to
`
`Facebook's Exhibit No. 1006
`Page 20
`
`
`
`C H A P T E R
`
`Windows Control a
`Information Functi~
`
`Rectangle and Poznt
`Functions
`Window Control and
`Information Functions
`Window Style Reference
`Function Reference
`
`Facebook's Exhibit No. 1006
`Page 21
`
`
`
`_,,,~
`
`Function Reference
`
`119
`
`Return Value
`
`Integer—TRUE (nonzero) if the upper left and lower right coordinates of the two rectangles are
`equal, zero otherwise.
`
`■ FindWindow, FindWindowBynum, FindWindowBystring
`VB Declaration Declare Function FindWindow% Lib "User" (Byval 1pClassName As Any, Byval a
`1pWindowName As Any)
`Declare Function FindWindowBynum% Lib "User" Alias "FindWindow" (Byval a
`1pClassName&. Byval 1pWindowName&)
`Declare Function FindWindowBystring% Lib "User" Alias "FindWindow" (Byval r~
`1pClassName$, Byval 1pWindowNameB)
`
`Description
`
`Finds the first window in the window list that meets the specified conditions.
`
`Use with VB
`
`No problem.
`Parameter
`1pClassName
`
`1pWindowName
`
`Type/Description
`Long or String—Pointer to null terminated (C language) string contain-
`ing the name of the class for the window, or zero to accept any class.
`Long or String—Pointer to null terminated (C language) string contain-
`ing the window text (or title), or zero to accept any window title.
`
`Return Value
`
`Integer—The handle of the first window found, or zero if no window is found that meets the
`requirements.
`
`Comments
`
`~indWindowBynum and FindWindowBystring provide type-safe declarations for the ~ncLWin-
`dow function. When using FtindWindowBynum, you may use the agGetAddressForLPSTR$ func-
`tion in APIGUIDE.DLL to obtain a pointer to a null terminated string in Long type format.
`
`■ FlashWindow
`VB Declaration Declare Function F1ashWindow% Lib "User" (ByVal hWnd%, ByVal bInvert%)
`
`Description
`
`Use with VB
`
`Return Value
`
`Comments
`
`Flashes the specified window. This means that the title or caption is changed as if switching from
`active to inactive or vice versa. This function is commonly used for inactive windows to attract
`the user's attention.
`
`No problem.
`Parameter
`hWnd
`bInvert
`
`T~pe/Description
`Integer—Handle of the window to flash.
`Integer—TRUE (nonzero) to toggle the window caption. FALSE to re-
`turn to the original state.
`
`Integer—TRUE (nonzero) if the window was active before the call.
`
`This function is frequently used in combination with a timer to cause repeated flashing. flnvert is
`ignored on minimized windows.
`
`Facebook's Exhibit No. 1006
`Page 22
`
`