├── WinAPILib.xojo_resources ├── .gitignore ├── Build Automation.xojo_code ├── UI ├── WinAPI │ ├── WinAPILib.xojo_code │ └── WinAPILib │ │ ├── Screen.xojo_code │ │ ├── AnimateWindow.xojo_code │ │ ├── FileIO.xojo_code │ │ ├── Window.xojo_code │ │ ├── SystemInfo.xojo_code │ │ ├── SelectFolderDialog.xojo_code │ │ ├── OSVersionInfo.xojo_code │ │ └── CommandLink.xojo_code ├── MainMenuBar.xojo_menu ├── Animate_Window.xojo_window ├── SystemInfoWindow.xojo_window ├── ScreenCaptureWindow.xojo_window ├── OSVersionInfoWindow.xojo_window └── MainWindow.xojo_window ├── WinAPILib.obsolete_20251203_154229 ├── WinAPILib.xojo_code.obsolete_20251203_154229.nosync └── WinAPILib.obsolete_20251203_154229.nosync │ ├── Screen.xojo_code.obsolete_20251203_154229.nosync │ ├── AnimateWindow.xojo_code.obsolete_20251203_154229.nosync │ ├── FileIO.xojo_code.obsolete_20251203_154229.nosync │ ├── Window.xojo_code.obsolete_20251203_154229.nosync │ ├── SystemInfo.xojo_code.obsolete_20251203_154229.nosync │ ├── SelectFolderDialog.xojo_code.obsolete_20251203_154229.nosync │ ├── OSVersionInfo.xojo_code.obsolete_20251203_154229.nosync │ └── CommandLink.xojo_code.obsolete_20251203_154229.nosync ├── LICENSE ├── App.xojo_code ├── README.md └── WinAPILib.xojo_project /WinAPILib.xojo_resources: -------------------------------------------------------------------------------- 1 | ICNS -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xojo (formerly REALbasic and Real Studio) 2 | 3 | Builds* 4 | *.debug 5 | *.debug.app 6 | Debug*.exe 7 | Debug*/Debug*.exe 8 | Debug*/Debug*\ Libs 9 | *.rbuistate 10 | *.xojo_uistate 11 | *.obsolete 12 | -------------------------------------------------------------------------------- /Build Automation.xojo_code: -------------------------------------------------------------------------------- 1 | #tag BuildAutomation 2 | Begin BuildStepList Linux 3 | Begin BuildProjectStep Build 4 | End 5 | End 6 | Begin BuildStepList Mac OS X 7 | Begin BuildProjectStep Build 8 | End 9 | End 10 | Begin BuildStepList Windows 11 | Begin BuildProjectStep Build 12 | End 13 | End 14 | #tag EndBuildAutomation 15 | -------------------------------------------------------------------------------- /UI/WinAPI/WinAPILib.xojo_code: -------------------------------------------------------------------------------- 1 | #tag Module 2 | Protected Module WinAPILib 3 | #tag ViewBehavior 4 | #tag ViewProperty 5 | Name="Index" 6 | Visible=true 7 | Group="ID" 8 | InitialValue="-2147483648" 9 | Type="Integer" 10 | EditorType="" 11 | #tag EndViewProperty 12 | #tag ViewProperty 13 | Name="Left" 14 | Visible=true 15 | Group="Position" 16 | InitialValue="0" 17 | Type="Integer" 18 | EditorType="" 19 | #tag EndViewProperty 20 | #tag ViewProperty 21 | Name="Name" 22 | Visible=true 23 | Group="ID" 24 | InitialValue="" 25 | Type="String" 26 | EditorType="" 27 | #tag EndViewProperty 28 | #tag ViewProperty 29 | Name="Super" 30 | Visible=true 31 | Group="ID" 32 | InitialValue="" 33 | Type="String" 34 | EditorType="" 35 | #tag EndViewProperty 36 | #tag ViewProperty 37 | Name="Top" 38 | Visible=true 39 | Group="Position" 40 | InitialValue="0" 41 | Type="Integer" 42 | EditorType="" 43 | #tag EndViewProperty 44 | #tag EndViewBehavior 45 | End Module 46 | #tag EndModule 47 | -------------------------------------------------------------------------------- /WinAPILib.obsolete_20251203_154229/WinAPILib.xojo_code.obsolete_20251203_154229.nosync: -------------------------------------------------------------------------------- 1 | #tag Module 2 | Protected Module WinAPILib 3 | #tag ViewBehavior 4 | #tag ViewProperty 5 | Name="Index" 6 | Visible=true 7 | Group="ID" 8 | InitialValue="-2147483648" 9 | Type="Integer" 10 | EditorType="" 11 | #tag EndViewProperty 12 | #tag ViewProperty 13 | Name="Left" 14 | Visible=true 15 | Group="Position" 16 | InitialValue="0" 17 | Type="Integer" 18 | EditorType="" 19 | #tag EndViewProperty 20 | #tag ViewProperty 21 | Name="Name" 22 | Visible=true 23 | Group="ID" 24 | InitialValue="" 25 | Type="String" 26 | EditorType="" 27 | #tag EndViewProperty 28 | #tag ViewProperty 29 | Name="Super" 30 | Visible=true 31 | Group="ID" 32 | InitialValue="" 33 | Type="String" 34 | EditorType="" 35 | #tag EndViewProperty 36 | #tag ViewProperty 37 | Name="Top" 38 | Visible=true 39 | Group="Position" 40 | InitialValue="0" 41 | Type="Integer" 42 | EditorType="" 43 | #tag EndViewProperty 44 | #tag EndViewBehavior 45 | End Module 46 | #tag EndModule 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Paul Lefebvre 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /App.xojo_code: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class App 3 | Inherits Application 4 | #tag Event 5 | Sub Open() 6 | #If Not TargetWindows Then 7 | MessageBox("WinAPILib only works on Microsoft Windows.") 8 | Quit 9 | #EndIf 10 | End Sub 11 | #tag EndEvent 12 | 13 | 14 | #tag Constant, Name = kEditClear, Type = String, Dynamic = False, Default = \"&Delete", Scope = Public 15 | #Tag Instance, Platform = Windows, Language = Default, Definition = \"&Delete" 16 | #Tag Instance, Platform = Linux, Language = Default, Definition = \"&Delete" 17 | #tag EndConstant 18 | 19 | #tag Constant, Name = kFileQuit, Type = String, Dynamic = False, Default = \"&Quit", Scope = Public 20 | #Tag Instance, Platform = Windows, Language = Default, Definition = \"E&xit" 21 | #tag EndConstant 22 | 23 | #tag Constant, Name = kFileQuitShortcut, Type = String, Dynamic = False, Default = \"", Scope = Public 24 | #Tag Instance, Platform = Mac OS, Language = Default, Definition = \"Cmd+Q" 25 | #Tag Instance, Platform = Linux, Language = Default, Definition = \"Ctrl+Q" 26 | #tag EndConstant 27 | 28 | 29 | #tag ViewBehavior 30 | #tag EndViewBehavior 31 | End Class 32 | #tag EndClass 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WinAPILib 2 | WinAPI Declare Library for use with Xojo. 3 | 4 | ## About ## 5 | WinAPILib is a library of WinAPI (formally Win32) Declares you can add to your Xojo projects to add Windows-specific functionality. 6 | 7 | This project is intended to be both 32-bit and 64-bit compatible and will likely crib many of its Declares from the older (and 32-bit only) Windows Functionality Suite Xojo library (WFS - https://github.com/arbp/WFS). 8 | 9 | ## Usage ## 10 | Click the green "Clone or download" button to download a Zip of the project. You can run the WinAPILib project in Xojo on Windows to see a demonstration of some of its features. 11 | 12 | To use it in your own projects, open the WinLibAPI project and copy the WinAPILib folder to your project. Currently all code resides in the WinAPILib namespace. 13 | 14 | If you are using Xojo 2025 Release 3 or later you can instead download the xojo_library file and use that instead of the source code. 15 | 16 | WinAPILib works with recent versions of Xojo. 17 | 18 | Set a Window to 50% opacity: 19 | 20 | WinAPILib.Window.SetOpacity(Self, 0.50) 21 | 22 | Make a Window always topmost: 23 | 24 | WinAPILib.Window.AlwaysTopmost(Self) = True 25 | 26 | Get the Windows version: 27 | 28 | Var versionInfo As New WinAPILib.OSVersionInfo 29 | MessageBox(versionInfo.Version) 30 | 31 | There is more of course and additional things will be added over time. For now you'll have to read through the WinAPILib namespace to see what is available. 32 | 33 | If you have WinAPI Declares to add, please submit Pull requests. -------------------------------------------------------------------------------- /UI/WinAPI/WinAPILib/Screen.xojo_code: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class Screen 3 | #tag Method, Flags = &h0 4 | Shared Function CaptureRect(x As Integer, y As Integer, width As Integer, height As Integer) As Picture 5 | ' Performs a screen capture on the specified screen rectangle. 6 | #If TargetWindows Then 7 | If Width = 0 Or Height = 0 Then Return Nil 8 | 9 | Declare Function GetDesktopWindow Lib "User32" () As Integer 10 | Declare Function GetDC Lib "User32" (HWND As Integer) As Integer 11 | Declare Function BitBlt Lib "GDI32" (DCdest As Integer, xDest As Integer, yDest As Integer, Width As Integer, _ 12 | Height As Integer, DCdource As Integer, xSource As Integer, ySource As Integer, rasterOp As Integer) As Boolean 13 | Declare Function ReleaseDC Lib "User32" (HWND As Integer, DC As Integer) As Integer 14 | Const SRCCOPY = &h00CC0020 15 | Const CAPTUREBLT = &h40000000 16 | 17 | Var screenCap As Picture = New Picture(width, height, 24) 18 | Var HWND As Integer = GetDesktopWindow() 19 | Var sourceDC As Integer = GetDC(HWND) 20 | Var destDC As Integer = screenCap.Graphics.Handle(screenCap.Graphics.HandleTypeHDC) 21 | Call BitBlt(destDC, 0, 0, width, height, sourceDC, X, Y, SRCCOPY Or CAPTUREBLT) 22 | Call ReleaseDC(HWND, sourceDC) 23 | Return screenCap 24 | #Endif 25 | 26 | End Function 27 | #tag EndMethod 28 | 29 | 30 | #tag ViewBehavior 31 | #tag ViewProperty 32 | Name="Index" 33 | Visible=true 34 | Group="ID" 35 | InitialValue="-2147483648" 36 | Type="Integer" 37 | EditorType="" 38 | #tag EndViewProperty 39 | #tag ViewProperty 40 | Name="Left" 41 | Visible=true 42 | Group="Position" 43 | InitialValue="0" 44 | Type="Integer" 45 | EditorType="" 46 | #tag EndViewProperty 47 | #tag ViewProperty 48 | Name="Name" 49 | Visible=true 50 | Group="ID" 51 | InitialValue="" 52 | Type="String" 53 | EditorType="" 54 | #tag EndViewProperty 55 | #tag ViewProperty 56 | Name="Super" 57 | Visible=true 58 | Group="ID" 59 | InitialValue="" 60 | Type="String" 61 | EditorType="" 62 | #tag EndViewProperty 63 | #tag ViewProperty 64 | Name="Top" 65 | Visible=true 66 | Group="Position" 67 | InitialValue="0" 68 | Type="Integer" 69 | EditorType="" 70 | #tag EndViewProperty 71 | #tag EndViewBehavior 72 | End Class 73 | #tag EndClass 74 | -------------------------------------------------------------------------------- /WinAPILib.obsolete_20251203_154229/WinAPILib.obsolete_20251203_154229.nosync/Screen.xojo_code.obsolete_20251203_154229.nosync: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class Screen 3 | #tag Method, Flags = &h0 4 | Shared Function CaptureRect(x As Integer, y As Integer, width As Integer, height As Integer) As Picture 5 | ' Performs a screen capture on the specified screen rectangle. 6 | #If TargetWindows Then 7 | If Width = 0 Or Height = 0 Then Return Nil 8 | 9 | Declare Function GetDesktopWindow Lib "User32" () As Integer 10 | Declare Function GetDC Lib "User32" (HWND As Integer) As Integer 11 | Declare Function BitBlt Lib "GDI32" (DCdest As Integer, xDest As Integer, yDest As Integer, Width As Integer, _ 12 | Height As Integer, DCdource As Integer, xSource As Integer, ySource As Integer, rasterOp As Integer) As Boolean 13 | Declare Function ReleaseDC Lib "User32" (HWND As Integer, DC As Integer) As Integer 14 | Const SRCCOPY = &h00CC0020 15 | Const CAPTUREBLT = &h40000000 16 | 17 | Var screenCap As Picture = New Picture(width, height, 24) 18 | Var HWND As Integer = GetDesktopWindow() 19 | Var sourceDC As Integer = GetDC(HWND) 20 | Var destDC As Integer = screenCap.Graphics.Handle(screenCap.Graphics.HandleTypeHDC) 21 | Call BitBlt(destDC, 0, 0, width, height, sourceDC, X, Y, SRCCOPY Or CAPTUREBLT) 22 | Call ReleaseDC(HWND, sourceDC) 23 | Return screenCap 24 | #Endif 25 | 26 | End Function 27 | #tag EndMethod 28 | 29 | 30 | #tag ViewBehavior 31 | #tag ViewProperty 32 | Name="Index" 33 | Visible=true 34 | Group="ID" 35 | InitialValue="-2147483648" 36 | Type="Integer" 37 | EditorType="" 38 | #tag EndViewProperty 39 | #tag ViewProperty 40 | Name="Left" 41 | Visible=true 42 | Group="Position" 43 | InitialValue="0" 44 | Type="Integer" 45 | EditorType="" 46 | #tag EndViewProperty 47 | #tag ViewProperty 48 | Name="Name" 49 | Visible=true 50 | Group="ID" 51 | InitialValue="" 52 | Type="String" 53 | EditorType="" 54 | #tag EndViewProperty 55 | #tag ViewProperty 56 | Name="Super" 57 | Visible=true 58 | Group="ID" 59 | InitialValue="" 60 | Type="String" 61 | EditorType="" 62 | #tag EndViewProperty 63 | #tag ViewProperty 64 | Name="Top" 65 | Visible=true 66 | Group="Position" 67 | InitialValue="0" 68 | Type="Integer" 69 | EditorType="" 70 | #tag EndViewProperty 71 | #tag EndViewBehavior 72 | End Class 73 | #tag EndClass 74 | -------------------------------------------------------------------------------- /UI/WinAPI/WinAPILib/AnimateWindow.xojo_code: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class AnimateWindow 3 | #tag Method, Flags = &h0 4 | Shared Function AnimateWindow(windowHwndInt as Ptr, pTimeMsInt as Integer, animationType as Integer) As integer 5 | #If TargetWindows Then 6 | // Enables you to produce special effects when showing or hiding windows 7 | // There are four types of animation: roll, slide, collapse or expand, and alpha-blended fade. 8 | // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-animatewindow 9 | 10 | Declare Function AnimateWindow Lib "User32.dll" (windowHwndInt As Ptr, pTimeMsInt As Integer, animationType as Integer) As Integer 11 | 12 | Return AnimateWindow(windowHwndInt, pTimeMsInt, animationType) 13 | #Endif 14 | End Function 15 | #tag EndMethod 16 | 17 | 18 | #tag Constant, Name = AW_ACTIVATE, Type = Double, Dynamic = False, Default = \"&h00020000", Scope = Public 19 | #tag EndConstant 20 | 21 | #tag Constant, Name = AW_BLEND, Type = Double, Dynamic = False, Default = \"&h00080000", Scope = Public 22 | #tag EndConstant 23 | 24 | #tag Constant, Name = AW_CENTER, Type = Double, Dynamic = False, Default = \"&h00000010", Scope = Public 25 | #tag EndConstant 26 | 27 | #tag Constant, Name = AW_HIDE, Type = Double, Dynamic = False, Default = \"&h00010000", Scope = Public 28 | #tag EndConstant 29 | 30 | #tag Constant, Name = AW_HOR_NEGATIVE, Type = Double, Dynamic = False, Default = \"&h00000002", Scope = Public 31 | #tag EndConstant 32 | 33 | #tag Constant, Name = AW_HOR_POSITIVE, Type = Double, Dynamic = False, Default = \"&h00000001", Scope = Public 34 | #tag EndConstant 35 | 36 | #tag Constant, Name = AW_SLIDE, Type = Double, Dynamic = False, Default = \"&h00040000", Scope = Public 37 | #tag EndConstant 38 | 39 | #tag Constant, Name = AW_VER_NEGATIVE, Type = Double, Dynamic = False, Default = \"&h00000008", Scope = Public 40 | #tag EndConstant 41 | 42 | #tag Constant, Name = AW_VER_POSITIVE, Type = Double, Dynamic = False, Default = \"&h00000004", Scope = Public 43 | #tag EndConstant 44 | 45 | 46 | #tag ViewBehavior 47 | #tag ViewProperty 48 | Name="Name" 49 | Visible=true 50 | Group="ID" 51 | InitialValue="" 52 | Type="String" 53 | EditorType="" 54 | #tag EndViewProperty 55 | #tag ViewProperty 56 | Name="Index" 57 | Visible=true 58 | Group="ID" 59 | InitialValue="-2147483648" 60 | Type="Integer" 61 | EditorType="" 62 | #tag EndViewProperty 63 | #tag ViewProperty 64 | Name="Super" 65 | Visible=true 66 | Group="ID" 67 | InitialValue="" 68 | Type="String" 69 | EditorType="" 70 | #tag EndViewProperty 71 | #tag ViewProperty 72 | Name="Left" 73 | Visible=true 74 | Group="Position" 75 | InitialValue="0" 76 | Type="Integer" 77 | EditorType="" 78 | #tag EndViewProperty 79 | #tag ViewProperty 80 | Name="Top" 81 | Visible=true 82 | Group="Position" 83 | InitialValue="0" 84 | Type="Integer" 85 | EditorType="" 86 | #tag EndViewProperty 87 | #tag EndViewBehavior 88 | End Class 89 | #tag EndClass 90 | -------------------------------------------------------------------------------- /WinAPILib.obsolete_20251203_154229/WinAPILib.obsolete_20251203_154229.nosync/AnimateWindow.xojo_code.obsolete_20251203_154229.nosync: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class AnimateWindow 3 | #tag Method, Flags = &h0 4 | Shared Function AnimateWindow(windowHwndInt as Ptr, pTimeMsInt as Integer, animationType as Integer) As integer 5 | #If TargetWindows Then 6 | // Enables you to produce special effects when showing or hiding windows 7 | // There are four types of animation: roll, slide, collapse or expand, and alpha-blended fade. 8 | // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-animatewindow 9 | 10 | Declare Function AnimateWindow Lib "User32.dll" (windowHwndInt As Ptr, pTimeMsInt As Integer, animationType as Integer) As Integer 11 | 12 | Return AnimateWindow(windowHwndInt, pTimeMsInt, animationType) 13 | #Endif 14 | End Function 15 | #tag EndMethod 16 | 17 | 18 | #tag Constant, Name = AW_ACTIVATE, Type = Double, Dynamic = False, Default = \"&h00020000", Scope = Public 19 | #tag EndConstant 20 | 21 | #tag Constant, Name = AW_BLEND, Type = Double, Dynamic = False, Default = \"&h00080000", Scope = Public 22 | #tag EndConstant 23 | 24 | #tag Constant, Name = AW_CENTER, Type = Double, Dynamic = False, Default = \"&h00000010", Scope = Public 25 | #tag EndConstant 26 | 27 | #tag Constant, Name = AW_HIDE, Type = Double, Dynamic = False, Default = \"&h00010000", Scope = Public 28 | #tag EndConstant 29 | 30 | #tag Constant, Name = AW_HOR_NEGATIVE, Type = Double, Dynamic = False, Default = \"&h00000002", Scope = Public 31 | #tag EndConstant 32 | 33 | #tag Constant, Name = AW_HOR_POSITIVE, Type = Double, Dynamic = False, Default = \"&h00000001", Scope = Public 34 | #tag EndConstant 35 | 36 | #tag Constant, Name = AW_SLIDE, Type = Double, Dynamic = False, Default = \"&h00040000", Scope = Public 37 | #tag EndConstant 38 | 39 | #tag Constant, Name = AW_VER_NEGATIVE, Type = Double, Dynamic = False, Default = \"&h00000008", Scope = Public 40 | #tag EndConstant 41 | 42 | #tag Constant, Name = AW_VER_POSITIVE, Type = Double, Dynamic = False, Default = \"&h00000004", Scope = Public 43 | #tag EndConstant 44 | 45 | 46 | #tag ViewBehavior 47 | #tag ViewProperty 48 | Name="Name" 49 | Visible=true 50 | Group="ID" 51 | InitialValue="" 52 | Type="String" 53 | EditorType="" 54 | #tag EndViewProperty 55 | #tag ViewProperty 56 | Name="Index" 57 | Visible=true 58 | Group="ID" 59 | InitialValue="-2147483648" 60 | Type="Integer" 61 | EditorType="" 62 | #tag EndViewProperty 63 | #tag ViewProperty 64 | Name="Super" 65 | Visible=true 66 | Group="ID" 67 | InitialValue="" 68 | Type="String" 69 | EditorType="" 70 | #tag EndViewProperty 71 | #tag ViewProperty 72 | Name="Left" 73 | Visible=true 74 | Group="Position" 75 | InitialValue="0" 76 | Type="Integer" 77 | EditorType="" 78 | #tag EndViewProperty 79 | #tag ViewProperty 80 | Name="Top" 81 | Visible=true 82 | Group="Position" 83 | InitialValue="0" 84 | Type="Integer" 85 | EditorType="" 86 | #tag EndViewProperty 87 | #tag EndViewBehavior 88 | End Class 89 | #tag EndClass 90 | -------------------------------------------------------------------------------- /WinAPILib.xojo_project: -------------------------------------------------------------------------------- 1 | Type=Desktop 2 | RBProjectVersion=2025.03 3 | MinIDEVersion=20210300 4 | OrigIDEVersion=00000000 5 | Class=App;App.xojo_code;&h000000007AF0BFFF;&h0000000000000000;false 6 | Folder=UI;UI;&h0000000057CCDFFF;&h0000000000000000;false 7 | DesktopWindow=MainWindow;UI/MainWindow.xojo_window;&h000000006228CFFF;&h0000000057CCDFFF;false 8 | DesktopWindow=ScreenCaptureWindow;UI/ScreenCaptureWindow.xojo_window;&h000000000A5E57FF;&h0000000057CCDFFF;false 9 | DesktopWindow=OSVersionInfoWindow;UI/OSVersionInfoWindow.xojo_window;&h00000000476BBFFF;&h0000000057CCDFFF;false 10 | DesktopWindow=SystemInfoWindow;UI/SystemInfoWindow.xojo_window;&h000000006AA54FFF;&h0000000057CCDFFF;false 11 | BuildSteps=Build Automation;Build Automation.xojo_code;&h000000001748A7FF;&h0000000000000000;false 12 | Class=Screen;UI/WinAPI/WinAPILib/Screen.xojo_code;&h00000000046C4FFF;&h000000007F896FFF;false 13 | Class=SystemInfo;UI/WinAPI/WinAPILib/SystemInfo.xojo_code;&h000000003ACD97FF;&h000000007F896FFF;false 14 | Class=SelectFolderDialog;UI/WinAPI/WinAPILib/SelectFolderDialog.xojo_code;&h000000001D0BCFFF;&h000000007F896FFF;false 15 | Class=Window;UI/WinAPI/WinAPILib/Window.xojo_code;&h0000000047EA97FF;&h000000007F896FFF;false 16 | Class=CommandLink;UI/WinAPI/WinAPILib/CommandLink.xojo_code;&h000000005442DFFF;&h000000007F896FFF;false 17 | Class=OSVersionInfo;UI/WinAPI/WinAPILib/OSVersionInfo.xojo_code;&h00000000342057FF;&h000000007F896FFF;false 18 | Class=FileIO;UI/WinAPI/WinAPILib/FileIO.xojo_code;&h000000002546B7FF;&h000000007F896FFF;false 19 | Class=AnimateWindow;UI/WinAPI/WinAPILib/AnimateWindow.xojo_code;&h000000002CA8BFFF;&h000000007F896FFF;false 20 | DesktopWindow=Animate_Window;UI/Animate_Window.xojo_window;&h000000001A141FFF;&h0000000057CCDFFF;false 21 | MenuBar=MainMenuBar;UI/MainMenuBar.xojo_menu;&h000000001CEA87FF;&h0000000057CCDFFF;false 22 | Library=WinAPI;UI/WinAPI;&h000000004800CFFF;&h0000000057CCDFFF;false 23 | Module=WinAPILib;UI/WinAPI/WinAPILib.xojo_code;&h000000007F896FFF;&h000000004800CFFF;false 24 | DefaultWindow=MainWindow 25 | MajorVersion=2 26 | MinorVersion=0 27 | SubVersion=0 28 | NonRelease=0 29 | Release=0 30 | InfoVersion=WinAPI Library for Windows 31 | LongVersion=Open Source 32 | ShortVersion=2.0.0 33 | WinCompanyName=Example 34 | WinInternalName= 35 | WinProductName= 36 | WinFileDescription= 37 | AutoIncrementVersionInformation=False 38 | BuildFlags=&h910 39 | BuildLanguage=&h0 40 | DebugLanguage=&h0 41 | Region= 42 | WindowsName=WinAPILib.exe 43 | MacCarbonMachName=WinAPILib 44 | LinuxX86Name=WinAPILib 45 | MacCreator= 46 | MDI=0 47 | MDICaption= 48 | DefaultEncoding=&h0 49 | AppIcon=WinAPILib.xojo_resources;&h0 50 | OSXBundleID=com.example.winlib 51 | DebuggerCommandLine= 52 | UseGDIPlus=False 53 | UseBuildsFolder=True 54 | HiDPI=True 55 | CopyRedistNextToWindowsEXE=False 56 | IncludePDB=False 57 | WinUIFramework=False 58 | NativeWinUISizes=False 59 | IsWebProject=False 60 | MacBuildArchitecture=1 61 | WindowsBuildArchitecture=1 62 | OptimizationLevel=0 63 | WindowsVersions={35138b9a-5d96-4fbd-8e2d-a2440225f93a}|{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}|{1f676c76-80e1-4239-95bb-83d0f6d0da78}|{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a} 64 | WindowsRunAs=0 65 | MacOSMinimumVersion= 66 | PlistEntries={"root":""} 67 | AppCategory= 68 | AppSpecificPassword= 69 | MacUICompatibilityMode=False 70 | -------------------------------------------------------------------------------- /UI/WinAPI/WinAPILib/FileIO.xojo_code: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class FileIO 3 | #tag Method, Flags = &h0 4 | Shared Sub LaunchAndWait(f As FolderItem, params As String = "", deskName As String = "") 5 | // 64-bit updates thanks to Julian Samphire 6 | // https://forum.xojo.com/45446-wfs-kiosk-mode-64-bit-app-not-working/0#p369184 7 | 8 | // Launch the application and wait for 9 | // it to finish executing before returning. 10 | #If TargetWindows Then 11 | Soft Declare Function CreateProcessW Lib "Kernel32" (appName As WString, params As WString, _ 12 | procAttribs As Integer, threadAttribs As Integer, inheritHandles As Boolean, flags As UInt32, _ 13 | env As Integer, curDir As Integer, startupInfo As Ptr, procInfo As Ptr) As Boolean 14 | 15 | Var startupInfo, procInfo As MemoryBlock 16 | 17 | #If Target64Bit 18 | Const sizeOfPtr = 8 19 | #Else 20 | Const sizeOfPtr = 4 21 | #EndIf 22 | 23 | #If Target64Bit 24 | startupInfo = New MemoryBlock(104) 25 | #Else 26 | startupInfo = New MemoryBlock(68) 27 | #EndIf 28 | 29 | procInfo = New MemoryBlock((2 * sizeOfPtr) + 4 + 4) 30 | 31 | Var deskStr, deskPtr As MemoryBlock 32 | If deskName <> "" Then 33 | deskStr = ConvertEncoding(deskName + Chr(0), Encodings.UTF16) 34 | 35 | startupInfo.Ptr(2 * sizeOfPtr) = deskStr 36 | End If 37 | 38 | Var ret As Boolean 39 | ret = CreateProcessW(f.NativePath, params, 0, 0, False, 0, 0, 0, startupInfo, procInfo) 40 | If Not ret Then Return 41 | 42 | Declare Function WaitForSingleObject Lib "Kernel32" (handle As Integer, howLong As Integer) As Integer 43 | Const INFINITE = -1 44 | Const WAIT_TIMEOUT = &h00000102 45 | Const WAIT_OBJECT_0 = &h0 46 | 47 | // Want to loop here so that app can yield time back 48 | // to other threads. This means threaded applications 49 | // will "just work", but non-threaded ones will still appear hung. 50 | While WaitForSingleObject(procInfo.Long(0), 1) = WAIT_TIMEOUT 51 | App.SleepCurrentThread(10) 52 | Wend 53 | 54 | Declare Sub CloseHandle Lib "Kernel32" (handle As Integer) 55 | CloseHandle(procInfo.Long(0)) 56 | CloseHandle(procInfo.Long(1 * sizeOfPtr)) 57 | 58 | #Else 59 | #Pragma unused f 60 | #Pragma unused params 61 | #Pragma unused deskName 62 | #EndIf 63 | End Sub 64 | #tag EndMethod 65 | 66 | 67 | #tag ViewBehavior 68 | #tag ViewProperty 69 | Name="Index" 70 | Visible=true 71 | Group="ID" 72 | InitialValue="-2147483648" 73 | Type="Integer" 74 | EditorType="" 75 | #tag EndViewProperty 76 | #tag ViewProperty 77 | Name="Left" 78 | Visible=true 79 | Group="Position" 80 | InitialValue="0" 81 | Type="Integer" 82 | EditorType="" 83 | #tag EndViewProperty 84 | #tag ViewProperty 85 | Name="Name" 86 | Visible=true 87 | Group="ID" 88 | InitialValue="" 89 | Type="String" 90 | EditorType="" 91 | #tag EndViewProperty 92 | #tag ViewProperty 93 | Name="Super" 94 | Visible=true 95 | Group="ID" 96 | InitialValue="" 97 | Type="String" 98 | EditorType="" 99 | #tag EndViewProperty 100 | #tag ViewProperty 101 | Name="Top" 102 | Visible=true 103 | Group="Position" 104 | InitialValue="0" 105 | Type="Integer" 106 | EditorType="" 107 | #tag EndViewProperty 108 | #tag EndViewBehavior 109 | End Class 110 | #tag EndClass 111 | -------------------------------------------------------------------------------- /WinAPILib.obsolete_20251203_154229/WinAPILib.obsolete_20251203_154229.nosync/FileIO.xojo_code.obsolete_20251203_154229.nosync: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class FileIO 3 | #tag Method, Flags = &h0 4 | Shared Sub LaunchAndWait(f As FolderItem, params As String = "", deskName As String = "") 5 | // 64-bit updates thanks to Julian Samphire 6 | // https://forum.xojo.com/45446-wfs-kiosk-mode-64-bit-app-not-working/0#p369184 7 | 8 | // Launch the application and wait for 9 | // it to finish executing before returning. 10 | #If TargetWindows Then 11 | Soft Declare Function CreateProcessW Lib "Kernel32" (appName As WString, params As WString, _ 12 | procAttribs As Integer, threadAttribs As Integer, inheritHandles As Boolean, flags As UInt32, _ 13 | env As Integer, curDir As Integer, startupInfo As Ptr, procInfo As Ptr) As Boolean 14 | 15 | Var startupInfo, procInfo As MemoryBlock 16 | 17 | #If Target64Bit 18 | Const sizeOfPtr = 8 19 | #Else 20 | Const sizeOfPtr = 4 21 | #EndIf 22 | 23 | #If Target64Bit 24 | startupInfo = New MemoryBlock(104) 25 | #Else 26 | startupInfo = New MemoryBlock(68) 27 | #EndIf 28 | 29 | procInfo = New MemoryBlock((2 * sizeOfPtr) + 4 + 4) 30 | 31 | Var deskStr, deskPtr As MemoryBlock 32 | If deskName <> "" Then 33 | deskStr = ConvertEncoding(deskName + Chr(0), Encodings.UTF16) 34 | 35 | startupInfo.Ptr(2 * sizeOfPtr) = deskStr 36 | End If 37 | 38 | Var ret As Boolean 39 | ret = CreateProcessW(f.NativePath, params, 0, 0, False, 0, 0, 0, startupInfo, procInfo) 40 | If Not ret Then Return 41 | 42 | Declare Function WaitForSingleObject Lib "Kernel32" (handle As Integer, howLong As Integer) As Integer 43 | Const INFINITE = -1 44 | Const WAIT_TIMEOUT = &h00000102 45 | Const WAIT_OBJECT_0 = &h0 46 | 47 | // Want to loop here so that app can yield time back 48 | // to other threads. This means threaded applications 49 | // will "just work", but non-threaded ones will still appear hung. 50 | While WaitForSingleObject(procInfo.Long(0), 1) = WAIT_TIMEOUT 51 | App.SleepCurrentThread(10) 52 | Wend 53 | 54 | Declare Sub CloseHandle Lib "Kernel32" (handle As Integer) 55 | CloseHandle(procInfo.Long(0)) 56 | CloseHandle(procInfo.Long(1 * sizeOfPtr)) 57 | 58 | #Else 59 | #Pragma unused f 60 | #Pragma unused params 61 | #Pragma unused deskName 62 | #EndIf 63 | End Sub 64 | #tag EndMethod 65 | 66 | 67 | #tag ViewBehavior 68 | #tag ViewProperty 69 | Name="Index" 70 | Visible=true 71 | Group="ID" 72 | InitialValue="-2147483648" 73 | Type="Integer" 74 | EditorType="" 75 | #tag EndViewProperty 76 | #tag ViewProperty 77 | Name="Left" 78 | Visible=true 79 | Group="Position" 80 | InitialValue="0" 81 | Type="Integer" 82 | EditorType="" 83 | #tag EndViewProperty 84 | #tag ViewProperty 85 | Name="Name" 86 | Visible=true 87 | Group="ID" 88 | InitialValue="" 89 | Type="String" 90 | EditorType="" 91 | #tag EndViewProperty 92 | #tag ViewProperty 93 | Name="Super" 94 | Visible=true 95 | Group="ID" 96 | InitialValue="" 97 | Type="String" 98 | EditorType="" 99 | #tag EndViewProperty 100 | #tag ViewProperty 101 | Name="Top" 102 | Visible=true 103 | Group="Position" 104 | InitialValue="0" 105 | Type="Integer" 106 | EditorType="" 107 | #tag EndViewProperty 108 | #tag EndViewBehavior 109 | End Class 110 | #tag EndClass 111 | -------------------------------------------------------------------------------- /UI/MainMenuBar.xojo_menu: -------------------------------------------------------------------------------- 1 | #tag Menu 2 | Begin Menu MainMenuBar 3 | Begin DesktopMenuItem FileMenu 4 | SpecialMenu = 0 5 | Index = -2147483648 6 | Text = "&File" 7 | AutoEnabled = True 8 | AutoEnable = True 9 | Visible = True 10 | Begin DesktopQuitMenuItem FileQuit 11 | SpecialMenu = 0 12 | Index = -2147483648 13 | Text = "#App.kFileQuit" 14 | ShortcutKey = "#App.kFileQuitShortcut" 15 | Shortcut = "#App.kFileQuitShortcut" 16 | AutoEnabled = True 17 | AutoEnable = True 18 | Visible = True 19 | End 20 | End 21 | Begin DesktopMenuItem EditMenu 22 | SpecialMenu = 0 23 | Index = -2147483648 24 | Text = "&Edit" 25 | AutoEnabled = True 26 | AutoEnable = True 27 | Visible = True 28 | Begin DesktopMenuItem EditUndo 29 | SpecialMenu = 0 30 | Index = -2147483648 31 | Text = "&Undo" 32 | ShortcutKey = "Z" 33 | Shortcut = "Cmd+Z" 34 | MenuModifier = True 35 | AutoEnabled = True 36 | AutoEnable = True 37 | Visible = True 38 | End 39 | Begin DesktopMenuItem EditSeparator1 40 | SpecialMenu = 0 41 | Index = -2147483648 42 | Text = "-" 43 | AutoEnabled = True 44 | AutoEnable = True 45 | Visible = True 46 | End 47 | Begin DesktopMenuItem EditCut 48 | SpecialMenu = 0 49 | Index = -2147483648 50 | Text = "Cu&t" 51 | ShortcutKey = "X" 52 | Shortcut = "Cmd+X" 53 | MenuModifier = True 54 | AutoEnabled = True 55 | AutoEnable = True 56 | Visible = True 57 | End 58 | Begin DesktopMenuItem EditCopy 59 | SpecialMenu = 0 60 | Index = -2147483648 61 | Text = "&Copy" 62 | ShortcutKey = "C" 63 | Shortcut = "Cmd+C" 64 | MenuModifier = True 65 | AutoEnabled = True 66 | AutoEnable = True 67 | Visible = True 68 | End 69 | Begin DesktopMenuItem EditPaste 70 | SpecialMenu = 0 71 | Index = -2147483648 72 | Text = "&Paste" 73 | ShortcutKey = "V" 74 | Shortcut = "Cmd+V" 75 | MenuModifier = True 76 | AutoEnabled = True 77 | AutoEnable = True 78 | Visible = True 79 | End 80 | Begin DesktopMenuItem EditClear 81 | SpecialMenu = 0 82 | Index = -2147483648 83 | Text = "#App.kEditClear" 84 | AutoEnabled = True 85 | AutoEnable = True 86 | Visible = True 87 | End 88 | Begin DesktopMenuItem EditSeparator2 89 | SpecialMenu = 0 90 | Index = -2147483648 91 | Text = "-" 92 | AutoEnabled = True 93 | AutoEnable = True 94 | Visible = True 95 | End 96 | Begin DesktopMenuItem EditSelectAll 97 | SpecialMenu = 0 98 | Index = -2147483648 99 | Text = "Select &All" 100 | ShortcutKey = "A" 101 | Shortcut = "Cmd+A" 102 | MenuModifier = True 103 | AutoEnabled = True 104 | AutoEnable = True 105 | Visible = True 106 | End 107 | End 108 | Begin DesktopMenuItem WindowMenu 109 | SpecialMenu = 0 110 | Index = -2147483648 111 | Text = "Window" 112 | AutoEnabled = True 113 | AutoEnable = True 114 | Visible = True 115 | End 116 | Begin DesktopMenuItem HelpMenu 117 | SpecialMenu = 0 118 | Index = -2147483648 119 | Text = "&Help" 120 | AutoEnabled = True 121 | AutoEnable = True 122 | Visible = True 123 | End 124 | End 125 | #tag EndMenu 126 | -------------------------------------------------------------------------------- /UI/WinAPI/WinAPILib/Window.xojo_code: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class Window 3 | #tag Method, Flags = &h0 4 | Shared Function AlwaysTopmost(w As Global.DesktopWindow) As Boolean 5 | Const WS_EX_TOPMOST = &h00000008 6 | Return TestWindowStyleEx(w, WS_EX_TOPMOST) 7 | End Function 8 | #tag EndMethod 9 | 10 | #tag Method, Flags = &h0 11 | Shared Sub AlwaysTopmost(w As Global.DesktopWindow, Assigns topMost As Boolean) 12 | #If TargetWindows Then 13 | Const WS_EX_TOPMOST = &h00000008 14 | ChangeWindowStyleEx(w, WS_EX_TOPMOST, topMost) 15 | 16 | Const SWP_NOSIZE = &H1 17 | Const SWP_NOMOVE = &H2 18 | Const HWND_TOPMOST = -1 19 | Const HWND_NOTOPMOST = -2 20 | 21 | Declare Function SetWindowPos Lib "User32" (hwnd As Ptr, hWndInstertAfter As Integer, _ 22 | x As Integer, y As Integer, cx As Integer, cy As Integer, flags As Integer) As Integer 23 | 24 | Var after As Integer 25 | If topMost Then 26 | after = HWND_TOPMOST 27 | Else 28 | after = HWND_NOTOPMOST 29 | End 30 | Call SetWindowPos(w.Handle, after, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE) 31 | #EndIf 32 | End Sub 33 | #tag EndMethod 34 | 35 | #tag Method, Flags = &h21 36 | Private Shared Sub ChangeWindowStyleEx(w As Global.DesktopWindow, flag As Integer, set As Boolean) 37 | #If TargetWindows Then 38 | Const SWP_NOSIZE = &H1 39 | Const SWP_NOMOVE = &H2 40 | Const SWP_NOZORDER = &H4 41 | Const SWP_FRAMECHANGED = &H20 42 | 43 | Const GWL_EXSTYLE = -20 44 | 45 | Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (hwnd As Ptr, _ 46 | nIndex As Integer) As Integer 47 | Var oldFlags As Integer 48 | oldFlags = GetWindowLong(w.Handle, GWL_EXSTYLE) 49 | 50 | Var newFlags As Integer 51 | If Not set Then 52 | newFlags = BitwiseAnd(oldFlags, Bitwise.OnesComplement(flag)) 53 | Else 54 | newFlags = BitwiseOr(oldFlags, flag) 55 | End If 56 | 57 | Var styleFlags As Integer 58 | Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (hwnd As Ptr, _ 59 | nIndex As Integer, dwNewLong As Integer) As Integer 60 | Declare Function SetWindowPos Lib "User32" (hwnd As Ptr, hWndInstertAfter As Integer, _ 61 | x As Integer, y As Integer, cx As Integer, cy As Integer, flags As Integer) As Integer 62 | styleFlags = SetWindowLong(w.Handle, GWL_EXSTYLE, newFlags) 63 | styleFlags = SetWindowPos(w.Handle, 0, 0, 0, 0, 0, SWP_NOMOVE + _ 64 | SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED) 65 | #EndIf 66 | End Sub 67 | #tag EndMethod 68 | 69 | #tag Method, Flags = &h0 70 | Shared Sub Flash(w As Global.DesktopWindow) 71 | #If TargetWindows Then 72 | Declare Function FlashWindow Lib "User32" (handle As Ptr, invert As Boolean) As Boolean 73 | Call FlashWindow(w.Handle, True) 74 | #EndIf 75 | End Sub 76 | #tag EndMethod 77 | 78 | #tag ExternalMethod, Flags = &h21 79 | Private Soft Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (hwnd As Ptr, nIndex As Integer) As Integer 80 | #tag EndExternalMethod 81 | 82 | #tag ExternalMethod, Flags = &h21 83 | Private Soft Declare Sub SetLayeredWindowAttributes Lib "User32" (hwnd As Ptr, theColor As Integer, bAlpha As Integer, alpha As Integer) 84 | #tag EndExternalMethod 85 | 86 | #tag Method, Flags = &h0 87 | Shared Sub SetOpacity(wind As Global.DesktopWindow, value As Double) 88 | // Sets a window's opacity 89 | #If TargetWindows 90 | Const GWL_EXSTYLE = -20 91 | Const WS_EX_LAYERED = &h80000 92 | Const LWA_ALPHA = 2 93 | 94 | // grab our existing flags 95 | Var existingFlags As Integer = GetWindowLong(wind.Handle, GWL_EXSTYLE) 96 | 97 | // set WS_EX_LAYERED for this window so we can have opacity 98 | existingFlags = SetWindowLong(wind.Handle, GWL_EXSTYLE, existingFlags Or WS_EX_LAYERED) 99 | 100 | // values range from 0-255, so you have to multiply the value times 255 101 | SetLayeredWindowAttributes(wind.Handle, 0, value * 255, LWA_ALPHA) 102 | #EndIf 103 | End Sub 104 | #tag EndMethod 105 | 106 | #tag ExternalMethod, Flags = &h21 107 | Private Soft Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (hwnd As Ptr, nIndex As Integer, value As Integer) As Integer 108 | #tag EndExternalMethod 109 | 110 | #tag Method, Flags = &h21 111 | Private Shared Function TestWindowStyleEx(w As Global.DesktopWindow, flag As Integer) As Boolean 112 | #If TargetWindows Then 113 | Const GWL_EXSTYLE = -20 114 | 115 | Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (hwnd As Integer, _ 116 | nIndex As Integer) As Integer 117 | 118 | Var oldFlags As Integer = GetWindowLong(w.Handle, GWL_EXSTYLE) 119 | 120 | If Bitwise.BitAnd(oldFlags, flag) = flag Then 121 | Return True 122 | Else 123 | Return False 124 | End If 125 | #EndIf 126 | End Function 127 | #tag EndMethod 128 | 129 | 130 | #tag ViewBehavior 131 | #tag ViewProperty 132 | Name="Index" 133 | Visible=true 134 | Group="ID" 135 | InitialValue="-2147483648" 136 | Type="Integer" 137 | EditorType="" 138 | #tag EndViewProperty 139 | #tag ViewProperty 140 | Name="Left" 141 | Visible=true 142 | Group="Position" 143 | InitialValue="0" 144 | Type="Integer" 145 | EditorType="" 146 | #tag EndViewProperty 147 | #tag ViewProperty 148 | Name="Name" 149 | Visible=true 150 | Group="ID" 151 | InitialValue="" 152 | Type="String" 153 | EditorType="" 154 | #tag EndViewProperty 155 | #tag ViewProperty 156 | Name="Super" 157 | Visible=true 158 | Group="ID" 159 | InitialValue="" 160 | Type="String" 161 | EditorType="" 162 | #tag EndViewProperty 163 | #tag ViewProperty 164 | Name="Top" 165 | Visible=true 166 | Group="Position" 167 | InitialValue="0" 168 | Type="Integer" 169 | EditorType="" 170 | #tag EndViewProperty 171 | #tag EndViewBehavior 172 | End Class 173 | #tag EndClass 174 | -------------------------------------------------------------------------------- /WinAPILib.obsolete_20251203_154229/WinAPILib.obsolete_20251203_154229.nosync/Window.xojo_code.obsolete_20251203_154229.nosync: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class Window 3 | #tag Method, Flags = &h0 4 | Shared Function AlwaysTopmost(w As Global.DesktopWindow) As Boolean 5 | Const WS_EX_TOPMOST = &h00000008 6 | Return TestWindowStyleEx(w, WS_EX_TOPMOST) 7 | End Function 8 | #tag EndMethod 9 | 10 | #tag Method, Flags = &h0 11 | Shared Sub AlwaysTopmost(w As Global.DesktopWindow, Assigns topMost As Boolean) 12 | #If TargetWindows Then 13 | Const WS_EX_TOPMOST = &h00000008 14 | ChangeWindowStyleEx(w, WS_EX_TOPMOST, topMost) 15 | 16 | Const SWP_NOSIZE = &H1 17 | Const SWP_NOMOVE = &H2 18 | Const HWND_TOPMOST = -1 19 | Const HWND_NOTOPMOST = -2 20 | 21 | Declare Function SetWindowPos Lib "User32" (hwnd As Ptr, hWndInstertAfter As Integer, _ 22 | x As Integer, y As Integer, cx As Integer, cy As Integer, flags As Integer) As Integer 23 | 24 | Var after As Integer 25 | If topMost Then 26 | after = HWND_TOPMOST 27 | Else 28 | after = HWND_NOTOPMOST 29 | End 30 | Call SetWindowPos(w.Handle, after, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE) 31 | #EndIf 32 | End Sub 33 | #tag EndMethod 34 | 35 | #tag Method, Flags = &h21 36 | Private Shared Sub ChangeWindowStyleEx(w As Global.DesktopWindow, flag As Integer, set As Boolean) 37 | #If TargetWindows Then 38 | Const SWP_NOSIZE = &H1 39 | Const SWP_NOMOVE = &H2 40 | Const SWP_NOZORDER = &H4 41 | Const SWP_FRAMECHANGED = &H20 42 | 43 | Const GWL_EXSTYLE = -20 44 | 45 | Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (hwnd As Ptr, _ 46 | nIndex As Integer) As Integer 47 | Var oldFlags As Integer 48 | oldFlags = GetWindowLong(w.Handle, GWL_EXSTYLE) 49 | 50 | Var newFlags As Integer 51 | If Not set Then 52 | newFlags = BitwiseAnd(oldFlags, Bitwise.OnesComplement(flag)) 53 | Else 54 | newFlags = BitwiseOr(oldFlags, flag) 55 | End If 56 | 57 | Var styleFlags As Integer 58 | Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (hwnd As Ptr, _ 59 | nIndex As Integer, dwNewLong As Integer) As Integer 60 | Declare Function SetWindowPos Lib "User32" (hwnd As Ptr, hWndInstertAfter As Integer, _ 61 | x As Integer, y As Integer, cx As Integer, cy As Integer, flags As Integer) As Integer 62 | styleFlags = SetWindowLong(w.Handle, GWL_EXSTYLE, newFlags) 63 | styleFlags = SetWindowPos(w.Handle, 0, 0, 0, 0, 0, SWP_NOMOVE + _ 64 | SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED) 65 | #EndIf 66 | End Sub 67 | #tag EndMethod 68 | 69 | #tag Method, Flags = &h0 70 | Shared Sub Flash(w As Global.DesktopWindow) 71 | #If TargetWindows Then 72 | Declare Function FlashWindow Lib "User32" (handle As Ptr, invert As Boolean) As Boolean 73 | Call FlashWindow(w.Handle, True) 74 | #EndIf 75 | End Sub 76 | #tag EndMethod 77 | 78 | #tag ExternalMethod, Flags = &h21 79 | Private Soft Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (hwnd As Ptr, nIndex As Integer) As Integer 80 | #tag EndExternalMethod 81 | 82 | #tag ExternalMethod, Flags = &h21 83 | Private Soft Declare Sub SetLayeredWindowAttributes Lib "User32" (hwnd As Ptr, theColor As Integer, bAlpha As Integer, alpha As Integer) 84 | #tag EndExternalMethod 85 | 86 | #tag Method, Flags = &h0 87 | Shared Sub SetOpacity(wind As Global.DesktopWindow, value As Double) 88 | // Sets a window's opacity 89 | #If TargetWindows 90 | Const GWL_EXSTYLE = -20 91 | Const WS_EX_LAYERED = &h80000 92 | Const LWA_ALPHA = 2 93 | 94 | // grab our existing flags 95 | Var existingFlags As Integer = GetWindowLong(wind.Handle, GWL_EXSTYLE) 96 | 97 | // set WS_EX_LAYERED for this window so we can have opacity 98 | existingFlags = SetWindowLong(wind.Handle, GWL_EXSTYLE, existingFlags Or WS_EX_LAYERED) 99 | 100 | // values range from 0-255, so you have to multiply the value times 255 101 | SetLayeredWindowAttributes(wind.Handle, 0, value * 255, LWA_ALPHA) 102 | #EndIf 103 | End Sub 104 | #tag EndMethod 105 | 106 | #tag ExternalMethod, Flags = &h21 107 | Private Soft Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (hwnd As Ptr, nIndex As Integer, value As Integer) As Integer 108 | #tag EndExternalMethod 109 | 110 | #tag Method, Flags = &h21 111 | Private Shared Function TestWindowStyleEx(w As Global.DesktopWindow, flag As Integer) As Boolean 112 | #If TargetWindows Then 113 | Const GWL_EXSTYLE = -20 114 | 115 | Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (hwnd As Integer, _ 116 | nIndex As Integer) As Integer 117 | 118 | Var oldFlags As Integer = GetWindowLong(w.Handle, GWL_EXSTYLE) 119 | 120 | If Bitwise.BitAnd(oldFlags, flag) = flag Then 121 | Return True 122 | Else 123 | Return False 124 | End If 125 | #EndIf 126 | End Function 127 | #tag EndMethod 128 | 129 | 130 | #tag ViewBehavior 131 | #tag ViewProperty 132 | Name="Index" 133 | Visible=true 134 | Group="ID" 135 | InitialValue="-2147483648" 136 | Type="Integer" 137 | EditorType="" 138 | #tag EndViewProperty 139 | #tag ViewProperty 140 | Name="Left" 141 | Visible=true 142 | Group="Position" 143 | InitialValue="0" 144 | Type="Integer" 145 | EditorType="" 146 | #tag EndViewProperty 147 | #tag ViewProperty 148 | Name="Name" 149 | Visible=true 150 | Group="ID" 151 | InitialValue="" 152 | Type="String" 153 | EditorType="" 154 | #tag EndViewProperty 155 | #tag ViewProperty 156 | Name="Super" 157 | Visible=true 158 | Group="ID" 159 | InitialValue="" 160 | Type="String" 161 | EditorType="" 162 | #tag EndViewProperty 163 | #tag ViewProperty 164 | Name="Top" 165 | Visible=true 166 | Group="Position" 167 | InitialValue="0" 168 | Type="Integer" 169 | EditorType="" 170 | #tag EndViewProperty 171 | #tag EndViewBehavior 172 | End Class 173 | #tag EndClass 174 | -------------------------------------------------------------------------------- /UI/Animate_Window.xojo_window: -------------------------------------------------------------------------------- 1 | #tag DesktopWindow 2 | Begin DesktopWindow Animate_Window 3 | Backdrop = 0 4 | BackgroundColor = &cFFFFFF00 5 | Composite = False 6 | DefaultLocation = 2 7 | FullScreen = False 8 | HasBackgroundColor= False 9 | HasCloseButton = True 10 | HasFullScreenButton= False 11 | HasMaximizeButton= False 12 | HasMinimizeButton= False 13 | HasTitleBar = True 14 | Height = 400 15 | ImplicitInstance= False 16 | MacProcID = 0 17 | MaximumHeight = 32000 18 | MaximumWidth = 32000 19 | MenuBar = 0 20 | MenuBarVisible = True 21 | MinimumHeight = 64 22 | MinimumWidth = 64 23 | Resizeable = False 24 | Title = "Window Test" 25 | Type = 0 26 | Visible = True 27 | Width = 600 28 | End 29 | #tag EndDesktopWindow 30 | 31 | #tag WindowCode 32 | #tag Event 33 | Sub Opening() 34 | Self.SetFocus() 35 | End Sub 36 | #tag EndEvent 37 | 38 | 39 | #tag EndWindowCode 40 | 41 | #tag ViewBehavior 42 | #tag ViewProperty 43 | Name="Name" 44 | Visible=true 45 | Group="ID" 46 | InitialValue="" 47 | Type="String" 48 | EditorType="" 49 | #tag EndViewProperty 50 | #tag ViewProperty 51 | Name="Interfaces" 52 | Visible=true 53 | Group="ID" 54 | InitialValue="" 55 | Type="String" 56 | EditorType="" 57 | #tag EndViewProperty 58 | #tag ViewProperty 59 | Name="Super" 60 | Visible=true 61 | Group="ID" 62 | InitialValue="" 63 | Type="String" 64 | EditorType="" 65 | #tag EndViewProperty 66 | #tag ViewProperty 67 | Name="Width" 68 | Visible=true 69 | Group="Size" 70 | InitialValue="600" 71 | Type="Integer" 72 | EditorType="" 73 | #tag EndViewProperty 74 | #tag ViewProperty 75 | Name="Height" 76 | Visible=true 77 | Group="Size" 78 | InitialValue="400" 79 | Type="Integer" 80 | EditorType="" 81 | #tag EndViewProperty 82 | #tag ViewProperty 83 | Name="MinimumWidth" 84 | Visible=true 85 | Group="Size" 86 | InitialValue="64" 87 | Type="Integer" 88 | EditorType="" 89 | #tag EndViewProperty 90 | #tag ViewProperty 91 | Name="MinimumHeight" 92 | Visible=true 93 | Group="Size" 94 | InitialValue="64" 95 | Type="Integer" 96 | EditorType="" 97 | #tag EndViewProperty 98 | #tag ViewProperty 99 | Name="MaximumWidth" 100 | Visible=true 101 | Group="Size" 102 | InitialValue="32000" 103 | Type="Integer" 104 | EditorType="" 105 | #tag EndViewProperty 106 | #tag ViewProperty 107 | Name="MaximumHeight" 108 | Visible=true 109 | Group="Size" 110 | InitialValue="32000" 111 | Type="Integer" 112 | EditorType="" 113 | #tag EndViewProperty 114 | #tag ViewProperty 115 | Name="Type" 116 | Visible=true 117 | Group="Frame" 118 | InitialValue="0" 119 | Type="Types" 120 | EditorType="Enum" 121 | #tag EnumValues 122 | "0 - Document" 123 | "1 - Movable Modal" 124 | "2 - Modal Dialog" 125 | "3 - Floating Window" 126 | "4 - Plain Box" 127 | "5 - Shadowed Box" 128 | "6 - Rounded Window" 129 | "7 - Global Floating Window" 130 | "8 - Sheet Window" 131 | "9 - Metal Window" 132 | "11 - Modeless Dialog" 133 | #tag EndEnumValues 134 | #tag EndViewProperty 135 | #tag ViewProperty 136 | Name="Title" 137 | Visible=true 138 | Group="Frame" 139 | InitialValue="Untitled" 140 | Type="String" 141 | EditorType="" 142 | #tag EndViewProperty 143 | #tag ViewProperty 144 | Name="HasCloseButton" 145 | Visible=true 146 | Group="Frame" 147 | InitialValue="True" 148 | Type="Boolean" 149 | EditorType="" 150 | #tag EndViewProperty 151 | #tag ViewProperty 152 | Name="HasMaximizeButton" 153 | Visible=true 154 | Group="Frame" 155 | InitialValue="True" 156 | Type="Boolean" 157 | EditorType="" 158 | #tag EndViewProperty 159 | #tag ViewProperty 160 | Name="HasMinimizeButton" 161 | Visible=true 162 | Group="Frame" 163 | InitialValue="True" 164 | Type="Boolean" 165 | EditorType="" 166 | #tag EndViewProperty 167 | #tag ViewProperty 168 | Name="HasFullScreenButton" 169 | Visible=true 170 | Group="Frame" 171 | InitialValue="False" 172 | Type="Boolean" 173 | EditorType="" 174 | #tag EndViewProperty 175 | #tag ViewProperty 176 | Name="Resizeable" 177 | Visible=true 178 | Group="Frame" 179 | InitialValue="True" 180 | Type="Boolean" 181 | EditorType="" 182 | #tag EndViewProperty 183 | #tag ViewProperty 184 | Name="Composite" 185 | Visible=false 186 | Group="OS X (Carbon)" 187 | InitialValue="False" 188 | Type="Boolean" 189 | EditorType="" 190 | #tag EndViewProperty 191 | #tag ViewProperty 192 | Name="MacProcID" 193 | Visible=false 194 | Group="OS X (Carbon)" 195 | InitialValue="0" 196 | Type="Integer" 197 | EditorType="" 198 | #tag EndViewProperty 199 | #tag ViewProperty 200 | Name="FullScreen" 201 | Visible=false 202 | Group="Behavior" 203 | InitialValue="False" 204 | Type="Boolean" 205 | EditorType="" 206 | #tag EndViewProperty 207 | #tag ViewProperty 208 | Name="ImplicitInstance" 209 | Visible=true 210 | Group="Behavior" 211 | InitialValue="True" 212 | Type="Boolean" 213 | EditorType="" 214 | #tag EndViewProperty 215 | #tag ViewProperty 216 | Name="DefaultLocation" 217 | Visible=true 218 | Group="Behavior" 219 | InitialValue="0" 220 | Type="Locations" 221 | EditorType="Enum" 222 | #tag EnumValues 223 | "0 - Default" 224 | "1 - Parent Window" 225 | "2 - Main Screen" 226 | "3 - Parent Window Screen" 227 | "4 - Stagger" 228 | #tag EndEnumValues 229 | #tag EndViewProperty 230 | #tag ViewProperty 231 | Name="Visible" 232 | Visible=true 233 | Group="Behavior" 234 | InitialValue="True" 235 | Type="Boolean" 236 | EditorType="" 237 | #tag EndViewProperty 238 | #tag ViewProperty 239 | Name="HasBackgroundColor" 240 | Visible=true 241 | Group="Background" 242 | InitialValue="False" 243 | Type="Boolean" 244 | EditorType="" 245 | #tag EndViewProperty 246 | #tag ViewProperty 247 | Name="BackgroundColor" 248 | Visible=true 249 | Group="Background" 250 | InitialValue="&hFFFFFF" 251 | Type="Color" 252 | EditorType="Color" 253 | #tag EndViewProperty 254 | #tag ViewProperty 255 | Name="Backdrop" 256 | Visible=true 257 | Group="Background" 258 | InitialValue="" 259 | Type="Picture" 260 | EditorType="" 261 | #tag EndViewProperty 262 | #tag ViewProperty 263 | Name="MenuBar" 264 | Visible=true 265 | Group="Menus" 266 | InitialValue="" 267 | Type="MenuBar" 268 | EditorType="" 269 | #tag EndViewProperty 270 | #tag ViewProperty 271 | Name="MenuBarVisible" 272 | Visible=true 273 | Group="Deprecated" 274 | InitialValue="True" 275 | Type="Boolean" 276 | EditorType="" 277 | #tag EndViewProperty 278 | #tag EndViewBehavior 279 | -------------------------------------------------------------------------------- /UI/WinAPI/WinAPILib/SystemInfo.xojo_code: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class SystemInfo 3 | #tag Method, Flags = &h0 4 | Shared Function ComputerName() As String 5 | #If TargetWindows Then 6 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724295(v=vs.85).aspx 7 | 8 | Soft Declare Sub GetComputerNameW Lib "Kernel32" (name As Ptr, ByRef size As Integer) 9 | 10 | Var mb As New MemoryBlock(1024) 11 | Var size As Integer = mb.Size 12 | 13 | If System.IsFunctionAvailable("GetComputerNameW", "Kernel32") Then 14 | GetComputerNameW(mb, size) 15 | 16 | Return mb.WString(0) 17 | End If 18 | #EndIf 19 | 20 | End Function 21 | #tag EndMethod 22 | 23 | #tag Method, Flags = &h0 24 | Shared Function CPUUsage() As Integer 25 | #If TargetWindows Then 26 | Static lastIdleTime, lastKernelTime, lastUserTime As UInt64 27 | Var idleTime, kernelTime, userTime As UInt64 28 | 29 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724400(v=vs.85).aspx 30 | 31 | Soft Declare Sub GetSystemTimes Lib "Kernel32" (ByRef IdleTime As UInt64, ByRef KernelTime As UInt64, ByRef UserTime As UInt64) 32 | GetSystemTimes(idleTime, kernelTime, userTime) 33 | 34 | Var user, sys, kernal, idle As UInt64 35 | Var cpu As Integer 36 | 37 | user = userTime - lastUserTime 38 | kernal = kernelTime - lastKernelTime 39 | idle = idleTime - lastIdleTime 40 | sys = kernal + user 41 | 42 | cpu = (sys - idle) * 100 / sys 43 | 44 | lastIdleTime = idleTime 45 | lastKernelTime = kernelTime 46 | lastUserTime = userTime 47 | 48 | Return cpu 49 | #EndIf 50 | End Function 51 | #tag EndMethod 52 | 53 | #tag Method, Flags = &h0 54 | Shared Function DefaultPrinter() As String 55 | #If TargetWindows Then 56 | // https://msdn.microsoft.com/en-us/library/windows/desktop/dd144876(v=vs.85).aspx 57 | 58 | Soft Declare Function GetDefaultPrinterW Lib "WinSpool.drv" (buffer As Ptr, ByRef size As Integer) As Boolean 59 | Declare Function GetLastError Lib "Kernel32" () As Integer 60 | // Awesome, let's call it to see how much space we need to allocate 61 | Const ERROR_INSUFFICIENT_BUFFER = 122 62 | Const ERROR_FILE_NOT_FOUND = 2 63 | 64 | Var numCharacters As Integer 65 | Call GetDefaultPrinterW(Nil, numCharacters) 66 | Select Case GetLastError 67 | Case ERROR_INSUFFICIENT_BUFFER 68 | // Now we know how many characters to allocate so we can continue on 69 | Var buffSize As Integer = 2 70 | #If Target64Bit Then 71 | buffSize = 4 72 | #Endif 73 | Var mb As New MemoryBlock(numCharacters * buffSize) 74 | If GetDefaultPrinterW(mb, numCharacters) Then 75 | Return mb.WString(0) 76 | End If 77 | Case ERROR_FILE_NOT_FOUND 78 | // No default printer 79 | Return "" 80 | End Select 81 | #EndIf 82 | End Function 83 | #tag EndMethod 84 | 85 | #tag Method, Flags = &h0 86 | Shared Function DoubleClickTime() As Integer 87 | #If TargetWindows Then 88 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms646258(v=vs.85).aspx 89 | 90 | Declare Function GetDoubleClickTime Lib "User32" () As Integer 91 | 92 | Return GetDoubleClickTime 93 | #EndIf 94 | End Function 95 | #tag EndMethod 96 | 97 | #tag Method, Flags = &h0 98 | Shared Function HostName() As String 99 | #If TargetWindows Then 100 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms738527(v=vs.85).aspx 101 | 102 | Declare Function gethostname Lib "ws2_32" (name As Ptr, size As Integer) As Integer 103 | 104 | Var mb As New MemoryBlock(256) 105 | If gethostname(mb, mb.Size) = 0 Then 106 | Return mb.CString(0) 107 | End 108 | 109 | Return "" 110 | #EndIf 111 | End Function 112 | #tag EndMethod 113 | 114 | #tag Method, Flags = &h0 115 | Shared Function LoggedInUserName() As Text 116 | #If TargetWindows Then 117 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724432(v=vs.85).aspx 118 | 119 | Soft Declare Sub GetUserNameW Lib "AdvApi32" (lpBuffer As Ptr, ByRef nSize As Integer) 120 | 121 | Var mb As New MemoryBlock(256) 122 | Var size As Integer = mb.Size 123 | 124 | GetUserNameW(mb, size) 125 | 126 | Var s As String = ConvertEncoding(mb.WString(0), Encodings.UTF8) 127 | Return s.ToText 128 | #EndIf 129 | 130 | End Function 131 | #tag EndMethod 132 | 133 | #tag Method, Flags = &h0 134 | Shared Function NumberOfProcessors() As Integer 135 | #If TargetWindows Then 136 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724381(v=vs.85).aspx 137 | 138 | Declare Sub GetSystemInfo Lib "Kernel32" (ByRef info As SYSTEM_INFO) 139 | 140 | Var info As SYSTEM_INFO 141 | GetSystemInfo(info) 142 | 143 | Return info.dwNumberOfProcessors 144 | // This seems to be returning 0 when built as 64-bit 145 | #EndIf 146 | End Function 147 | #tag EndMethod 148 | 149 | #tag Method, Flags = &h0 150 | Shared Function ProcessID() As Integer 151 | #If TargetWindows Then 152 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms683215(v=vs.85).aspx 153 | 154 | Soft Declare Function GetProcessID Lib "Kernel32" Alias "GetCurrentProcessId" As Integer 155 | Return GetProcessID 156 | #EndIf 157 | End Function 158 | #tag EndMethod 159 | 160 | 161 | #tag Structure, Name = SYSTEM_INFO, Flags = &h0 162 | wProcessorArchitecture As UInt16 163 | wReserved As UInt16 164 | dwPageSize As UInt32 165 | lpMinimumApplicationAddress As Ptr 166 | lpMaximumApplicationAddress As Ptr 167 | dwActiveProcessorMask As UInteger 168 | dwNumberOfProcessors As UInt32 169 | dwProcessorType As UInt32 170 | dwAllocationGranularity As UInt32 171 | wProcessorLevel As UInt16 172 | wProcessorRevision As UInt16 173 | #tag EndStructure 174 | 175 | 176 | #tag ViewBehavior 177 | #tag ViewProperty 178 | Name="Index" 179 | Visible=true 180 | Group="ID" 181 | InitialValue="-2147483648" 182 | Type="Integer" 183 | EditorType="" 184 | #tag EndViewProperty 185 | #tag ViewProperty 186 | Name="Left" 187 | Visible=true 188 | Group="Position" 189 | InitialValue="0" 190 | Type="Integer" 191 | EditorType="" 192 | #tag EndViewProperty 193 | #tag ViewProperty 194 | Name="Name" 195 | Visible=true 196 | Group="ID" 197 | InitialValue="" 198 | Type="String" 199 | EditorType="" 200 | #tag EndViewProperty 201 | #tag ViewProperty 202 | Name="Super" 203 | Visible=true 204 | Group="ID" 205 | InitialValue="" 206 | Type="String" 207 | EditorType="" 208 | #tag EndViewProperty 209 | #tag ViewProperty 210 | Name="Top" 211 | Visible=true 212 | Group="Position" 213 | InitialValue="0" 214 | Type="Integer" 215 | EditorType="" 216 | #tag EndViewProperty 217 | #tag EndViewBehavior 218 | End Class 219 | #tag EndClass 220 | -------------------------------------------------------------------------------- /WinAPILib.obsolete_20251203_154229/WinAPILib.obsolete_20251203_154229.nosync/SystemInfo.xojo_code.obsolete_20251203_154229.nosync: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class SystemInfo 3 | #tag Method, Flags = &h0 4 | Shared Function ComputerName() As String 5 | #If TargetWindows Then 6 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724295(v=vs.85).aspx 7 | 8 | Soft Declare Sub GetComputerNameW Lib "Kernel32" (name As Ptr, ByRef size As Integer) 9 | 10 | Var mb As New MemoryBlock(1024) 11 | Var size As Integer = mb.Size 12 | 13 | If System.IsFunctionAvailable("GetComputerNameW", "Kernel32") Then 14 | GetComputerNameW(mb, size) 15 | 16 | Return mb.WString(0) 17 | End If 18 | #EndIf 19 | 20 | End Function 21 | #tag EndMethod 22 | 23 | #tag Method, Flags = &h0 24 | Shared Function CPUUsage() As Integer 25 | #If TargetWindows Then 26 | Static lastIdleTime, lastKernelTime, lastUserTime As UInt64 27 | Var idleTime, kernelTime, userTime As UInt64 28 | 29 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724400(v=vs.85).aspx 30 | 31 | Soft Declare Sub GetSystemTimes Lib "Kernel32" (ByRef IdleTime As UInt64, ByRef KernelTime As UInt64, ByRef UserTime As UInt64) 32 | GetSystemTimes(idleTime, kernelTime, userTime) 33 | 34 | Var user, sys, kernal, idle As UInt64 35 | Var cpu As Integer 36 | 37 | user = userTime - lastUserTime 38 | kernal = kernelTime - lastKernelTime 39 | idle = idleTime - lastIdleTime 40 | sys = kernal + user 41 | 42 | cpu = (sys - idle) * 100 / sys 43 | 44 | lastIdleTime = idleTime 45 | lastKernelTime = kernelTime 46 | lastUserTime = userTime 47 | 48 | Return cpu 49 | #EndIf 50 | End Function 51 | #tag EndMethod 52 | 53 | #tag Method, Flags = &h0 54 | Shared Function DefaultPrinter() As String 55 | #If TargetWindows Then 56 | // https://msdn.microsoft.com/en-us/library/windows/desktop/dd144876(v=vs.85).aspx 57 | 58 | Soft Declare Function GetDefaultPrinterW Lib "WinSpool.drv" (buffer As Ptr, ByRef size As Integer) As Boolean 59 | Declare Function GetLastError Lib "Kernel32" () As Integer 60 | // Awesome, let's call it to see how much space we need to allocate 61 | Const ERROR_INSUFFICIENT_BUFFER = 122 62 | Const ERROR_FILE_NOT_FOUND = 2 63 | 64 | Var numCharacters As Integer 65 | Call GetDefaultPrinterW(Nil, numCharacters) 66 | Select Case GetLastError 67 | Case ERROR_INSUFFICIENT_BUFFER 68 | // Now we know how many characters to allocate so we can continue on 69 | Var buffSize As Integer = 2 70 | #If Target64Bit Then 71 | buffSize = 4 72 | #Endif 73 | Var mb As New MemoryBlock(numCharacters * buffSize) 74 | If GetDefaultPrinterW(mb, numCharacters) Then 75 | Return mb.WString(0) 76 | End If 77 | Case ERROR_FILE_NOT_FOUND 78 | // No default printer 79 | Return "" 80 | End Select 81 | #EndIf 82 | End Function 83 | #tag EndMethod 84 | 85 | #tag Method, Flags = &h0 86 | Shared Function DoubleClickTime() As Integer 87 | #If TargetWindows Then 88 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms646258(v=vs.85).aspx 89 | 90 | Declare Function GetDoubleClickTime Lib "User32" () As Integer 91 | 92 | Return GetDoubleClickTime 93 | #EndIf 94 | End Function 95 | #tag EndMethod 96 | 97 | #tag Method, Flags = &h0 98 | Shared Function HostName() As String 99 | #If TargetWindows Then 100 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms738527(v=vs.85).aspx 101 | 102 | Declare Function gethostname Lib "ws2_32" (name As Ptr, size As Integer) As Integer 103 | 104 | Var mb As New MemoryBlock(256) 105 | If gethostname(mb, mb.Size) = 0 Then 106 | Return mb.CString(0) 107 | End 108 | 109 | Return "" 110 | #EndIf 111 | End Function 112 | #tag EndMethod 113 | 114 | #tag Method, Flags = &h0 115 | Shared Function LoggedInUserName() As Text 116 | #If TargetWindows Then 117 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724432(v=vs.85).aspx 118 | 119 | Soft Declare Sub GetUserNameW Lib "AdvApi32" (lpBuffer As Ptr, ByRef nSize As Integer) 120 | 121 | Var mb As New MemoryBlock(256) 122 | Var size As Integer = mb.Size 123 | 124 | GetUserNameW(mb, size) 125 | 126 | Var s As String = ConvertEncoding(mb.WString(0), Encodings.UTF8) 127 | Return s.ToText 128 | #EndIf 129 | 130 | End Function 131 | #tag EndMethod 132 | 133 | #tag Method, Flags = &h0 134 | Shared Function NumberOfProcessors() As Integer 135 | #If TargetWindows Then 136 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724381(v=vs.85).aspx 137 | 138 | Declare Sub GetSystemInfo Lib "Kernel32" (ByRef info As SYSTEM_INFO) 139 | 140 | Var info As SYSTEM_INFO 141 | GetSystemInfo(info) 142 | 143 | Return info.dwNumberOfProcessors 144 | // This seems to be returning 0 when built as 64-bit 145 | #EndIf 146 | End Function 147 | #tag EndMethod 148 | 149 | #tag Method, Flags = &h0 150 | Shared Function ProcessID() As Integer 151 | #If TargetWindows Then 152 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms683215(v=vs.85).aspx 153 | 154 | Soft Declare Function GetProcessID Lib "Kernel32" Alias "GetCurrentProcessId" As Integer 155 | Return GetProcessID 156 | #EndIf 157 | End Function 158 | #tag EndMethod 159 | 160 | 161 | #tag Structure, Name = SYSTEM_INFO, Flags = &h0 162 | wProcessorArchitecture As UInt16 163 | wReserved As UInt16 164 | dwPageSize As UInt32 165 | lpMinimumApplicationAddress As Ptr 166 | lpMaximumApplicationAddress As Ptr 167 | dwActiveProcessorMask As UInteger 168 | dwNumberOfProcessors As UInt32 169 | dwProcessorType As UInt32 170 | dwAllocationGranularity As UInt32 171 | wProcessorLevel As UInt16 172 | wProcessorRevision As UInt16 173 | #tag EndStructure 174 | 175 | 176 | #tag ViewBehavior 177 | #tag ViewProperty 178 | Name="Index" 179 | Visible=true 180 | Group="ID" 181 | InitialValue="-2147483648" 182 | Type="Integer" 183 | EditorType="" 184 | #tag EndViewProperty 185 | #tag ViewProperty 186 | Name="Left" 187 | Visible=true 188 | Group="Position" 189 | InitialValue="0" 190 | Type="Integer" 191 | EditorType="" 192 | #tag EndViewProperty 193 | #tag ViewProperty 194 | Name="Name" 195 | Visible=true 196 | Group="ID" 197 | InitialValue="" 198 | Type="String" 199 | EditorType="" 200 | #tag EndViewProperty 201 | #tag ViewProperty 202 | Name="Super" 203 | Visible=true 204 | Group="ID" 205 | InitialValue="" 206 | Type="String" 207 | EditorType="" 208 | #tag EndViewProperty 209 | #tag ViewProperty 210 | Name="Top" 211 | Visible=true 212 | Group="Position" 213 | InitialValue="0" 214 | Type="Integer" 215 | EditorType="" 216 | #tag EndViewProperty 217 | #tag EndViewBehavior 218 | End Class 219 | #tag EndClass 220 | -------------------------------------------------------------------------------- /UI/WinAPI/WinAPILib/SelectFolderDialog.xojo_code: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class SelectFolderDialog 3 | #tag Method, Flags = &h0 4 | Shared Function SelectFolder(title as string, root as WinApiLib.SelectFolderDialog.RootFolders=WinApiLib.SelectFolderDialog.RootFolders.CSIDL_DESKTOP, flags as Integer=0) As FolderItem 5 | #If TargetWindows 6 | Declare Function SHBrowseForFolderA Lib "Shell32"(ByRef info As BROWSEINFOA) As Ptr 7 | Declare Function SHGetPathFromIDListA Lib "Shell32"(list As Ptr, path As Ptr) As Boolean 8 | 9 | Var info As BROWSEINFOA 10 | info.title = title 11 | Var rootEnumInt As UInt32 = CType(root, UInt32) 12 | info.root = rootEnumInt 13 | info.Flags = Flags 14 | Var displayNameMB As New MemoryBlock(260) 15 | Var pathMB As New MemoryBlock(260) 16 | info.displayName = displayNameMB 17 | Var idList As Ptr = SHBrowseForFolderA(info) 18 | If idList <> Nil Then 19 | If SHGetPathFromIDListA(idList, pathMB) Then 20 | Var path As CString = pathMB.CString(0) 21 | Var f As New FolderItem(path, FolderItem.PathTypeNative) 22 | Return f 23 | End If 24 | End If 25 | #EndIf 26 | End Function 27 | #tag EndMethod 28 | 29 | #tag Method, Flags = &h0 30 | Function ShowModal() As FolderItem 31 | Var flags As Integer 32 | If ShowEditBox Then flags = kBIF_EDITBOX 33 | result=SelectFolder(PromptText, InitialDirectory, flags) 34 | Return Result 35 | End Function 36 | #tag EndMethod 37 | 38 | 39 | #tag Property, Flags = &h0 40 | InitialDirectory As SelectFolderDialog.RootFolders 41 | #tag EndProperty 42 | 43 | #tag Property, Flags = &h0 44 | PromptText As String 45 | #tag EndProperty 46 | 47 | #tag Property, Flags = &h0 48 | Result As FolderItem 49 | #tag EndProperty 50 | 51 | #tag Property, Flags = &h0 52 | ShowEditBox As Boolean 53 | #tag EndProperty 54 | 55 | 56 | #tag Constant, Name = kBIF_EDITBOX, Type = Double, Dynamic = False, Default = \"&h00000010", Scope = Public 57 | #tag EndConstant 58 | 59 | 60 | #tag Structure, Name = BROWSEINFOA, Flags = &h21, Attributes = \"StructureAlignment \x3D 1" 61 | Owner as ptr 62 | root as int32 63 | displayName as ptr 64 | Title as cstring 65 | Flags as uint32 66 | fn as ptr 67 | image as int32 68 | #tag EndStructure 69 | 70 | 71 | #tag Enum, Name = RootFolders, Type = Integer, Flags = &h0 72 | CSIDL_DESKTOP = &h00000 // 73 | CSIDL_INTERNET = &h00001 // Internet Explorer (icon on desktop) 74 | CSIDL_PROGRAMS = &h00002 // Start Menu\Programs 75 | CSIDL_CONTROLS = &h00003 // My Computer\Control Panel 76 | CSIDL_PRINTERS = &h00004 // My Computer\Printers 77 | CSIDL_PERSONAL = &h00005 // My Documents 78 | CSIDL_FAVORITES = &h00006 // \Favorites 79 | CSIDL_STARTUP = &h00007 // Start Menu\Programs\Startup 80 | CSIDL_RECENT = &h00008 // \Recent 81 | CSIDL_SENDTO = &h00009 // \SendTo 82 | CSIDL_BITBUCKET = &h0000a // \Recycle Bin 83 | CSIDL_STARTMENU = &h0000b // \Start Menu 84 | CSIDL_MYDOCUMENTS = CSIDL_PERSONAL // Personal was just a silly name for My Documents 85 | CSIDL_MYMUSIC = &h0000d // "My Music" folder 86 | CSIDL_MYVIDEO = &h0000e // "My Videos" folder 87 | CSIDL_DESKTOPDIRECTORY = &h00010 // \Desktop 88 | CSIDL_DRIVES = &h00011 // My Computer 89 | CSIDL_NETWORK = &h00012 // Network Neighborhood (My Network Places) 90 | CSIDL_NETHOOD = &h00013 // \nethood 91 | CSIDL_FONTS = &h00014 // windows\fonts 92 | CSIDL_TEMPLATES = &h00015 93 | CSIDL_COMMON_STARTMENU = &h00016 // All Users\Start Menu 94 | CSIDL_COMMON_PROGRAMS = &h00017 // All Users\Start Menu\Programs 95 | CSIDL_COMMON_STARTUP = &h00018 // All Users\Startup 96 | CSIDL_COMMON_DESKTOPDIRECTORY = &h00019 // All Users\Desktop 97 | CSIDL_APPDATA = &h0001a // \Application Data 98 | CSIDL_PRINTHOOD = &h0001b // \PrintHood 99 | CSIDL_LOCAL_APPDATA = &h0001c // \Local Settings\Applicaiton Data (non roaming) 100 | CSIDL_ALTSTARTUP = &h0001d // non localized startup 101 | CSIDL_COMMON_ALTSTARTUP = &h0001e // non localized common startup 102 | CSIDL_COMMON_FAVORITES = &h0001f 103 | CSIDL_INTERNET_CACHE = &h00020 104 | CSIDL_COOKIES = &h00021 105 | CSIDL_HISTORY = &h00022 106 | CSIDL_COMMON_APPDATA = &h00023 // All Users\Application Data 107 | CSIDL_WINDOWS = &h00024 // GetWindowsDirectory() 108 | CSIDL_SYSTEM = &h00025 // GetSystemDirectory() 109 | CSIDL_PROGRAM_FILES = &h00026 // C:\Program Files 110 | CSIDL_MYPICTURES = &h00027 // C:\Program Files\My Pictures 111 | CSIDL_PROFILE = &h00028 // USERPROFILE 112 | CSIDL_SYSTEMX86 = &h00029 // x86 system directory on RISC 113 | CSIDL_PROGRAM_FILESX86 = &h0002a // x86 C:\Program Files on RISC 114 | CSIDL_PROGRAM_FILES_COMMON = &h0002b // C:\Program Files\Common 115 | CSIDL_PROGRAM_FILES_COMMONX86 = &h0002c // x86 Program Files\Common on RISC 116 | CSIDL_COMMON_TEMPLATES = &h0002d // All Users\Templates 117 | CSIDL_COMMON_DOCUMENTS = &h0002e // All Users\Documents 118 | CSIDL_COMMON_ADMINTOOLS = &h0002f // All Users\Start Menu\Programs\Administrative Tools 119 | CSIDL_ADMINTOOLS = &h00030 // \Start Menu\Programs\Administrative Tools 120 | CSIDL_CONNECTIONS = &h00031 // Network and Dial-up Connections 121 | CSIDL_COMMON_MUSIC = &h00035 // All Users\My Music 122 | CSIDL_COMMON_PICTURES = &h00036 // All Users\My Pictures 123 | CSIDL_COMMON_VIDEO = &h00037 // All Users\My Video 124 | CSIDL_RESOURCES = &h00038 // Resource Direcotry 125 | CSIDL_RESOURCES_LOCALIZED = &h00039 // Localized Resource Direcotry 126 | CSIDL_COMMON_OEM_LINKS = &h0003a // Links to All Users OEM specific apps 127 | CSIDL_CDBURN_AREA = &h0003b // USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning 128 | CSIDL_COMPUTERSNEARME = &h0003d // Computers Near Me (computered from Workgroup membership) 129 | #tag EndEnum 130 | 131 | 132 | #tag ViewBehavior 133 | #tag ViewProperty 134 | Name="Index" 135 | Visible=true 136 | Group="ID" 137 | InitialValue="-2147483648" 138 | Type="Integer" 139 | EditorType="" 140 | #tag EndViewProperty 141 | #tag ViewProperty 142 | Name="Left" 143 | Visible=true 144 | Group="Position" 145 | InitialValue="0" 146 | Type="Integer" 147 | EditorType="" 148 | #tag EndViewProperty 149 | #tag ViewProperty 150 | Name="Name" 151 | Visible=true 152 | Group="ID" 153 | InitialValue="" 154 | Type="String" 155 | EditorType="" 156 | #tag EndViewProperty 157 | #tag ViewProperty 158 | Name="Super" 159 | Visible=true 160 | Group="ID" 161 | InitialValue="" 162 | Type="String" 163 | EditorType="" 164 | #tag EndViewProperty 165 | #tag ViewProperty 166 | Name="Top" 167 | Visible=true 168 | Group="Position" 169 | InitialValue="0" 170 | Type="Integer" 171 | EditorType="" 172 | #tag EndViewProperty 173 | #tag ViewProperty 174 | Name="PromptText" 175 | Visible=false 176 | Group="Behavior" 177 | InitialValue="" 178 | Type="String" 179 | EditorType="MultiLineEditor" 180 | #tag EndViewProperty 181 | #tag ViewProperty 182 | Name="ShowEditBox" 183 | Visible=false 184 | Group="Behavior" 185 | InitialValue="" 186 | Type="Boolean" 187 | EditorType="" 188 | #tag EndViewProperty 189 | #tag EndViewBehavior 190 | End Class 191 | #tag EndClass 192 | -------------------------------------------------------------------------------- /WinAPILib.obsolete_20251203_154229/WinAPILib.obsolete_20251203_154229.nosync/SelectFolderDialog.xojo_code.obsolete_20251203_154229.nosync: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class SelectFolderDialog 3 | #tag Method, Flags = &h0 4 | Shared Function SelectFolder(title as string, root as WinApiLib.SelectFolderDialog.RootFolders=WinApiLib.SelectFolderDialog.RootFolders.CSIDL_DESKTOP, flags as Integer=0) As FolderItem 5 | #If TargetWindows 6 | Declare Function SHBrowseForFolderA Lib "Shell32"(ByRef info As BROWSEINFOA) As Ptr 7 | Declare Function SHGetPathFromIDListA Lib "Shell32"(list As Ptr, path As Ptr) As Boolean 8 | 9 | Var info As BROWSEINFOA 10 | info.title = title 11 | Var rootEnumInt As UInt32 = CType(root, UInt32) 12 | info.root = rootEnumInt 13 | info.Flags = Flags 14 | Var displayNameMB As New MemoryBlock(260) 15 | Var pathMB As New MemoryBlock(260) 16 | info.displayName = displayNameMB 17 | Var idList As Ptr = SHBrowseForFolderA(info) 18 | If idList <> Nil Then 19 | If SHGetPathFromIDListA(idList, pathMB) Then 20 | Var path As CString = pathMB.CString(0) 21 | Var f As New FolderItem(path, FolderItem.PathTypeNative) 22 | Return f 23 | End If 24 | End If 25 | #EndIf 26 | End Function 27 | #tag EndMethod 28 | 29 | #tag Method, Flags = &h0 30 | Function ShowModal() As FolderItem 31 | Var flags As Integer 32 | If ShowEditBox Then flags = kBIF_EDITBOX 33 | result=SelectFolder(PromptText, InitialDirectory, flags) 34 | Return Result 35 | End Function 36 | #tag EndMethod 37 | 38 | 39 | #tag Property, Flags = &h0 40 | InitialDirectory As SelectFolderDialog.RootFolders 41 | #tag EndProperty 42 | 43 | #tag Property, Flags = &h0 44 | PromptText As String 45 | #tag EndProperty 46 | 47 | #tag Property, Flags = &h0 48 | Result As FolderItem 49 | #tag EndProperty 50 | 51 | #tag Property, Flags = &h0 52 | ShowEditBox As Boolean 53 | #tag EndProperty 54 | 55 | 56 | #tag Constant, Name = kBIF_EDITBOX, Type = Double, Dynamic = False, Default = \"&h00000010", Scope = Public 57 | #tag EndConstant 58 | 59 | 60 | #tag Structure, Name = BROWSEINFOA, Flags = &h21, Attributes = \"StructureAlignment \x3D 1" 61 | Owner as ptr 62 | root as int32 63 | displayName as ptr 64 | Title as cstring 65 | Flags as uint32 66 | fn as ptr 67 | image as int32 68 | #tag EndStructure 69 | 70 | 71 | #tag Enum, Name = RootFolders, Type = Integer, Flags = &h0 72 | CSIDL_DESKTOP = &h00000 // 73 | CSIDL_INTERNET = &h00001 // Internet Explorer (icon on desktop) 74 | CSIDL_PROGRAMS = &h00002 // Start Menu\Programs 75 | CSIDL_CONTROLS = &h00003 // My Computer\Control Panel 76 | CSIDL_PRINTERS = &h00004 // My Computer\Printers 77 | CSIDL_PERSONAL = &h00005 // My Documents 78 | CSIDL_FAVORITES = &h00006 // \Favorites 79 | CSIDL_STARTUP = &h00007 // Start Menu\Programs\Startup 80 | CSIDL_RECENT = &h00008 // \Recent 81 | CSIDL_SENDTO = &h00009 // \SendTo 82 | CSIDL_BITBUCKET = &h0000a // \Recycle Bin 83 | CSIDL_STARTMENU = &h0000b // \Start Menu 84 | CSIDL_MYDOCUMENTS = CSIDL_PERSONAL // Personal was just a silly name for My Documents 85 | CSIDL_MYMUSIC = &h0000d // "My Music" folder 86 | CSIDL_MYVIDEO = &h0000e // "My Videos" folder 87 | CSIDL_DESKTOPDIRECTORY = &h00010 // \Desktop 88 | CSIDL_DRIVES = &h00011 // My Computer 89 | CSIDL_NETWORK = &h00012 // Network Neighborhood (My Network Places) 90 | CSIDL_NETHOOD = &h00013 // \nethood 91 | CSIDL_FONTS = &h00014 // windows\fonts 92 | CSIDL_TEMPLATES = &h00015 93 | CSIDL_COMMON_STARTMENU = &h00016 // All Users\Start Menu 94 | CSIDL_COMMON_PROGRAMS = &h00017 // All Users\Start Menu\Programs 95 | CSIDL_COMMON_STARTUP = &h00018 // All Users\Startup 96 | CSIDL_COMMON_DESKTOPDIRECTORY = &h00019 // All Users\Desktop 97 | CSIDL_APPDATA = &h0001a // \Application Data 98 | CSIDL_PRINTHOOD = &h0001b // \PrintHood 99 | CSIDL_LOCAL_APPDATA = &h0001c // \Local Settings\Applicaiton Data (non roaming) 100 | CSIDL_ALTSTARTUP = &h0001d // non localized startup 101 | CSIDL_COMMON_ALTSTARTUP = &h0001e // non localized common startup 102 | CSIDL_COMMON_FAVORITES = &h0001f 103 | CSIDL_INTERNET_CACHE = &h00020 104 | CSIDL_COOKIES = &h00021 105 | CSIDL_HISTORY = &h00022 106 | CSIDL_COMMON_APPDATA = &h00023 // All Users\Application Data 107 | CSIDL_WINDOWS = &h00024 // GetWindowsDirectory() 108 | CSIDL_SYSTEM = &h00025 // GetSystemDirectory() 109 | CSIDL_PROGRAM_FILES = &h00026 // C:\Program Files 110 | CSIDL_MYPICTURES = &h00027 // C:\Program Files\My Pictures 111 | CSIDL_PROFILE = &h00028 // USERPROFILE 112 | CSIDL_SYSTEMX86 = &h00029 // x86 system directory on RISC 113 | CSIDL_PROGRAM_FILESX86 = &h0002a // x86 C:\Program Files on RISC 114 | CSIDL_PROGRAM_FILES_COMMON = &h0002b // C:\Program Files\Common 115 | CSIDL_PROGRAM_FILES_COMMONX86 = &h0002c // x86 Program Files\Common on RISC 116 | CSIDL_COMMON_TEMPLATES = &h0002d // All Users\Templates 117 | CSIDL_COMMON_DOCUMENTS = &h0002e // All Users\Documents 118 | CSIDL_COMMON_ADMINTOOLS = &h0002f // All Users\Start Menu\Programs\Administrative Tools 119 | CSIDL_ADMINTOOLS = &h00030 // \Start Menu\Programs\Administrative Tools 120 | CSIDL_CONNECTIONS = &h00031 // Network and Dial-up Connections 121 | CSIDL_COMMON_MUSIC = &h00035 // All Users\My Music 122 | CSIDL_COMMON_PICTURES = &h00036 // All Users\My Pictures 123 | CSIDL_COMMON_VIDEO = &h00037 // All Users\My Video 124 | CSIDL_RESOURCES = &h00038 // Resource Direcotry 125 | CSIDL_RESOURCES_LOCALIZED = &h00039 // Localized Resource Direcotry 126 | CSIDL_COMMON_OEM_LINKS = &h0003a // Links to All Users OEM specific apps 127 | CSIDL_CDBURN_AREA = &h0003b // USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning 128 | CSIDL_COMPUTERSNEARME = &h0003d // Computers Near Me (computered from Workgroup membership) 129 | #tag EndEnum 130 | 131 | 132 | #tag ViewBehavior 133 | #tag ViewProperty 134 | Name="Index" 135 | Visible=true 136 | Group="ID" 137 | InitialValue="-2147483648" 138 | Type="Integer" 139 | EditorType="" 140 | #tag EndViewProperty 141 | #tag ViewProperty 142 | Name="Left" 143 | Visible=true 144 | Group="Position" 145 | InitialValue="0" 146 | Type="Integer" 147 | EditorType="" 148 | #tag EndViewProperty 149 | #tag ViewProperty 150 | Name="Name" 151 | Visible=true 152 | Group="ID" 153 | InitialValue="" 154 | Type="String" 155 | EditorType="" 156 | #tag EndViewProperty 157 | #tag ViewProperty 158 | Name="Super" 159 | Visible=true 160 | Group="ID" 161 | InitialValue="" 162 | Type="String" 163 | EditorType="" 164 | #tag EndViewProperty 165 | #tag ViewProperty 166 | Name="Top" 167 | Visible=true 168 | Group="Position" 169 | InitialValue="0" 170 | Type="Integer" 171 | EditorType="" 172 | #tag EndViewProperty 173 | #tag ViewProperty 174 | Name="PromptText" 175 | Visible=false 176 | Group="Behavior" 177 | InitialValue="" 178 | Type="String" 179 | EditorType="MultiLineEditor" 180 | #tag EndViewProperty 181 | #tag ViewProperty 182 | Name="ShowEditBox" 183 | Visible=false 184 | Group="Behavior" 185 | InitialValue="" 186 | Type="Boolean" 187 | EditorType="" 188 | #tag EndViewProperty 189 | #tag EndViewBehavior 190 | End Class 191 | #tag EndClass 192 | -------------------------------------------------------------------------------- /UI/SystemInfoWindow.xojo_window: -------------------------------------------------------------------------------- 1 | #tag DesktopWindow 2 | Begin DesktopWindow SystemInfoWindow 3 | Backdrop = 0 4 | BackgroundColor = &cFFFFFF00 5 | Composite = False 6 | DefaultLocation = 0 7 | FullScreen = False 8 | HasBackgroundColor= False 9 | HasCloseButton = True 10 | HasFullScreenButton= False 11 | HasMaximizeButton= True 12 | HasMinimizeButton= True 13 | HasTitleBar = True 14 | Height = 400 15 | ImplicitInstance= False 16 | MacProcID = 0 17 | MaximumHeight = 32000 18 | MaximumWidth = 32000 19 | MenuBar = 0 20 | MenuBarVisible = True 21 | MinimumHeight = 64 22 | MinimumWidth = 64 23 | Resizeable = True 24 | Title = "System Information" 25 | Type = 0 26 | Visible = True 27 | Width = 350 28 | Begin DesktopListBox SystemList 29 | AutoDeactivate = True 30 | AutoHideScrollbars= True 31 | Bold = False 32 | Border = True 33 | ColumnCount = 2 34 | ColumnsResizable= False 35 | ColumnWidths = "" 36 | DefaultRowHeight= -1 37 | Enabled = True 38 | EnableDrag = False 39 | EnableDragReorder= False 40 | GridLineStyle = 0 41 | HasHeading = False 42 | HeadingIndex = -1 43 | Height = 360 44 | HelpTag = "" 45 | Hierarchical = False 46 | Index = -2147483648 47 | InitialParent = "" 48 | InitialValue = "" 49 | Italic = False 50 | Left = 20 51 | LockBottom = True 52 | LockedInPosition= False 53 | LockLeft = True 54 | LockRight = True 55 | LockTop = True 56 | RequiresSelection= False 57 | Scope = 2 58 | ScrollbarHorizontal= False 59 | ScrollBarVertical= True 60 | SelectionType = 0 61 | ShowDropIndicator= False 62 | TabIndex = 0 63 | TabPanelIndex = 0 64 | TabStop = True 65 | TextFont = "System" 66 | TextSize = 0.0 67 | TextUnit = 0 68 | Top = 20 69 | Transparent = True 70 | Underline = False 71 | UseFocusRing = True 72 | Visible = True 73 | Width = 310 74 | _ScrollOffset = 0 75 | _ScrollWidth = -1 76 | End 77 | End 78 | #tag EndDesktopWindow 79 | 80 | #tag WindowCode 81 | #tag Event 82 | Sub Opening() Handles Opening 83 | SystemList.AddRow("ComputerName", WinAPILib.SystemInfo.ComputerName) 84 | 'SystemList.AddRow("CPUUsage", Str(WinAPI.SystemInfo.CPUUsage)) 85 | SystemList.AddRow("DefaultPrinter", WinAPILib.SystemInfo.DefaultPrinter) 86 | SystemList.AddRow("DoubleClickTime", WinAPILib.SystemInfo.DoubleClickTime.ToString) 87 | SystemList.AddRow("LoggedInUserName", WinAPILib.SystemInfo.LoggedInUserName) 88 | SystemList.AddRow("NumberOfProcessors", WinAPILib.SystemInfo.NumberOfProcessors.ToString) 89 | SystemList.AddRow("ProcessID", WinAPILib.SystemInfo.ProcessID.ToString) 90 | SystemList.AddRow("HostName", WinAPILib.SystemInfo.HostName) 91 | End Sub 92 | #tag EndEvent 93 | 94 | 95 | #tag EndWindowCode 96 | 97 | #tag ViewBehavior 98 | #tag ViewProperty 99 | Name="MinimumWidth" 100 | Visible=true 101 | Group="Size" 102 | InitialValue="64" 103 | Type="Integer" 104 | EditorType="" 105 | #tag EndViewProperty 106 | #tag ViewProperty 107 | Name="MinimumHeight" 108 | Visible=true 109 | Group="Size" 110 | InitialValue="64" 111 | Type="Integer" 112 | EditorType="" 113 | #tag EndViewProperty 114 | #tag ViewProperty 115 | Name="MaximumWidth" 116 | Visible=true 117 | Group="Size" 118 | InitialValue="32000" 119 | Type="Integer" 120 | EditorType="" 121 | #tag EndViewProperty 122 | #tag ViewProperty 123 | Name="MaximumHeight" 124 | Visible=true 125 | Group="Size" 126 | InitialValue="32000" 127 | Type="Integer" 128 | EditorType="" 129 | #tag EndViewProperty 130 | #tag ViewProperty 131 | Name="Type" 132 | Visible=true 133 | Group="Frame" 134 | InitialValue="0" 135 | Type="Types" 136 | EditorType="Enum" 137 | #tag EnumValues 138 | "0 - Document" 139 | "1 - Movable Modal" 140 | "2 - Modal Dialog" 141 | "3 - Floating Window" 142 | "4 - Plain Box" 143 | "5 - Shadowed Box" 144 | "6 - Rounded Window" 145 | "7 - Global Floating Window" 146 | "8 - Sheet Window" 147 | "9 - Metal Window" 148 | "11 - Modeless Dialog" 149 | #tag EndEnumValues 150 | #tag EndViewProperty 151 | #tag ViewProperty 152 | Name="HasCloseButton" 153 | Visible=true 154 | Group="Frame" 155 | InitialValue="True" 156 | Type="Boolean" 157 | EditorType="" 158 | #tag EndViewProperty 159 | #tag ViewProperty 160 | Name="HasMaximizeButton" 161 | Visible=true 162 | Group="Frame" 163 | InitialValue="True" 164 | Type="Boolean" 165 | EditorType="" 166 | #tag EndViewProperty 167 | #tag ViewProperty 168 | Name="HasMinimizeButton" 169 | Visible=true 170 | Group="Frame" 171 | InitialValue="True" 172 | Type="Boolean" 173 | EditorType="" 174 | #tag EndViewProperty 175 | #tag ViewProperty 176 | Name="HasFullScreenButton" 177 | Visible=true 178 | Group="Frame" 179 | InitialValue="False" 180 | Type="Boolean" 181 | EditorType="" 182 | #tag EndViewProperty 183 | #tag ViewProperty 184 | Name="DefaultLocation" 185 | Visible=true 186 | Group="Behavior" 187 | InitialValue="0" 188 | Type="Locations" 189 | EditorType="Enum" 190 | #tag EnumValues 191 | "0 - Default" 192 | "1 - Parent Window" 193 | "2 - Main Screen" 194 | "3 - Parent Window Screen" 195 | "4 - Stagger" 196 | #tag EndEnumValues 197 | #tag EndViewProperty 198 | #tag ViewProperty 199 | Name="HasBackgroundColor" 200 | Visible=true 201 | Group="Background" 202 | InitialValue="False" 203 | Type="Boolean" 204 | EditorType="" 205 | #tag EndViewProperty 206 | #tag ViewProperty 207 | Name="BackgroundColor" 208 | Visible=true 209 | Group="Background" 210 | InitialValue="&hFFFFFF" 211 | Type="Color" 212 | EditorType="Color" 213 | #tag EndViewProperty 214 | #tag ViewProperty 215 | Name="Backdrop" 216 | Visible=true 217 | Group="Background" 218 | InitialValue="" 219 | Type="Picture" 220 | EditorType="" 221 | #tag EndViewProperty 222 | #tag ViewProperty 223 | Name="Composite" 224 | Visible=false 225 | Group="OS X (Carbon)" 226 | InitialValue="False" 227 | Type="Boolean" 228 | EditorType="" 229 | #tag EndViewProperty 230 | #tag ViewProperty 231 | Name="FullScreen" 232 | Visible=false 233 | Group="Behavior" 234 | InitialValue="False" 235 | Type="Boolean" 236 | EditorType="" 237 | #tag EndViewProperty 238 | #tag ViewProperty 239 | Name="Height" 240 | Visible=true 241 | Group="Size" 242 | InitialValue="400" 243 | Type="Integer" 244 | EditorType="" 245 | #tag EndViewProperty 246 | #tag ViewProperty 247 | Name="ImplicitInstance" 248 | Visible=true 249 | Group="Behavior" 250 | InitialValue="True" 251 | Type="Boolean" 252 | EditorType="" 253 | #tag EndViewProperty 254 | #tag ViewProperty 255 | Name="Interfaces" 256 | Visible=true 257 | Group="ID" 258 | InitialValue="" 259 | Type="String" 260 | EditorType="" 261 | #tag EndViewProperty 262 | #tag ViewProperty 263 | Name="MacProcID" 264 | Visible=false 265 | Group="OS X (Carbon)" 266 | InitialValue="0" 267 | Type="Integer" 268 | EditorType="" 269 | #tag EndViewProperty 270 | #tag ViewProperty 271 | Name="MenuBar" 272 | Visible=true 273 | Group="Menus" 274 | InitialValue="" 275 | Type="MenuBar" 276 | EditorType="" 277 | #tag EndViewProperty 278 | #tag ViewProperty 279 | Name="MenuBarVisible" 280 | Visible=true 281 | Group="Deprecated" 282 | InitialValue="True" 283 | Type="Boolean" 284 | EditorType="" 285 | #tag EndViewProperty 286 | #tag ViewProperty 287 | Name="Name" 288 | Visible=true 289 | Group="ID" 290 | InitialValue="" 291 | Type="String" 292 | EditorType="" 293 | #tag EndViewProperty 294 | #tag ViewProperty 295 | Name="Resizeable" 296 | Visible=true 297 | Group="Frame" 298 | InitialValue="True" 299 | Type="Boolean" 300 | EditorType="" 301 | #tag EndViewProperty 302 | #tag ViewProperty 303 | Name="Super" 304 | Visible=true 305 | Group="ID" 306 | InitialValue="" 307 | Type="String" 308 | EditorType="" 309 | #tag EndViewProperty 310 | #tag ViewProperty 311 | Name="Title" 312 | Visible=true 313 | Group="Frame" 314 | InitialValue="Untitled" 315 | Type="String" 316 | EditorType="" 317 | #tag EndViewProperty 318 | #tag ViewProperty 319 | Name="Visible" 320 | Visible=true 321 | Group="Behavior" 322 | InitialValue="True" 323 | Type="Boolean" 324 | EditorType="" 325 | #tag EndViewProperty 326 | #tag ViewProperty 327 | Name="Width" 328 | Visible=true 329 | Group="Size" 330 | InitialValue="600" 331 | Type="Integer" 332 | EditorType="" 333 | #tag EndViewProperty 334 | #tag EndViewBehavior 335 | -------------------------------------------------------------------------------- /UI/ScreenCaptureWindow.xojo_window: -------------------------------------------------------------------------------- 1 | #tag DesktopWindow 2 | Begin DesktopWindow ScreenCaptureWindow 3 | Backdrop = 0 4 | BackgroundColor = &cFFFFFF00 5 | Composite = False 6 | DefaultLocation = 0 7 | FullScreen = False 8 | HasBackgroundColor= False 9 | HasCloseButton = True 10 | HasFullScreenButton= False 11 | HasMaximizeButton= True 12 | HasMinimizeButton= True 13 | HasTitleBar = True 14 | Height = 206 15 | ImplicitInstance= False 16 | MacProcID = 0 17 | MaximumHeight = 32000 18 | MaximumWidth = 32000 19 | MenuBar = 0 20 | MenuBarVisible = True 21 | MinimumHeight = 64 22 | MinimumWidth = 64 23 | Resizeable = False 24 | Title = "Screen Capture" 25 | Type = 0 26 | Visible = True 27 | Width = 194 28 | Begin DesktopButton PushButton1 29 | AutoDeactivate = True 30 | Bold = False 31 | ButtonStyle = 0 32 | Cancel = False 33 | Caption = "Capture Top Left" 34 | Default = False 35 | Enabled = True 36 | Height = 22 37 | HelpTag = "" 38 | Index = -2147483648 39 | InitialParent = "" 40 | Italic = False 41 | Left = 20 42 | LockBottom = False 43 | LockedInPosition= False 44 | LockLeft = True 45 | LockRight = False 46 | LockTop = True 47 | Scope = 2 48 | TabIndex = 0 49 | TabPanelIndex = 0 50 | TabStop = True 51 | TextFont = "System" 52 | TextSize = 0.0 53 | TextUnit = 0 54 | Top = 20 55 | Transparent = True 56 | Underline = False 57 | Visible = True 58 | Width = 154 59 | End 60 | Begin DesktopCanvas Canvas1 61 | AcceptFocus = False 62 | AcceptTabs = False 63 | AutoDeactivate = True 64 | Backdrop = 0 65 | Enabled = True 66 | Height = 100 67 | HelpTag = "" 68 | Index = -2147483648 69 | InitialParent = "" 70 | Left = 47 71 | LockBottom = False 72 | LockedInPosition= False 73 | LockLeft = True 74 | LockRight = False 75 | LockTop = True 76 | Scope = 2 77 | TabIndex = 1 78 | TabPanelIndex = 0 79 | TabStop = True 80 | Top = 61 81 | Transparent = True 82 | UseFocusRing = True 83 | Visible = True 84 | Width = 100 85 | End 86 | End 87 | #tag EndDesktopWindow 88 | 89 | #tag WindowCode 90 | #tag Property, Flags = &h21 91 | Private CapturePic As Picture 92 | #tag EndProperty 93 | 94 | 95 | #tag EndWindowCode 96 | 97 | #tag Events PushButton1 98 | #tag Event 99 | Sub Pressed() 100 | CapturePic = WinAPILib.Screen.CaptureRect(0, 0, 100, 100) 101 | Canvas1.Refresh(False) 102 | End Sub 103 | #tag EndEvent 104 | #tag EndEvents 105 | #tag Events Canvas1 106 | #tag Event 107 | Sub Paint(g As Graphics, areas() As Rect) 108 | If CapturePic <> Nil Then 109 | g.DrawPicture(CapturePic, 0, 0) 110 | End If 111 | End Sub 112 | #tag EndEvent 113 | #tag EndEvents 114 | #tag ViewBehavior 115 | #tag ViewProperty 116 | Name="MinimumWidth" 117 | Visible=true 118 | Group="Size" 119 | InitialValue="64" 120 | Type="Integer" 121 | EditorType="" 122 | #tag EndViewProperty 123 | #tag ViewProperty 124 | Name="MinimumHeight" 125 | Visible=true 126 | Group="Size" 127 | InitialValue="64" 128 | Type="Integer" 129 | EditorType="" 130 | #tag EndViewProperty 131 | #tag ViewProperty 132 | Name="MaximumWidth" 133 | Visible=true 134 | Group="Size" 135 | InitialValue="32000" 136 | Type="Integer" 137 | EditorType="" 138 | #tag EndViewProperty 139 | #tag ViewProperty 140 | Name="MaximumHeight" 141 | Visible=true 142 | Group="Size" 143 | InitialValue="32000" 144 | Type="Integer" 145 | EditorType="" 146 | #tag EndViewProperty 147 | #tag ViewProperty 148 | Name="Type" 149 | Visible=true 150 | Group="Frame" 151 | InitialValue="0" 152 | Type="Types" 153 | EditorType="Enum" 154 | #tag EnumValues 155 | "0 - Document" 156 | "1 - Movable Modal" 157 | "2 - Modal Dialog" 158 | "3 - Floating Window" 159 | "4 - Plain Box" 160 | "5 - Shadowed Box" 161 | "6 - Rounded Window" 162 | "7 - Global Floating Window" 163 | "8 - Sheet Window" 164 | "9 - Metal Window" 165 | "11 - Modeless Dialog" 166 | #tag EndEnumValues 167 | #tag EndViewProperty 168 | #tag ViewProperty 169 | Name="HasCloseButton" 170 | Visible=true 171 | Group="Frame" 172 | InitialValue="True" 173 | Type="Boolean" 174 | EditorType="" 175 | #tag EndViewProperty 176 | #tag ViewProperty 177 | Name="HasMaximizeButton" 178 | Visible=true 179 | Group="Frame" 180 | InitialValue="True" 181 | Type="Boolean" 182 | EditorType="" 183 | #tag EndViewProperty 184 | #tag ViewProperty 185 | Name="HasMinimizeButton" 186 | Visible=true 187 | Group="Frame" 188 | InitialValue="True" 189 | Type="Boolean" 190 | EditorType="" 191 | #tag EndViewProperty 192 | #tag ViewProperty 193 | Name="HasFullScreenButton" 194 | Visible=true 195 | Group="Frame" 196 | InitialValue="False" 197 | Type="Boolean" 198 | EditorType="" 199 | #tag EndViewProperty 200 | #tag ViewProperty 201 | Name="DefaultLocation" 202 | Visible=true 203 | Group="Behavior" 204 | InitialValue="0" 205 | Type="Locations" 206 | EditorType="Enum" 207 | #tag EnumValues 208 | "0 - Default" 209 | "1 - Parent Window" 210 | "2 - Main Screen" 211 | "3 - Parent Window Screen" 212 | "4 - Stagger" 213 | #tag EndEnumValues 214 | #tag EndViewProperty 215 | #tag ViewProperty 216 | Name="HasBackgroundColor" 217 | Visible=true 218 | Group="Background" 219 | InitialValue="False" 220 | Type="Boolean" 221 | EditorType="" 222 | #tag EndViewProperty 223 | #tag ViewProperty 224 | Name="BackgroundColor" 225 | Visible=true 226 | Group="Background" 227 | InitialValue="&hFFFFFF" 228 | Type="Color" 229 | EditorType="Color" 230 | #tag EndViewProperty 231 | #tag ViewProperty 232 | Name="Backdrop" 233 | Visible=true 234 | Group="Background" 235 | InitialValue="" 236 | Type="Picture" 237 | EditorType="" 238 | #tag EndViewProperty 239 | #tag ViewProperty 240 | Name="Composite" 241 | Visible=false 242 | Group="OS X (Carbon)" 243 | InitialValue="False" 244 | Type="Boolean" 245 | EditorType="" 246 | #tag EndViewProperty 247 | #tag ViewProperty 248 | Name="FullScreen" 249 | Visible=false 250 | Group="Behavior" 251 | InitialValue="False" 252 | Type="Boolean" 253 | EditorType="" 254 | #tag EndViewProperty 255 | #tag ViewProperty 256 | Name="Height" 257 | Visible=true 258 | Group="Size" 259 | InitialValue="400" 260 | Type="Integer" 261 | EditorType="" 262 | #tag EndViewProperty 263 | #tag ViewProperty 264 | Name="ImplicitInstance" 265 | Visible=true 266 | Group="Behavior" 267 | InitialValue="True" 268 | Type="Boolean" 269 | EditorType="" 270 | #tag EndViewProperty 271 | #tag ViewProperty 272 | Name="Interfaces" 273 | Visible=true 274 | Group="ID" 275 | InitialValue="" 276 | Type="String" 277 | EditorType="" 278 | #tag EndViewProperty 279 | #tag ViewProperty 280 | Name="MacProcID" 281 | Visible=false 282 | Group="OS X (Carbon)" 283 | InitialValue="0" 284 | Type="Integer" 285 | EditorType="" 286 | #tag EndViewProperty 287 | #tag ViewProperty 288 | Name="MenuBar" 289 | Visible=true 290 | Group="Menus" 291 | InitialValue="" 292 | Type="MenuBar" 293 | EditorType="" 294 | #tag EndViewProperty 295 | #tag ViewProperty 296 | Name="MenuBarVisible" 297 | Visible=true 298 | Group="Deprecated" 299 | InitialValue="True" 300 | Type="Boolean" 301 | EditorType="" 302 | #tag EndViewProperty 303 | #tag ViewProperty 304 | Name="Name" 305 | Visible=true 306 | Group="ID" 307 | InitialValue="" 308 | Type="String" 309 | EditorType="" 310 | #tag EndViewProperty 311 | #tag ViewProperty 312 | Name="Resizeable" 313 | Visible=true 314 | Group="Frame" 315 | InitialValue="True" 316 | Type="Boolean" 317 | EditorType="" 318 | #tag EndViewProperty 319 | #tag ViewProperty 320 | Name="Super" 321 | Visible=true 322 | Group="ID" 323 | InitialValue="" 324 | Type="String" 325 | EditorType="" 326 | #tag EndViewProperty 327 | #tag ViewProperty 328 | Name="Title" 329 | Visible=true 330 | Group="Frame" 331 | InitialValue="Untitled" 332 | Type="String" 333 | EditorType="" 334 | #tag EndViewProperty 335 | #tag ViewProperty 336 | Name="Visible" 337 | Visible=true 338 | Group="Behavior" 339 | InitialValue="True" 340 | Type="Boolean" 341 | EditorType="" 342 | #tag EndViewProperty 343 | #tag ViewProperty 344 | Name="Width" 345 | Visible=true 346 | Group="Size" 347 | InitialValue="600" 348 | Type="Integer" 349 | EditorType="" 350 | #tag EndViewProperty 351 | #tag EndViewBehavior 352 | -------------------------------------------------------------------------------- /UI/OSVersionInfoWindow.xojo_window: -------------------------------------------------------------------------------- 1 | #tag DesktopWindow 2 | Begin DesktopWindow OSVersionInfoWindow 3 | Backdrop = 0 4 | BackgroundColor = &cFFFFFF00 5 | Composite = False 6 | DefaultLocation = 0 7 | FullScreen = False 8 | HasBackgroundColor= False 9 | HasCloseButton = True 10 | HasFullScreenButton= False 11 | HasMaximizeButton= True 12 | HasMinimizeButton= True 13 | HasTitleBar = True 14 | Height = 474 15 | ImplicitInstance= False 16 | MacProcID = 0 17 | MaximumHeight = 32000 18 | MaximumWidth = 32000 19 | MenuBar = 0 20 | MenuBarVisible = True 21 | MinimumHeight = 64 22 | MinimumWidth = 64 23 | Resizeable = True 24 | Title = "Windows Version Info" 25 | Type = 0 26 | Visible = True 27 | Width = 350 28 | Begin DesktopListBox VersionList 29 | AutoDeactivate = True 30 | AutoHideScrollbars= True 31 | Bold = False 32 | Border = True 33 | ColumnCount = 2 34 | ColumnsResizable= False 35 | ColumnWidths = "" 36 | DefaultRowHeight= -1 37 | Enabled = True 38 | EnableDrag = False 39 | EnableDragReorder= False 40 | GridLineStyle = 0 41 | HasHeading = False 42 | HeadingIndex = -1 43 | Height = 434 44 | HelpTag = "" 45 | Hierarchical = False 46 | Index = -2147483648 47 | InitialParent = "" 48 | InitialValue = "" 49 | Italic = False 50 | Left = 20 51 | LockBottom = True 52 | LockedInPosition= False 53 | LockLeft = True 54 | LockRight = True 55 | LockTop = True 56 | RequiresSelection= False 57 | Scope = 2 58 | ScrollbarHorizontal= False 59 | ScrollBarVertical= True 60 | SelectionType = 0 61 | ShowDropIndicator= False 62 | TabIndex = 0 63 | TabPanelIndex = 0 64 | TabStop = True 65 | TextFont = "System" 66 | TextSize = 0.0 67 | TextUnit = 0 68 | Top = 20 69 | Transparent = True 70 | Underline = False 71 | UseFocusRing = True 72 | Visible = True 73 | Width = 310 74 | _ScrollOffset = 0 75 | _ScrollWidth = -1 76 | End 77 | End 78 | #tag EndDesktopWindow 79 | 80 | #tag WindowCode 81 | #tag Event 82 | Sub Opening() Handles Opening 83 | Var versionInfo As New WinAPILib.OSVersionInfo 84 | 85 | VersionList.AddRow("MajorVersion", versionInfo.MajorVersion.ToString) 86 | VersionList.AddRow("MinorVersion", versionInfo.MinorVersion.ToString) 87 | VersionList.AddRow("Build", versionInfo.Build.ToString) 88 | VersionList.AddRow("ExtraInfo", versionInfo.ExtraInfo) 89 | VersionList.AddRow("Mode", versionInfo.Mode) 90 | VersionList.AddRow("OSName", versionInfo.OSName) 91 | VersionList.AddRow("OSSuites", versionInfo.OSSuites) 92 | VersionList.AddRow("PlatformID", versionInfo.PlatformID.ToString) 93 | VersionList.AddRow("ServicePack", versionInfo.ServicePack) 94 | VersionList.AddRow("SuiteMask", versionInfo.SuiteMask) 95 | VersionList.AddRow("Version", versionInfo.Version) 96 | End Sub 97 | #tag EndEvent 98 | 99 | 100 | #tag EndWindowCode 101 | 102 | #tag ViewBehavior 103 | #tag ViewProperty 104 | Name="MinimumWidth" 105 | Visible=true 106 | Group="Size" 107 | InitialValue="64" 108 | Type="Integer" 109 | EditorType="" 110 | #tag EndViewProperty 111 | #tag ViewProperty 112 | Name="MinimumHeight" 113 | Visible=true 114 | Group="Size" 115 | InitialValue="64" 116 | Type="Integer" 117 | EditorType="" 118 | #tag EndViewProperty 119 | #tag ViewProperty 120 | Name="MaximumWidth" 121 | Visible=true 122 | Group="Size" 123 | InitialValue="32000" 124 | Type="Integer" 125 | EditorType="" 126 | #tag EndViewProperty 127 | #tag ViewProperty 128 | Name="MaximumHeight" 129 | Visible=true 130 | Group="Size" 131 | InitialValue="32000" 132 | Type="Integer" 133 | EditorType="" 134 | #tag EndViewProperty 135 | #tag ViewProperty 136 | Name="Type" 137 | Visible=true 138 | Group="Frame" 139 | InitialValue="0" 140 | Type="Types" 141 | EditorType="Enum" 142 | #tag EnumValues 143 | "0 - Document" 144 | "1 - Movable Modal" 145 | "2 - Modal Dialog" 146 | "3 - Floating Window" 147 | "4 - Plain Box" 148 | "5 - Shadowed Box" 149 | "6 - Rounded Window" 150 | "7 - Global Floating Window" 151 | "8 - Sheet Window" 152 | "9 - Metal Window" 153 | "11 - Modeless Dialog" 154 | #tag EndEnumValues 155 | #tag EndViewProperty 156 | #tag ViewProperty 157 | Name="HasCloseButton" 158 | Visible=true 159 | Group="Frame" 160 | InitialValue="True" 161 | Type="Boolean" 162 | EditorType="" 163 | #tag EndViewProperty 164 | #tag ViewProperty 165 | Name="HasMaximizeButton" 166 | Visible=true 167 | Group="Frame" 168 | InitialValue="True" 169 | Type="Boolean" 170 | EditorType="" 171 | #tag EndViewProperty 172 | #tag ViewProperty 173 | Name="HasMinimizeButton" 174 | Visible=true 175 | Group="Frame" 176 | InitialValue="True" 177 | Type="Boolean" 178 | EditorType="" 179 | #tag EndViewProperty 180 | #tag ViewProperty 181 | Name="HasFullScreenButton" 182 | Visible=true 183 | Group="Frame" 184 | InitialValue="False" 185 | Type="Boolean" 186 | EditorType="" 187 | #tag EndViewProperty 188 | #tag ViewProperty 189 | Name="DefaultLocation" 190 | Visible=true 191 | Group="Behavior" 192 | InitialValue="0" 193 | Type="Locations" 194 | EditorType="Enum" 195 | #tag EnumValues 196 | "0 - Default" 197 | "1 - Parent Window" 198 | "2 - Main Screen" 199 | "3 - Parent Window Screen" 200 | "4 - Stagger" 201 | #tag EndEnumValues 202 | #tag EndViewProperty 203 | #tag ViewProperty 204 | Name="HasBackgroundColor" 205 | Visible=true 206 | Group="Background" 207 | InitialValue="False" 208 | Type="Boolean" 209 | EditorType="" 210 | #tag EndViewProperty 211 | #tag ViewProperty 212 | Name="BackgroundColor" 213 | Visible=true 214 | Group="Background" 215 | InitialValue="&hFFFFFF" 216 | Type="Color" 217 | EditorType="Color" 218 | #tag EndViewProperty 219 | #tag ViewProperty 220 | Name="Backdrop" 221 | Visible=true 222 | Group="Background" 223 | InitialValue="" 224 | Type="Picture" 225 | EditorType="" 226 | #tag EndViewProperty 227 | #tag ViewProperty 228 | Name="Composite" 229 | Visible=false 230 | Group="OS X (Carbon)" 231 | InitialValue="False" 232 | Type="Boolean" 233 | EditorType="" 234 | #tag EndViewProperty 235 | #tag ViewProperty 236 | Name="FullScreen" 237 | Visible=false 238 | Group="Behavior" 239 | InitialValue="False" 240 | Type="Boolean" 241 | EditorType="" 242 | #tag EndViewProperty 243 | #tag ViewProperty 244 | Name="Height" 245 | Visible=true 246 | Group="Size" 247 | InitialValue="400" 248 | Type="Integer" 249 | EditorType="" 250 | #tag EndViewProperty 251 | #tag ViewProperty 252 | Name="ImplicitInstance" 253 | Visible=true 254 | Group="Behavior" 255 | InitialValue="True" 256 | Type="Boolean" 257 | EditorType="" 258 | #tag EndViewProperty 259 | #tag ViewProperty 260 | Name="Interfaces" 261 | Visible=true 262 | Group="ID" 263 | InitialValue="" 264 | Type="String" 265 | EditorType="" 266 | #tag EndViewProperty 267 | #tag ViewProperty 268 | Name="MacProcID" 269 | Visible=false 270 | Group="OS X (Carbon)" 271 | InitialValue="0" 272 | Type="Integer" 273 | EditorType="" 274 | #tag EndViewProperty 275 | #tag ViewProperty 276 | Name="MenuBar" 277 | Visible=true 278 | Group="Menus" 279 | InitialValue="" 280 | Type="MenuBar" 281 | EditorType="" 282 | #tag EndViewProperty 283 | #tag ViewProperty 284 | Name="MenuBarVisible" 285 | Visible=true 286 | Group="Deprecated" 287 | InitialValue="True" 288 | Type="Boolean" 289 | EditorType="" 290 | #tag EndViewProperty 291 | #tag ViewProperty 292 | Name="Name" 293 | Visible=true 294 | Group="ID" 295 | InitialValue="" 296 | Type="String" 297 | EditorType="" 298 | #tag EndViewProperty 299 | #tag ViewProperty 300 | Name="Resizeable" 301 | Visible=true 302 | Group="Frame" 303 | InitialValue="True" 304 | Type="Boolean" 305 | EditorType="" 306 | #tag EndViewProperty 307 | #tag ViewProperty 308 | Name="Super" 309 | Visible=true 310 | Group="ID" 311 | InitialValue="" 312 | Type="String" 313 | EditorType="" 314 | #tag EndViewProperty 315 | #tag ViewProperty 316 | Name="Title" 317 | Visible=true 318 | Group="Frame" 319 | InitialValue="Untitled" 320 | Type="String" 321 | EditorType="" 322 | #tag EndViewProperty 323 | #tag ViewProperty 324 | Name="Visible" 325 | Visible=true 326 | Group="Behavior" 327 | InitialValue="True" 328 | Type="Boolean" 329 | EditorType="" 330 | #tag EndViewProperty 331 | #tag ViewProperty 332 | Name="Width" 333 | Visible=true 334 | Group="Size" 335 | InitialValue="600" 336 | Type="Integer" 337 | EditorType="" 338 | #tag EndViewProperty 339 | #tag EndViewBehavior 340 | -------------------------------------------------------------------------------- /UI/WinAPI/WinAPILib/OSVersionInfo.xojo_code: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class OSVersionInfo 3 | #tag Method, Flags = &h0 4 | Function Build() As Integer 5 | Return mBuild 6 | End Function 7 | #tag EndMethod 8 | 9 | #tag Method, Flags = &h0 10 | Sub Constructor() 11 | #If TargetWindows Then 12 | 13 | Var m As MemoryBlock 14 | Var res As Boolean 15 | Var dwOSVersionInfoSize, wsuitemask, ret, i As Integer 16 | Var szCSDVersion, s As String 17 | 18 | Soft Declare Function GetVersionExA Lib "Kernel32" (lpVersionInformation As Ptr) As Integer 19 | Soft Declare Function GetVersionExW Lib "Kernel32" (lpVersionInformation As Ptr) As Integer 20 | 21 | Var bUsingUnicode As Boolean = False 22 | If System.IsFunctionAvailable("GetVersionExW", "Kernel32") Then 23 | bUsingUnicode = True 24 | m = New MemoryBlock(284) ' use this for osversioninfoex structure (2000+ only) 25 | m.long(0) = m.Size ' must set size before calling getversionex 26 | ret = GetVersionExW(m) ' if not 2000+, will return 0 27 | If ret = 0 Then 28 | m = New MemoryBlock(276) 29 | m.long(0) = m.Size ' must set size before calling getversionex 30 | ret = GetVersionExW(m) 31 | If ret = 0 Then 32 | // Something really strange has happened 33 | Return 34 | End If 35 | End If 36 | End If 37 | 38 | // The following submitted by Jurg Otter 39 | #If Target32Bit And XojoVersion < 2019.01 Then 40 | mMajorVersion = m.Int32Value(4) 41 | mMinorVersion = m.Int32Value(8) 42 | 43 | If (mMajorVersion = 6) And (mMinorVersion = 2) Then 44 | // We got Windows 8. However, because we don't have a ManiFest it might be Windows 10. 45 | // So let's see what we get here: 46 | // RtlGetVersion is the equivalent of the GetVersionEx function in the Windows SDK. 47 | // https://msdn.microsoft.com/en-us/library/dn481241(v=vs.85).aspx 48 | // https://docs.microsoft.com/en-us/windows/desktop/devnotes/rtlgetversion 49 | 50 | If System.IsFunctionAvailable("RtlGetVersion", "ntdll") Then 51 | Soft Declare Function RtlGetVersion Lib "ntdll" (lpVersionInformation As Ptr) As Integer 52 | 53 | bUsingUnicode = True 54 | Var m2 As New MemoryBlock(284) // use this for osversioninfoex structure (2000+ only) 55 | m2.long(0) = m2.Size // must set size before calling getversionex 56 | ret = RtlGetVersion(m2) // if not 2000+, will return 0 57 | If ret = 0 Then 58 | // return 0 means: success 59 | 60 | mMajorVersion = m2.Int32Value(4) 61 | mMinorVersion = m2.Int32Value(8) 62 | If (mMajorVersion > 6) Then 63 | // right - it's not Windows 8 :-) 64 | // so get the info out of this MemoryBlock 65 | m = m2 66 | End If 67 | End If 68 | End If 69 | End If 70 | #EndIf 71 | 72 | mMajorVersion = m.Int32Value(4) 73 | mMinorVersion = m.Int32Value(8) 74 | mBuild = m.Int32Value(12) 75 | mPlatformId = m.Int32Value(16) 76 | 77 | Var nextVal As Integer 78 | If bUsingUnicode Then 79 | szCSDVersion = m.WString(20) 80 | nextVal = 276 81 | Else 82 | szCSDVersion = m.CString(20) 83 | nextVal = 148 84 | End If 85 | 86 | Try 87 | mServicePackStr = Str(m.Short(nextVal)) + "." + Str(m.Short(nextVal + 2)) 88 | If mServicePackStr = "0.0" Then mServicePackStr = "" 89 | 90 | mServicePack = Val(mServicePackStr) 91 | wsuitemask = m.Short(nextVal + 4) 92 | msuitemask = Hex(wSuitemask) 93 | mproducttype = m.Byte(nextVal + 6) 94 | 95 | Catch err As OutOfBoundsException 96 | mServicePackStr = "" 97 | mServicePack = 0 98 | wsuitemask = 0 99 | mSuiteMask = "" 100 | mProductType = 0 101 | End Try 102 | 103 | If BitwiseAnd(Val(msuitemask), &h1) > 0 Then 104 | mOSSuites = "Small Business" + Chr(9) 105 | End 106 | If BitwiseAnd(wsuitemask, &h2) > 0 Then 107 | mOSSuites = mOSSuites + "Enterprise" + Chr(9) 108 | End 109 | If BitwiseAnd(wsuitemask, &h4) > 0 Then 110 | mOSSuites = mOSSuites + "BackOffice" + Chr(9) 111 | End 112 | If BitwiseAnd(wsuitemask, &h8) > 0 Then 113 | mOSSuites = mOSSuites + "Communications" + Chr(9) 114 | End 115 | If BitwiseAnd(wsuitemask, &h10) > 0 Then 116 | mOSSuites = mOSSuites + "Terminal Services" + Chr(9) 117 | End 118 | If BitwiseAnd(wsuitemask, &h20) > 0 Then 119 | mOSSuites = mOSSuites + "Small Business Restricted" + Chr(9) 120 | End 121 | If BitwiseAnd(wsuitemask, &h40) > 0 Then 122 | mOSSuites = mOSSuites + "Embedded NT" + Chr(9) 123 | End 124 | If BitwiseAnd(wsuitemask, &h80) > 0 Then 125 | mOSSuites = mOSSuites + "Data Center" + Chr(9) 126 | End 127 | If BitwiseAnd(wsuitemask, &h100) > 0 Then 128 | mOSSuites = mOSSuites + "Single User Terminal Services" + Chr(9) 129 | End 130 | If BitwiseAnd(wsuitemask, &h200) > 0 Then 131 | mOSSuites = mOSSuites + "Personal" + Chr(9) 132 | End 133 | If BitwiseAnd(wsuitemask, &h400) > 0 Then 134 | mOSSuites = mOSSuites + "Blade" + Chr(9) 135 | End 136 | If BitwiseAnd(wsuitemask, &h800) > 0 Then 137 | mOSSuites = mOSSuites + "Embedded Restricted" + Chr(9) 138 | End 139 | If BitwiseAnd(wsuitemask, &h1000) > 0 Then 140 | mOSSuites = mOSSuites + "Security Appliance" + Chr(9) 141 | End 142 | 143 | Select Case mProductType 144 | Case 1 145 | mMode = "Workstation" 146 | Case 2 147 | mMode = "Domain Controller" 148 | Case 3 149 | mMode = "Server" 150 | End Select 151 | mExtraInfo = szCSDVersion 152 | 153 | s = Str(majorVersion) + "." + Str(mMinorVersion) + "." + Str(mBuild) + " " + mExtraInfo 154 | mVersionString = s 155 | 156 | #EndIf 157 | End Sub 158 | #tag EndMethod 159 | 160 | #tag Method, Flags = &h0 161 | Function ExtraInfo() As String 162 | Return mExtraInfo 163 | End Function 164 | #tag EndMethod 165 | 166 | #tag Method, Flags = &h0 167 | Function MajorVersion() As Integer 168 | Return mMajorVersion 169 | End Function 170 | #tag EndMethod 171 | 172 | #tag Method, Flags = &h0 173 | Function MinorVersion() As Integer 174 | Return mMinorVersion 175 | End Function 176 | #tag EndMethod 177 | 178 | #tag Method, Flags = &h0 179 | Function Mode() As String 180 | Return mMode 181 | End Function 182 | #tag EndMethod 183 | 184 | #tag Method, Flags = &h0 185 | Function OSName() As String 186 | Return mOSName 187 | End Function 188 | #tag EndMethod 189 | 190 | #tag Method, Flags = &h0 191 | Function OSSuites() As String 192 | Return mOSSuites 193 | End Function 194 | #tag EndMethod 195 | 196 | #tag Method, Flags = &h0 197 | Function PlatformID() As Integer 198 | Return mPlatformID 199 | End Function 200 | #tag EndMethod 201 | 202 | #tag Method, Flags = &h0 203 | Function ProductType() As Integer 204 | Return mProductType 205 | End Function 206 | #tag EndMethod 207 | 208 | #tag Method, Flags = &h0 209 | Function ServicePack() As String 210 | Return mServicePackStr 211 | End Function 212 | #tag EndMethod 213 | 214 | #tag Method, Flags = &h0 215 | Function SuiteMask() As String 216 | Return mSuiteMask 217 | End Function 218 | #tag EndMethod 219 | 220 | #tag Method, Flags = &h0 221 | Function Version() As String 222 | Return mVersionString 223 | End Function 224 | #tag EndMethod 225 | 226 | 227 | #tag Property, Flags = &h21 228 | Private mBuild As Integer 229 | #tag EndProperty 230 | 231 | #tag Property, Flags = &h21 232 | Private mExtraInfo As String 233 | #tag EndProperty 234 | 235 | #tag Property, Flags = &h21 236 | Private mMajorVersion As Integer 237 | #tag EndProperty 238 | 239 | #tag Property, Flags = &h21 240 | Private mMinorVersion As Integer 241 | #tag EndProperty 242 | 243 | #tag Property, Flags = &h21 244 | Private mMode As String 245 | #tag EndProperty 246 | 247 | #tag Property, Flags = &h21 248 | Private mOSName As String 249 | #tag EndProperty 250 | 251 | #tag Property, Flags = &h21 252 | Private mOSSuites As String 253 | #tag EndProperty 254 | 255 | #tag Property, Flags = &h21 256 | Private mPlatformID As Integer 257 | #tag EndProperty 258 | 259 | #tag Property, Flags = &h21 260 | Private mProductType As Integer 261 | #tag EndProperty 262 | 263 | #tag Property, Flags = &h21 264 | Private mServicePack As Double 265 | #tag EndProperty 266 | 267 | #tag Property, Flags = &h21 268 | Private mServicePackStr As String 269 | #tag EndProperty 270 | 271 | #tag Property, Flags = &h21 272 | Private mSuiteMask As String 273 | #tag EndProperty 274 | 275 | #tag Property, Flags = &h21 276 | Private mVersion As Integer 277 | #tag EndProperty 278 | 279 | #tag Property, Flags = &h21 280 | Private mVersionString As String 281 | #tag EndProperty 282 | 283 | 284 | #tag ViewBehavior 285 | #tag ViewProperty 286 | Name="Index" 287 | Visible=true 288 | Group="ID" 289 | InitialValue="-2147483648" 290 | Type="Integer" 291 | EditorType="" 292 | #tag EndViewProperty 293 | #tag ViewProperty 294 | Name="Left" 295 | Visible=true 296 | Group="Position" 297 | InitialValue="0" 298 | Type="Integer" 299 | EditorType="" 300 | #tag EndViewProperty 301 | #tag ViewProperty 302 | Name="Name" 303 | Visible=true 304 | Group="ID" 305 | InitialValue="" 306 | Type="String" 307 | EditorType="" 308 | #tag EndViewProperty 309 | #tag ViewProperty 310 | Name="Super" 311 | Visible=true 312 | Group="ID" 313 | InitialValue="" 314 | Type="String" 315 | EditorType="" 316 | #tag EndViewProperty 317 | #tag ViewProperty 318 | Name="Top" 319 | Visible=true 320 | Group="Position" 321 | InitialValue="0" 322 | Type="Integer" 323 | EditorType="" 324 | #tag EndViewProperty 325 | #tag EndViewBehavior 326 | End Class 327 | #tag EndClass 328 | -------------------------------------------------------------------------------- /WinAPILib.obsolete_20251203_154229/WinAPILib.obsolete_20251203_154229.nosync/OSVersionInfo.xojo_code.obsolete_20251203_154229.nosync: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class OSVersionInfo 3 | #tag Method, Flags = &h0 4 | Function Build() As Integer 5 | Return mBuild 6 | End Function 7 | #tag EndMethod 8 | 9 | #tag Method, Flags = &h0 10 | Sub Constructor() 11 | #If TargetWindows Then 12 | 13 | Var m As MemoryBlock 14 | Var res As Boolean 15 | Var dwOSVersionInfoSize, wsuitemask, ret, i As Integer 16 | Var szCSDVersion, s As String 17 | 18 | Soft Declare Function GetVersionExA Lib "Kernel32" (lpVersionInformation As Ptr) As Integer 19 | Soft Declare Function GetVersionExW Lib "Kernel32" (lpVersionInformation As Ptr) As Integer 20 | 21 | Var bUsingUnicode As Boolean = False 22 | If System.IsFunctionAvailable("GetVersionExW", "Kernel32") Then 23 | bUsingUnicode = True 24 | m = New MemoryBlock(284) ' use this for osversioninfoex structure (2000+ only) 25 | m.long(0) = m.Size ' must set size before calling getversionex 26 | ret = GetVersionExW(m) ' if not 2000+, will return 0 27 | If ret = 0 Then 28 | m = New MemoryBlock(276) 29 | m.long(0) = m.Size ' must set size before calling getversionex 30 | ret = GetVersionExW(m) 31 | If ret = 0 Then 32 | // Something really strange has happened 33 | Return 34 | End If 35 | End If 36 | End If 37 | 38 | // The following submitted by Jurg Otter 39 | #If Target32Bit And XojoVersion < 2019.01 Then 40 | mMajorVersion = m.Int32Value(4) 41 | mMinorVersion = m.Int32Value(8) 42 | 43 | If (mMajorVersion = 6) And (mMinorVersion = 2) Then 44 | // We got Windows 8. However, because we don't have a ManiFest it might be Windows 10. 45 | // So let's see what we get here: 46 | // RtlGetVersion is the equivalent of the GetVersionEx function in the Windows SDK. 47 | // https://msdn.microsoft.com/en-us/library/dn481241(v=vs.85).aspx 48 | // https://docs.microsoft.com/en-us/windows/desktop/devnotes/rtlgetversion 49 | 50 | If System.IsFunctionAvailable("RtlGetVersion", "ntdll") Then 51 | Soft Declare Function RtlGetVersion Lib "ntdll" (lpVersionInformation As Ptr) As Integer 52 | 53 | bUsingUnicode = True 54 | Var m2 As New MemoryBlock(284) // use this for osversioninfoex structure (2000+ only) 55 | m2.long(0) = m2.Size // must set size before calling getversionex 56 | ret = RtlGetVersion(m2) // if not 2000+, will return 0 57 | If ret = 0 Then 58 | // return 0 means: success 59 | 60 | mMajorVersion = m2.Int32Value(4) 61 | mMinorVersion = m2.Int32Value(8) 62 | If (mMajorVersion > 6) Then 63 | // right - it's not Windows 8 :-) 64 | // so get the info out of this MemoryBlock 65 | m = m2 66 | End If 67 | End If 68 | End If 69 | End If 70 | #EndIf 71 | 72 | mMajorVersion = m.Int32Value(4) 73 | mMinorVersion = m.Int32Value(8) 74 | mBuild = m.Int32Value(12) 75 | mPlatformId = m.Int32Value(16) 76 | 77 | Var nextVal As Integer 78 | If bUsingUnicode Then 79 | szCSDVersion = m.WString(20) 80 | nextVal = 276 81 | Else 82 | szCSDVersion = m.CString(20) 83 | nextVal = 148 84 | End If 85 | 86 | Try 87 | mServicePackStr = Str(m.Short(nextVal)) + "." + Str(m.Short(nextVal + 2)) 88 | If mServicePackStr = "0.0" Then mServicePackStr = "" 89 | 90 | mServicePack = Val(mServicePackStr) 91 | wsuitemask = m.Short(nextVal + 4) 92 | msuitemask = Hex(wSuitemask) 93 | mproducttype = m.Byte(nextVal + 6) 94 | 95 | Catch err As OutOfBoundsException 96 | mServicePackStr = "" 97 | mServicePack = 0 98 | wsuitemask = 0 99 | mSuiteMask = "" 100 | mProductType = 0 101 | End Try 102 | 103 | If BitwiseAnd(Val(msuitemask), &h1) > 0 Then 104 | mOSSuites = "Small Business" + Chr(9) 105 | End 106 | If BitwiseAnd(wsuitemask, &h2) > 0 Then 107 | mOSSuites = mOSSuites + "Enterprise" + Chr(9) 108 | End 109 | If BitwiseAnd(wsuitemask, &h4) > 0 Then 110 | mOSSuites = mOSSuites + "BackOffice" + Chr(9) 111 | End 112 | If BitwiseAnd(wsuitemask, &h8) > 0 Then 113 | mOSSuites = mOSSuites + "Communications" + Chr(9) 114 | End 115 | If BitwiseAnd(wsuitemask, &h10) > 0 Then 116 | mOSSuites = mOSSuites + "Terminal Services" + Chr(9) 117 | End 118 | If BitwiseAnd(wsuitemask, &h20) > 0 Then 119 | mOSSuites = mOSSuites + "Small Business Restricted" + Chr(9) 120 | End 121 | If BitwiseAnd(wsuitemask, &h40) > 0 Then 122 | mOSSuites = mOSSuites + "Embedded NT" + Chr(9) 123 | End 124 | If BitwiseAnd(wsuitemask, &h80) > 0 Then 125 | mOSSuites = mOSSuites + "Data Center" + Chr(9) 126 | End 127 | If BitwiseAnd(wsuitemask, &h100) > 0 Then 128 | mOSSuites = mOSSuites + "Single User Terminal Services" + Chr(9) 129 | End 130 | If BitwiseAnd(wsuitemask, &h200) > 0 Then 131 | mOSSuites = mOSSuites + "Personal" + Chr(9) 132 | End 133 | If BitwiseAnd(wsuitemask, &h400) > 0 Then 134 | mOSSuites = mOSSuites + "Blade" + Chr(9) 135 | End 136 | If BitwiseAnd(wsuitemask, &h800) > 0 Then 137 | mOSSuites = mOSSuites + "Embedded Restricted" + Chr(9) 138 | End 139 | If BitwiseAnd(wsuitemask, &h1000) > 0 Then 140 | mOSSuites = mOSSuites + "Security Appliance" + Chr(9) 141 | End 142 | 143 | Select Case mProductType 144 | Case 1 145 | mMode = "Workstation" 146 | Case 2 147 | mMode = "Domain Controller" 148 | Case 3 149 | mMode = "Server" 150 | End Select 151 | mExtraInfo = szCSDVersion 152 | 153 | s = Str(majorVersion) + "." + Str(mMinorVersion) + "." + Str(mBuild) + " " + mExtraInfo 154 | mVersionString = s 155 | 156 | #EndIf 157 | End Sub 158 | #tag EndMethod 159 | 160 | #tag Method, Flags = &h0 161 | Function ExtraInfo() As String 162 | Return mExtraInfo 163 | End Function 164 | #tag EndMethod 165 | 166 | #tag Method, Flags = &h0 167 | Function MajorVersion() As Integer 168 | Return mMajorVersion 169 | End Function 170 | #tag EndMethod 171 | 172 | #tag Method, Flags = &h0 173 | Function MinorVersion() As Integer 174 | Return mMinorVersion 175 | End Function 176 | #tag EndMethod 177 | 178 | #tag Method, Flags = &h0 179 | Function Mode() As String 180 | Return mMode 181 | End Function 182 | #tag EndMethod 183 | 184 | #tag Method, Flags = &h0 185 | Function OSName() As String 186 | Return mOSName 187 | End Function 188 | #tag EndMethod 189 | 190 | #tag Method, Flags = &h0 191 | Function OSSuites() As String 192 | Return mOSSuites 193 | End Function 194 | #tag EndMethod 195 | 196 | #tag Method, Flags = &h0 197 | Function PlatformID() As Integer 198 | Return mPlatformID 199 | End Function 200 | #tag EndMethod 201 | 202 | #tag Method, Flags = &h0 203 | Function ProductType() As Integer 204 | Return mProductType 205 | End Function 206 | #tag EndMethod 207 | 208 | #tag Method, Flags = &h0 209 | Function ServicePack() As String 210 | Return mServicePackStr 211 | End Function 212 | #tag EndMethod 213 | 214 | #tag Method, Flags = &h0 215 | Function SuiteMask() As String 216 | Return mSuiteMask 217 | End Function 218 | #tag EndMethod 219 | 220 | #tag Method, Flags = &h0 221 | Function Version() As String 222 | Return mVersionString 223 | End Function 224 | #tag EndMethod 225 | 226 | 227 | #tag Property, Flags = &h21 228 | Private mBuild As Integer 229 | #tag EndProperty 230 | 231 | #tag Property, Flags = &h21 232 | Private mExtraInfo As String 233 | #tag EndProperty 234 | 235 | #tag Property, Flags = &h21 236 | Private mMajorVersion As Integer 237 | #tag EndProperty 238 | 239 | #tag Property, Flags = &h21 240 | Private mMinorVersion As Integer 241 | #tag EndProperty 242 | 243 | #tag Property, Flags = &h21 244 | Private mMode As String 245 | #tag EndProperty 246 | 247 | #tag Property, Flags = &h21 248 | Private mOSName As String 249 | #tag EndProperty 250 | 251 | #tag Property, Flags = &h21 252 | Private mOSSuites As String 253 | #tag EndProperty 254 | 255 | #tag Property, Flags = &h21 256 | Private mPlatformID As Integer 257 | #tag EndProperty 258 | 259 | #tag Property, Flags = &h21 260 | Private mProductType As Integer 261 | #tag EndProperty 262 | 263 | #tag Property, Flags = &h21 264 | Private mServicePack As Double 265 | #tag EndProperty 266 | 267 | #tag Property, Flags = &h21 268 | Private mServicePackStr As String 269 | #tag EndProperty 270 | 271 | #tag Property, Flags = &h21 272 | Private mSuiteMask As String 273 | #tag EndProperty 274 | 275 | #tag Property, Flags = &h21 276 | Private mVersion As Integer 277 | #tag EndProperty 278 | 279 | #tag Property, Flags = &h21 280 | Private mVersionString As String 281 | #tag EndProperty 282 | 283 | 284 | #tag ViewBehavior 285 | #tag ViewProperty 286 | Name="Index" 287 | Visible=true 288 | Group="ID" 289 | InitialValue="-2147483648" 290 | Type="Integer" 291 | EditorType="" 292 | #tag EndViewProperty 293 | #tag ViewProperty 294 | Name="Left" 295 | Visible=true 296 | Group="Position" 297 | InitialValue="0" 298 | Type="Integer" 299 | EditorType="" 300 | #tag EndViewProperty 301 | #tag ViewProperty 302 | Name="Name" 303 | Visible=true 304 | Group="ID" 305 | InitialValue="" 306 | Type="String" 307 | EditorType="" 308 | #tag EndViewProperty 309 | #tag ViewProperty 310 | Name="Super" 311 | Visible=true 312 | Group="ID" 313 | InitialValue="" 314 | Type="String" 315 | EditorType="" 316 | #tag EndViewProperty 317 | #tag ViewProperty 318 | Name="Top" 319 | Visible=true 320 | Group="Position" 321 | InitialValue="0" 322 | Type="Integer" 323 | EditorType="" 324 | #tag EndViewProperty 325 | #tag EndViewBehavior 326 | End Class 327 | #tag EndClass 328 | -------------------------------------------------------------------------------- /UI/WinAPI/WinAPILib/CommandLink.xojo_code: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class CommandLink 3 | Inherits Canvas 4 | #tag Event 5 | Sub Close() 6 | RaiseEvent Close 7 | 8 | #If TargetWindows Then 9 | #If Target32Bit Then 10 | Soft Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongW" (hwnd As Integer, nIndex As Int32, dwNewLong As Ptr) As Ptr 11 | #Else 12 | Soft Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongPtrW" (hwnd As Integer, nIndex As Int32, dwNewLong As Ptr) As Ptr 13 | #EndIf 14 | 15 | Const GWL_WNDPROC = -4 16 | Call SetWindowLong(Me.Handle, GWL_WNDPROC, mOldWndProc) 17 | 18 | Declare Sub DestroyWindow Lib "User32" (hwnd As Ptr) 19 | DestroyWindow(mCommandHandle) 20 | #EndIf 21 | 22 | End Sub 23 | #tag EndEvent 24 | 25 | #tag Event 26 | Sub GotFocus() 27 | #If TargetWindows Then 28 | Declare Sub SetFocus Lib "User32" (hwnd As Ptr) 29 | SetFocus(mCommandHandle) 30 | #EndIf 31 | 32 | RaiseEvent GotFocus 33 | End Sub 34 | #tag EndEvent 35 | 36 | #tag Event 37 | Function MouseDown(X As Integer, Y As Integer) As Boolean 38 | // 39 | End Function 40 | #tag EndEvent 41 | 42 | #tag Event 43 | Sub MouseDrag(X As Integer, Y As Integer) 44 | // 45 | End Sub 46 | #tag EndEvent 47 | 48 | #tag Event 49 | Sub MouseUp(X As Integer, Y As Integer) 50 | // 51 | End Sub 52 | #tag EndEvent 53 | 54 | #tag Event 55 | Function MouseWheel(X As Integer, Y As Integer, deltaX as Integer, deltaY as Integer) As Boolean 56 | // 57 | End Function 58 | #tag EndEvent 59 | 60 | #tag Event 61 | Sub Open() 62 | #If TargetWindows Then 63 | Declare Function CreateWindowExW Lib "User32" (ex As Integer, className As WString, _ 64 | title As WString, style As UInt32, x As Int32, y As Int32, width As Int32, _ 65 | height As Int32, parent As Integer, menu As Integer, hInstance As Ptr, _ 66 | lParam As Integer) As Ptr 67 | 68 | Declare Function GetModuleHandleA Lib "Kernel32" (name As Ptr) As Ptr 69 | 70 | Var hInstance As Ptr = GetModuleHandleA(Nil) 71 | 72 | Const WS_CHILD = &h40000000 73 | Const WS_VISIBLE = &h10000000 74 | Const BS_COMMANDLINK = &hE 75 | 76 | mCommandHandle = CreateWindowExW(0, "BUTTON", "", _ 77 | WS_CHILD + WS_VISIBLE + BS_COMMANDLINK, _ 78 | 0, 0, 0, 0, Me.Handle, 0, hInstance, 0) 79 | 80 | // Resize the control 81 | Declare Sub SetWindowPos Lib "User32" (hwnd As Ptr, after As Integer, _ 82 | x As Int32, y As Int32, width As Int32, height As Int32, flags As UInt32) 83 | 84 | Const SWP_NOZORDER = &h4 85 | SetWindowPos(mCommandHandle, 0, 0, 0, Me.Width * ScaleFactor, Me.Height * ScaleFactor, SWP_NOZORDER) 86 | 87 | // Subclass window proc to receive events so we can tell when the command is clicked on 88 | If sWndProcMap = Nil Then sWndProcMap = New Dictionary 89 | sWndProcMap.Value(Me.Handle) = Self 90 | 91 | #If Target32Bit Then 92 | Soft Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongW" (hwnd As Integer, nIndex As Int32, dwNewLong As Ptr) As Ptr 93 | #Else 94 | Soft Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongPtrW" (hwnd As Integer, nIndex As Int32, dwNewLong As Ptr) As Ptr 95 | #EndIf 96 | Const GWL_WNDPROC = -4 97 | mOldWndProc = SetWindowLong(Me.Handle, GWL_WNDPROC, AddressOf WndProc) 98 | #EndIf 99 | 100 | RaiseEvent Open 101 | End Sub 102 | #tag EndEvent 103 | 104 | #tag Event 105 | Sub Paint(g As Graphics, areas() As REALbasic.Rect) 106 | // 107 | End Sub 108 | #tag EndEvent 109 | 110 | 111 | #tag Method, Flags = &h21 112 | Private Function CreateImageList(p as Picture) As Ptr 113 | #If TargetWindows Then 114 | Declare Function ImageList_Create Lib "ComCtl32" (cx As Int32, cy As Int32, _ 115 | flags As Int32, initialSize As Int32, growBy As Int32) As Ptr 116 | 117 | Const ILC_COLOR4 = &h0004 118 | Const ILC_COLOR8 = &h0008 119 | Const ILC_COLOR16 = &h0010 120 | Const ILC_COLOR24 = &h0018 121 | Const ILC_COLOR32 = &h0020 122 | 123 | Const TVM_SETIMAGELIST = &h1109 124 | 125 | // We have two lists, so which list we work on 126 | // may change. If the list hasn't been created 127 | // yet, then we need to make it now as well. 128 | Var flags As Integer 129 | Select Case p.Depth 130 | Case 32 131 | flags = ILC_COLOR32 132 | Case 24 133 | flags = ILC_COLOR24 134 | Case 16 135 | flags = ILC_COLOR16 136 | Case 8 137 | flags = ILC_COLOR8 138 | Case 4 139 | flags = ILC_COLOR4 140 | End 141 | 142 | Var imageList As Ptr 143 | // Make the new image list 144 | imageList = ImageList_Create(p.Width, p.Height, flags, 1, 1) 145 | 146 | Declare Sub SendMessage Lib "User32" Alias "SendMessageW" (hwnd As Ptr, msg As UInt32, wParam As Integer, lParam As Ptr) 147 | Call SendMessage(mCommandHandle, TVM_SETIMAGELIST, 0, imageList) 148 | 149 | // Now we have an image list to work with, so let's 150 | // add the picture. This is rather much a pain in 151 | // the arse, but that's ok, we can do it using declares! 152 | // We need to make an HBITMAP from the image that 153 | // also uses the mask properly 154 | Var hbitmap As Ptr = p.CopyOSHandle(Picture.HandleType.WindowsBMP) 155 | 156 | // Now that we have the HBITMAP from the Picture 157 | // object, we can add it to the image list 158 | Declare Function ImageList_Add Lib "ComCtl32" (list As Ptr, _ 159 | image As ptr, mask As Integer) As Integer 160 | 161 | Call ImageList_Add(imageList, hbitmap, 0) 162 | 163 | // Now that we're done with the bitmap, we should 164 | // release it 165 | Declare Sub DeleteObject Lib "Gdi32" (obj As Ptr) 166 | DeleteObject(hbitmap) 167 | 168 | Return imageList 169 | #EndIf 170 | 171 | End Function 172 | #tag EndMethod 173 | 174 | #tag Method, Flags = &h21 175 | Private Function HIWORD(param As Integer) As UInt16 176 | Return Bitwise.ShiftRight(param, 16) 177 | End Function 178 | #tag EndMethod 179 | 180 | #tag Method, Flags = &h21 181 | Private Function InternalWndProc(msg As Int32, wParam As Integer, lParam As Integer) As Integer 182 | #If TargetWindows Then 183 | Const WM_COMMAND = &h111 184 | Const BN_CLICKED = 0 185 | 186 | Select Case msg 187 | Case WM_COMMAND 188 | If HIWORD(wParam) = BN_CLICKED Then RaiseEvent Action 189 | End Select 190 | 191 | Declare Function CallWindowProcW Lib "User32" (oldProc As Ptr, handle As Integer, msg As Int32, wParam As Integer, lParam As Integer) As Integer 192 | Return CallWindowProcW(mOldWndProc, Me.Handle, msg, wParam, lParam) 193 | #EndIf 194 | End Function 195 | #tag EndMethod 196 | 197 | #tag Method, Flags = &h0 198 | Sub SetNote(s As String) 199 | #If TargetWindows Then 200 | Declare Sub SendMessage Lib "User32" Alias "SendMessageW" (hwnd As Ptr, msg As Int32, wParam As Integer, lParam As WString) 201 | 202 | Const BCM_SETNOTE = &h1609 203 | SendMessage(mCommandHandle, BCM_SETNOTE, 0, s) 204 | #EndIf 205 | 206 | End Sub 207 | #tag EndMethod 208 | 209 | #tag Method, Flags = &h0 210 | Sub SetPicture(p As Picture) 211 | #If TargetWindows Then 212 | Const BCM_SETIMAGELIST = &h1602 213 | 214 | Declare Sub SendMessageW Lib "User32" (hwnd As Ptr, msg As Int32, wParam As Integer, ByRef lParam As BUTTON_IMAGELIST) 215 | 216 | Var buttonImage As BUTTON_IMAGELIST 217 | buttonImage.himl = CreateImageList(p) 218 | 219 | SendMessageW(mCommandHandle, BCM_SETIMAGELIST, 0, buttonImage) 220 | #EndIf 221 | End Sub 222 | #tag EndMethod 223 | 224 | #tag Method, Flags = &h0 225 | Sub SetText(s As String) 226 | #If TargetWindows Then 227 | Declare Sub SendMessage Lib "User32" Alias "SendMessageW" (hwnd As Ptr, msg As Int32, wParam As Integer, lParam As WString) 228 | 229 | Const WM_SETTEXT = &hC 230 | SendMessage(mCommandHandle, WM_SETTEXT, 0, s) 231 | #EndIf 232 | End Sub 233 | #tag EndMethod 234 | 235 | #tag Method, Flags = &h21 236 | Private Shared Function WndProc(hWnd As Integer, msg As Int32, wParam As Integer, lParam As Integer) As Integer 237 | #If TargetWindows Then 238 | #Pragma X86CallingConvention StdCall 239 | 240 | Var obj As CommandLink = sWndProcMap.Value(hWnd) 241 | If obj <> Nil Then 242 | Return obj.InternalWndProc(msg, wParam, lParam) 243 | End If 244 | #EndIf 245 | End Function 246 | #tag EndMethod 247 | 248 | #tag DelegateDeclaration, Flags = &h21 249 | Private Delegate Function WndProcDelegate(hWnd As Ptr, msg As Int32, wParam As Integer, lParam As Integer) As Integer 250 | #tag EndDelegateDeclaration 251 | 252 | 253 | #tag Hook, Flags = &h0 254 | Event Action() 255 | #tag EndHook 256 | 257 | #tag Hook, Flags = &h0 258 | Event Close() 259 | #tag EndHook 260 | 261 | #tag Hook, Flags = &h0 262 | Event GotFocus() 263 | #tag EndHook 264 | 265 | #tag Hook, Flags = &h0 266 | Event Open() 267 | #tag EndHook 268 | 269 | 270 | #tag Property, Flags = &h21 271 | Private mCommandHandle As Ptr 272 | #tag EndProperty 273 | 274 | #tag Property, Flags = &h21 275 | Private mOldWndProc As Ptr 276 | #tag EndProperty 277 | 278 | #tag Property, Flags = &h21 279 | Private Shared sWndProcMap As Dictionary 280 | #tag EndProperty 281 | 282 | 283 | #tag Structure, Name = BUTTON_IMAGELIST, Flags = &h21 284 | himl As Ptr 285 | margin As SRECT 286 | uAlign As UInt32 287 | #tag EndStructure 288 | 289 | #tag Structure, Name = SRECT, Flags = &h21 290 | left As Int32 291 | top As Int32 292 | right As Int32 293 | bottom As Int32 294 | #tag EndStructure 295 | 296 | 297 | #tag ViewBehavior 298 | #tag ViewProperty 299 | Name="AllowAutoDeactivate" 300 | Visible=true 301 | Group="Appearance" 302 | InitialValue="True" 303 | Type="Boolean" 304 | EditorType="" 305 | #tag EndViewProperty 306 | #tag ViewProperty 307 | Name="Tooltip" 308 | Visible=true 309 | Group="Appearance" 310 | InitialValue="" 311 | Type="String" 312 | EditorType="MultiLineEditor" 313 | #tag EndViewProperty 314 | #tag ViewProperty 315 | Name="AllowFocusRing" 316 | Visible=true 317 | Group="Appearance" 318 | InitialValue="True" 319 | Type="Boolean" 320 | EditorType="" 321 | #tag EndViewProperty 322 | #tag ViewProperty 323 | Name="AllowFocus" 324 | Visible=true 325 | Group="Behavior" 326 | InitialValue="False" 327 | Type="Boolean" 328 | EditorType="" 329 | #tag EndViewProperty 330 | #tag ViewProperty 331 | Name="AllowTabs" 332 | Visible=true 333 | Group="Behavior" 334 | InitialValue="False" 335 | Type="Boolean" 336 | EditorType="" 337 | #tag EndViewProperty 338 | #tag ViewProperty 339 | Name="Backdrop" 340 | Visible=true 341 | Group="Appearance" 342 | InitialValue="" 343 | Type="Picture" 344 | EditorType="" 345 | #tag EndViewProperty 346 | #tag ViewProperty 347 | Name="DoubleBuffer" 348 | Visible=true 349 | Group="Behavior" 350 | InitialValue="False" 351 | Type="Boolean" 352 | EditorType="" 353 | #tag EndViewProperty 354 | #tag ViewProperty 355 | Name="Enabled" 356 | Visible=true 357 | Group="Appearance" 358 | InitialValue="True" 359 | Type="Boolean" 360 | EditorType="" 361 | #tag EndViewProperty 362 | #tag ViewProperty 363 | Name="Height" 364 | Visible=true 365 | Group="Position" 366 | InitialValue="100" 367 | Type="Integer" 368 | EditorType="" 369 | #tag EndViewProperty 370 | #tag ViewProperty 371 | Name="Index" 372 | Visible=true 373 | Group="ID" 374 | InitialValue="" 375 | Type="Integer" 376 | EditorType="" 377 | #tag EndViewProperty 378 | #tag ViewProperty 379 | Name="InitialParent" 380 | Visible=false 381 | Group="" 382 | InitialValue="" 383 | Type="String" 384 | EditorType="" 385 | #tag EndViewProperty 386 | #tag ViewProperty 387 | Name="Left" 388 | Visible=true 389 | Group="Position" 390 | InitialValue="" 391 | Type="Integer" 392 | EditorType="" 393 | #tag EndViewProperty 394 | #tag ViewProperty 395 | Name="LockBottom" 396 | Visible=true 397 | Group="Position" 398 | InitialValue="" 399 | Type="Boolean" 400 | EditorType="" 401 | #tag EndViewProperty 402 | #tag ViewProperty 403 | Name="LockLeft" 404 | Visible=true 405 | Group="Position" 406 | InitialValue="" 407 | Type="Boolean" 408 | EditorType="" 409 | #tag EndViewProperty 410 | #tag ViewProperty 411 | Name="LockRight" 412 | Visible=true 413 | Group="Position" 414 | InitialValue="" 415 | Type="Boolean" 416 | EditorType="" 417 | #tag EndViewProperty 418 | #tag ViewProperty 419 | Name="LockTop" 420 | Visible=true 421 | Group="Position" 422 | InitialValue="" 423 | Type="Boolean" 424 | EditorType="" 425 | #tag EndViewProperty 426 | #tag ViewProperty 427 | Name="Name" 428 | Visible=true 429 | Group="ID" 430 | InitialValue="" 431 | Type="String" 432 | EditorType="" 433 | #tag EndViewProperty 434 | #tag ViewProperty 435 | Name="Super" 436 | Visible=true 437 | Group="ID" 438 | InitialValue="" 439 | Type="String" 440 | EditorType="" 441 | #tag EndViewProperty 442 | #tag ViewProperty 443 | Name="TabIndex" 444 | Visible=true 445 | Group="Position" 446 | InitialValue="0" 447 | Type="Integer" 448 | EditorType="" 449 | #tag EndViewProperty 450 | #tag ViewProperty 451 | Name="TabPanelIndex" 452 | Visible=false 453 | Group="Position" 454 | InitialValue="0" 455 | Type="Integer" 456 | EditorType="" 457 | #tag EndViewProperty 458 | #tag ViewProperty 459 | Name="TabStop" 460 | Visible=true 461 | Group="Position" 462 | InitialValue="True" 463 | Type="Boolean" 464 | EditorType="" 465 | #tag EndViewProperty 466 | #tag ViewProperty 467 | Name="Top" 468 | Visible=true 469 | Group="Position" 470 | InitialValue="" 471 | Type="Integer" 472 | EditorType="" 473 | #tag EndViewProperty 474 | #tag ViewProperty 475 | Name="Transparent" 476 | Visible=true 477 | Group="Behavior" 478 | InitialValue="True" 479 | Type="Boolean" 480 | EditorType="" 481 | #tag EndViewProperty 482 | #tag ViewProperty 483 | Name="Visible" 484 | Visible=true 485 | Group="Appearance" 486 | InitialValue="True" 487 | Type="Boolean" 488 | EditorType="" 489 | #tag EndViewProperty 490 | #tag ViewProperty 491 | Name="Width" 492 | Visible=true 493 | Group="Position" 494 | InitialValue="100" 495 | Type="Integer" 496 | EditorType="" 497 | #tag EndViewProperty 498 | #tag EndViewBehavior 499 | End Class 500 | #tag EndClass 501 | -------------------------------------------------------------------------------- /WinAPILib.obsolete_20251203_154229/WinAPILib.obsolete_20251203_154229.nosync/CommandLink.xojo_code.obsolete_20251203_154229.nosync: -------------------------------------------------------------------------------- 1 | #tag Class 2 | Protected Class CommandLink 3 | Inherits Canvas 4 | #tag Event 5 | Sub Close() 6 | RaiseEvent Close 7 | 8 | #If TargetWindows Then 9 | #If Target32Bit Then 10 | Soft Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongW" (hwnd As Integer, nIndex As Int32, dwNewLong As Ptr) As Ptr 11 | #Else 12 | Soft Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongPtrW" (hwnd As Integer, nIndex As Int32, dwNewLong As Ptr) As Ptr 13 | #EndIf 14 | 15 | Const GWL_WNDPROC = -4 16 | Call SetWindowLong(Me.Handle, GWL_WNDPROC, mOldWndProc) 17 | 18 | Declare Sub DestroyWindow Lib "User32" (hwnd As Ptr) 19 | DestroyWindow(mCommandHandle) 20 | #EndIf 21 | 22 | End Sub 23 | #tag EndEvent 24 | 25 | #tag Event 26 | Sub GotFocus() 27 | #If TargetWindows Then 28 | Declare Sub SetFocus Lib "User32" (hwnd As Ptr) 29 | SetFocus(mCommandHandle) 30 | #EndIf 31 | 32 | RaiseEvent GotFocus 33 | End Sub 34 | #tag EndEvent 35 | 36 | #tag Event 37 | Function MouseDown(X As Integer, Y As Integer) As Boolean 38 | // 39 | End Function 40 | #tag EndEvent 41 | 42 | #tag Event 43 | Sub MouseDrag(X As Integer, Y As Integer) 44 | // 45 | End Sub 46 | #tag EndEvent 47 | 48 | #tag Event 49 | Sub MouseUp(X As Integer, Y As Integer) 50 | // 51 | End Sub 52 | #tag EndEvent 53 | 54 | #tag Event 55 | Function MouseWheel(X As Integer, Y As Integer, deltaX as Integer, deltaY as Integer) As Boolean 56 | // 57 | End Function 58 | #tag EndEvent 59 | 60 | #tag Event 61 | Sub Open() 62 | #If TargetWindows Then 63 | Declare Function CreateWindowExW Lib "User32" (ex As Integer, className As WString, _ 64 | title As WString, style As UInt32, x As Int32, y As Int32, width As Int32, _ 65 | height As Int32, parent As Integer, menu As Integer, hInstance As Ptr, _ 66 | lParam As Integer) As Ptr 67 | 68 | Declare Function GetModuleHandleA Lib "Kernel32" (name As Ptr) As Ptr 69 | 70 | Var hInstance As Ptr = GetModuleHandleA(Nil) 71 | 72 | Const WS_CHILD = &h40000000 73 | Const WS_VISIBLE = &h10000000 74 | Const BS_COMMANDLINK = &hE 75 | 76 | mCommandHandle = CreateWindowExW(0, "BUTTON", "", _ 77 | WS_CHILD + WS_VISIBLE + BS_COMMANDLINK, _ 78 | 0, 0, 0, 0, Me.Handle, 0, hInstance, 0) 79 | 80 | // Resize the control 81 | Declare Sub SetWindowPos Lib "User32" (hwnd As Ptr, after As Integer, _ 82 | x As Int32, y As Int32, width As Int32, height As Int32, flags As UInt32) 83 | 84 | Const SWP_NOZORDER = &h4 85 | SetWindowPos(mCommandHandle, 0, 0, 0, Me.Width * ScaleFactor, Me.Height * ScaleFactor, SWP_NOZORDER) 86 | 87 | // Subclass window proc to receive events so we can tell when the command is clicked on 88 | If sWndProcMap = Nil Then sWndProcMap = New Dictionary 89 | sWndProcMap.Value(Me.Handle) = Self 90 | 91 | #If Target32Bit Then 92 | Soft Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongW" (hwnd As Integer, nIndex As Int32, dwNewLong As Ptr) As Ptr 93 | #Else 94 | Soft Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongPtrW" (hwnd As Integer, nIndex As Int32, dwNewLong As Ptr) As Ptr 95 | #EndIf 96 | Const GWL_WNDPROC = -4 97 | mOldWndProc = SetWindowLong(Me.Handle, GWL_WNDPROC, AddressOf WndProc) 98 | #EndIf 99 | 100 | RaiseEvent Open 101 | End Sub 102 | #tag EndEvent 103 | 104 | #tag Event 105 | Sub Paint(g As Graphics, areas() As REALbasic.Rect) 106 | // 107 | End Sub 108 | #tag EndEvent 109 | 110 | 111 | #tag Method, Flags = &h21 112 | Private Function CreateImageList(p as Picture) As Ptr 113 | #If TargetWindows Then 114 | Declare Function ImageList_Create Lib "ComCtl32" (cx As Int32, cy As Int32, _ 115 | flags As Int32, initialSize As Int32, growBy As Int32) As Ptr 116 | 117 | Const ILC_COLOR4 = &h0004 118 | Const ILC_COLOR8 = &h0008 119 | Const ILC_COLOR16 = &h0010 120 | Const ILC_COLOR24 = &h0018 121 | Const ILC_COLOR32 = &h0020 122 | 123 | Const TVM_SETIMAGELIST = &h1109 124 | 125 | // We have two lists, so which list we work on 126 | // may change. If the list hasn't been created 127 | // yet, then we need to make it now as well. 128 | Var flags As Integer 129 | Select Case p.Depth 130 | Case 32 131 | flags = ILC_COLOR32 132 | Case 24 133 | flags = ILC_COLOR24 134 | Case 16 135 | flags = ILC_COLOR16 136 | Case 8 137 | flags = ILC_COLOR8 138 | Case 4 139 | flags = ILC_COLOR4 140 | End 141 | 142 | Var imageList As Ptr 143 | // Make the new image list 144 | imageList = ImageList_Create(p.Width, p.Height, flags, 1, 1) 145 | 146 | Declare Sub SendMessage Lib "User32" Alias "SendMessageW" (hwnd As Ptr, msg As UInt32, wParam As Integer, lParam As Ptr) 147 | Call SendMessage(mCommandHandle, TVM_SETIMAGELIST, 0, imageList) 148 | 149 | // Now we have an image list to work with, so let's 150 | // add the picture. This is rather much a pain in 151 | // the arse, but that's ok, we can do it using declares! 152 | // We need to make an HBITMAP from the image that 153 | // also uses the mask properly 154 | Var hbitmap As Ptr = p.CopyOSHandle(Picture.HandleType.WindowsBMP) 155 | 156 | // Now that we have the HBITMAP from the Picture 157 | // object, we can add it to the image list 158 | Declare Function ImageList_Add Lib "ComCtl32" (list As Ptr, _ 159 | image As ptr, mask As Integer) As Integer 160 | 161 | Call ImageList_Add(imageList, hbitmap, 0) 162 | 163 | // Now that we're done with the bitmap, we should 164 | // release it 165 | Declare Sub DeleteObject Lib "Gdi32" (obj As Ptr) 166 | DeleteObject(hbitmap) 167 | 168 | Return imageList 169 | #EndIf 170 | 171 | End Function 172 | #tag EndMethod 173 | 174 | #tag Method, Flags = &h21 175 | Private Function HIWORD(param As Integer) As UInt16 176 | Return Bitwise.ShiftRight(param, 16) 177 | End Function 178 | #tag EndMethod 179 | 180 | #tag Method, Flags = &h21 181 | Private Function InternalWndProc(msg As Int32, wParam As Integer, lParam As Integer) As Integer 182 | #If TargetWindows Then 183 | Const WM_COMMAND = &h111 184 | Const BN_CLICKED = 0 185 | 186 | Select Case msg 187 | Case WM_COMMAND 188 | If HIWORD(wParam) = BN_CLICKED Then RaiseEvent Action 189 | End Select 190 | 191 | Declare Function CallWindowProcW Lib "User32" (oldProc As Ptr, handle As Integer, msg As Int32, wParam As Integer, lParam As Integer) As Integer 192 | Return CallWindowProcW(mOldWndProc, Me.Handle, msg, wParam, lParam) 193 | #EndIf 194 | End Function 195 | #tag EndMethod 196 | 197 | #tag Method, Flags = &h0 198 | Sub SetNote(s As String) 199 | #If TargetWindows Then 200 | Declare Sub SendMessage Lib "User32" Alias "SendMessageW" (hwnd As Ptr, msg As Int32, wParam As Integer, lParam As WString) 201 | 202 | Const BCM_SETNOTE = &h1609 203 | SendMessage(mCommandHandle, BCM_SETNOTE, 0, s) 204 | #EndIf 205 | 206 | End Sub 207 | #tag EndMethod 208 | 209 | #tag Method, Flags = &h0 210 | Sub SetPicture(p As Picture) 211 | #If TargetWindows Then 212 | Const BCM_SETIMAGELIST = &h1602 213 | 214 | Declare Sub SendMessageW Lib "User32" (hwnd As Ptr, msg As Int32, wParam As Integer, ByRef lParam As BUTTON_IMAGELIST) 215 | 216 | Var buttonImage As BUTTON_IMAGELIST 217 | buttonImage.himl = CreateImageList(p) 218 | 219 | SendMessageW(mCommandHandle, BCM_SETIMAGELIST, 0, buttonImage) 220 | #EndIf 221 | End Sub 222 | #tag EndMethod 223 | 224 | #tag Method, Flags = &h0 225 | Sub SetText(s As String) 226 | #If TargetWindows Then 227 | Declare Sub SendMessage Lib "User32" Alias "SendMessageW" (hwnd As Ptr, msg As Int32, wParam As Integer, lParam As WString) 228 | 229 | Const WM_SETTEXT = &hC 230 | SendMessage(mCommandHandle, WM_SETTEXT, 0, s) 231 | #EndIf 232 | End Sub 233 | #tag EndMethod 234 | 235 | #tag Method, Flags = &h21 236 | Private Shared Function WndProc(hWnd As Integer, msg As Int32, wParam As Integer, lParam As Integer) As Integer 237 | #If TargetWindows Then 238 | #Pragma X86CallingConvention StdCall 239 | 240 | Var obj As CommandLink = sWndProcMap.Value(hWnd) 241 | If obj <> Nil Then 242 | Return obj.InternalWndProc(msg, wParam, lParam) 243 | End If 244 | #EndIf 245 | End Function 246 | #tag EndMethod 247 | 248 | #tag DelegateDeclaration, Flags = &h21 249 | Private Delegate Function WndProcDelegate(hWnd As Ptr, msg As Int32, wParam As Integer, lParam As Integer) As Integer 250 | #tag EndDelegateDeclaration 251 | 252 | 253 | #tag Hook, Flags = &h0 254 | Event Action() 255 | #tag EndHook 256 | 257 | #tag Hook, Flags = &h0 258 | Event Close() 259 | #tag EndHook 260 | 261 | #tag Hook, Flags = &h0 262 | Event GotFocus() 263 | #tag EndHook 264 | 265 | #tag Hook, Flags = &h0 266 | Event Open() 267 | #tag EndHook 268 | 269 | 270 | #tag Property, Flags = &h21 271 | Private mCommandHandle As Ptr 272 | #tag EndProperty 273 | 274 | #tag Property, Flags = &h21 275 | Private mOldWndProc As Ptr 276 | #tag EndProperty 277 | 278 | #tag Property, Flags = &h21 279 | Private Shared sWndProcMap As Dictionary 280 | #tag EndProperty 281 | 282 | 283 | #tag Structure, Name = BUTTON_IMAGELIST, Flags = &h21 284 | himl As Ptr 285 | margin As SRECT 286 | uAlign As UInt32 287 | #tag EndStructure 288 | 289 | #tag Structure, Name = SRECT, Flags = &h21 290 | left As Int32 291 | top As Int32 292 | right As Int32 293 | bottom As Int32 294 | #tag EndStructure 295 | 296 | 297 | #tag ViewBehavior 298 | #tag ViewProperty 299 | Name="AllowAutoDeactivate" 300 | Visible=true 301 | Group="Appearance" 302 | InitialValue="True" 303 | Type="Boolean" 304 | EditorType="" 305 | #tag EndViewProperty 306 | #tag ViewProperty 307 | Name="Tooltip" 308 | Visible=true 309 | Group="Appearance" 310 | InitialValue="" 311 | Type="String" 312 | EditorType="MultiLineEditor" 313 | #tag EndViewProperty 314 | #tag ViewProperty 315 | Name="AllowFocusRing" 316 | Visible=true 317 | Group="Appearance" 318 | InitialValue="True" 319 | Type="Boolean" 320 | EditorType="" 321 | #tag EndViewProperty 322 | #tag ViewProperty 323 | Name="AllowFocus" 324 | Visible=true 325 | Group="Behavior" 326 | InitialValue="False" 327 | Type="Boolean" 328 | EditorType="" 329 | #tag EndViewProperty 330 | #tag ViewProperty 331 | Name="AllowTabs" 332 | Visible=true 333 | Group="Behavior" 334 | InitialValue="False" 335 | Type="Boolean" 336 | EditorType="" 337 | #tag EndViewProperty 338 | #tag ViewProperty 339 | Name="Backdrop" 340 | Visible=true 341 | Group="Appearance" 342 | InitialValue="" 343 | Type="Picture" 344 | EditorType="" 345 | #tag EndViewProperty 346 | #tag ViewProperty 347 | Name="DoubleBuffer" 348 | Visible=true 349 | Group="Behavior" 350 | InitialValue="False" 351 | Type="Boolean" 352 | EditorType="" 353 | #tag EndViewProperty 354 | #tag ViewProperty 355 | Name="Enabled" 356 | Visible=true 357 | Group="Appearance" 358 | InitialValue="True" 359 | Type="Boolean" 360 | EditorType="" 361 | #tag EndViewProperty 362 | #tag ViewProperty 363 | Name="Height" 364 | Visible=true 365 | Group="Position" 366 | InitialValue="100" 367 | Type="Integer" 368 | EditorType="" 369 | #tag EndViewProperty 370 | #tag ViewProperty 371 | Name="Index" 372 | Visible=true 373 | Group="ID" 374 | InitialValue="" 375 | Type="Integer" 376 | EditorType="" 377 | #tag EndViewProperty 378 | #tag ViewProperty 379 | Name="InitialParent" 380 | Visible=false 381 | Group="" 382 | InitialValue="" 383 | Type="String" 384 | EditorType="" 385 | #tag EndViewProperty 386 | #tag ViewProperty 387 | Name="Left" 388 | Visible=true 389 | Group="Position" 390 | InitialValue="" 391 | Type="Integer" 392 | EditorType="" 393 | #tag EndViewProperty 394 | #tag ViewProperty 395 | Name="LockBottom" 396 | Visible=true 397 | Group="Position" 398 | InitialValue="" 399 | Type="Boolean" 400 | EditorType="" 401 | #tag EndViewProperty 402 | #tag ViewProperty 403 | Name="LockLeft" 404 | Visible=true 405 | Group="Position" 406 | InitialValue="" 407 | Type="Boolean" 408 | EditorType="" 409 | #tag EndViewProperty 410 | #tag ViewProperty 411 | Name="LockRight" 412 | Visible=true 413 | Group="Position" 414 | InitialValue="" 415 | Type="Boolean" 416 | EditorType="" 417 | #tag EndViewProperty 418 | #tag ViewProperty 419 | Name="LockTop" 420 | Visible=true 421 | Group="Position" 422 | InitialValue="" 423 | Type="Boolean" 424 | EditorType="" 425 | #tag EndViewProperty 426 | #tag ViewProperty 427 | Name="Name" 428 | Visible=true 429 | Group="ID" 430 | InitialValue="" 431 | Type="String" 432 | EditorType="" 433 | #tag EndViewProperty 434 | #tag ViewProperty 435 | Name="Super" 436 | Visible=true 437 | Group="ID" 438 | InitialValue="" 439 | Type="String" 440 | EditorType="" 441 | #tag EndViewProperty 442 | #tag ViewProperty 443 | Name="TabIndex" 444 | Visible=true 445 | Group="Position" 446 | InitialValue="0" 447 | Type="Integer" 448 | EditorType="" 449 | #tag EndViewProperty 450 | #tag ViewProperty 451 | Name="TabPanelIndex" 452 | Visible=false 453 | Group="Position" 454 | InitialValue="0" 455 | Type="Integer" 456 | EditorType="" 457 | #tag EndViewProperty 458 | #tag ViewProperty 459 | Name="TabStop" 460 | Visible=true 461 | Group="Position" 462 | InitialValue="True" 463 | Type="Boolean" 464 | EditorType="" 465 | #tag EndViewProperty 466 | #tag ViewProperty 467 | Name="Top" 468 | Visible=true 469 | Group="Position" 470 | InitialValue="" 471 | Type="Integer" 472 | EditorType="" 473 | #tag EndViewProperty 474 | #tag ViewProperty 475 | Name="Transparent" 476 | Visible=true 477 | Group="Behavior" 478 | InitialValue="True" 479 | Type="Boolean" 480 | EditorType="" 481 | #tag EndViewProperty 482 | #tag ViewProperty 483 | Name="Visible" 484 | Visible=true 485 | Group="Appearance" 486 | InitialValue="True" 487 | Type="Boolean" 488 | EditorType="" 489 | #tag EndViewProperty 490 | #tag ViewProperty 491 | Name="Width" 492 | Visible=true 493 | Group="Position" 494 | InitialValue="100" 495 | Type="Integer" 496 | EditorType="" 497 | #tag EndViewProperty 498 | #tag EndViewBehavior 499 | End Class 500 | #tag EndClass 501 | -------------------------------------------------------------------------------- /UI/MainWindow.xojo_window: -------------------------------------------------------------------------------- 1 | #tag DesktopWindow 2 | Begin DesktopWindow MainWindow 3 | Backdrop = 0 4 | BackgroundColor = &cFFFFFF00 5 | Composite = False 6 | DefaultLocation = 0 7 | FullScreen = False 8 | HasBackgroundColor= False 9 | HasCloseButton = True 10 | HasFullScreenButton= False 11 | HasMaximizeButton= True 12 | HasMinimizeButton= True 13 | HasTitleBar = True 14 | Height = 400 15 | ImplicitInstance= True 16 | MacProcID = 0 17 | MaximumHeight = 32000 18 | MaximumWidth = 32000 19 | MenuBar = 2093424639 20 | MenuBarVisible = True 21 | MinimumHeight = 64 22 | MinimumWidth = 64 23 | Resizeable = True 24 | Title = "WinAPILib" 25 | Type = 0 26 | Visible = True 27 | Width = 600 28 | Begin DesktopButton ScreenCaptureButton 29 | AutoDeactivate = True 30 | Bold = False 31 | ButtonStyle = 0 32 | Cancel = False 33 | Caption = "Screen Capture" 34 | Default = False 35 | Enabled = True 36 | Height = 22 37 | HelpTag = "" 38 | Index = -2147483648 39 | InitialParent = "" 40 | Italic = False 41 | Left = 20 42 | LockBottom = False 43 | LockedInPosition= False 44 | LockLeft = True 45 | LockRight = False 46 | LockTop = True 47 | Scope = 2 48 | TabIndex = 1 49 | TabPanelIndex = 0 50 | TabStop = True 51 | TextFont = "System" 52 | TextSize = 0.0 53 | TextUnit = 0 54 | Top = 19 55 | Transparent = True 56 | Underline = False 57 | Visible = True 58 | Width = 107 59 | End 60 | Begin DesktopSlider OpacitySlider 61 | AutoDeactivate = True 62 | Enabled = True 63 | Height = 24 64 | HelpTag = "" 65 | Index = -2147483648 66 | InitialParent = "" 67 | Left = 20 68 | LineStep = 1 69 | LiveScroll = False 70 | LockBottom = False 71 | LockedInPosition= False 72 | LockLeft = True 73 | LockRight = False 74 | LockTop = True 75 | Maximum = 100 76 | Minimum = 20 77 | PageStep = 20 78 | Scope = 0 79 | TabIndex = 3 80 | TabPanelIndex = 0 81 | TabStop = True 82 | TickStyle = 0 83 | Top = 173 84 | Transparent = True 85 | Value = 100 86 | Visible = True 87 | Width = 100 88 | End 89 | Begin DesktopLabel Label1 90 | AutoDeactivate = True 91 | Bold = False 92 | Enabled = True 93 | Height = 20 94 | HelpTag = "" 95 | Index = -2147483648 96 | InitialParent = "" 97 | Italic = False 98 | Left = 20 99 | LockBottom = False 100 | LockedInPosition= False 101 | LockLeft = True 102 | LockRight = False 103 | LockTop = True 104 | Multiline = False 105 | Scope = 0 106 | Selectable = False 107 | TabIndex = 4 108 | TabPanelIndex = 0 109 | TabStop = True 110 | Text = "Opacity" 111 | TextAlign = 0 112 | TextColor = &c00000000 113 | TextFont = "System" 114 | TextSize = 0.0 115 | TextUnit = 0 116 | Top = 148 117 | Transparent = True 118 | Underline = False 119 | Visible = True 120 | Width = 100 121 | End 122 | Begin DesktopLabel CPUUsageLabel 123 | AutoDeactivate = True 124 | Bold = False 125 | Enabled = True 126 | Height = 20 127 | HelpTag = "" 128 | Index = -2147483648 129 | InitialParent = "" 130 | Italic = False 131 | Left = 20 132 | LockBottom = False 133 | LockedInPosition= False 134 | LockLeft = True 135 | LockRight = False 136 | LockTop = True 137 | Multiline = False 138 | Scope = 0 139 | Selectable = False 140 | TabIndex = 5 141 | TabPanelIndex = 0 142 | TabStop = True 143 | Text = "CPUUsage" 144 | TextAlign = 0 145 | TextColor = &c00000000 146 | TextFont = "System" 147 | TextSize = 0.0 148 | TextUnit = 0 149 | Top = 222 150 | Transparent = True 151 | Underline = False 152 | Visible = True 153 | Width = 201 154 | End 155 | Begin Timer CPUUsageTimer 156 | Enabled = True 157 | Index = -2147483648 158 | LockedInPosition= False 159 | Mode = 2 160 | Period = 1000 161 | Scope = 0 162 | TabPanelIndex = 0 163 | End 164 | Begin WinAPILib.CommandLink CommandLink1 165 | AcceptFocus = False 166 | AcceptTabs = False 167 | AutoDeactivate = True 168 | Backdrop = 0 169 | DoubleBuffer = False 170 | Enabled = False 171 | Height = 60 172 | HelpTag = "" 173 | Index = -2147483648 174 | InitialParent = "" 175 | Left = 12 176 | LockBottom = False 177 | LockedInPosition= False 178 | LockLeft = True 179 | LockRight = False 180 | LockTop = True 181 | Scope = 1 182 | TabIndex = 6 183 | TabPanelIndex = 0 184 | TabStop = True 185 | Top = 266 186 | Transparent = True 187 | UseFocusRing = True 188 | Visible = True 189 | Width = 250 190 | End 191 | Begin DesktopButton FlashButton 192 | AutoDeactivate = True 193 | Bold = False 194 | ButtonStyle = 0 195 | Cancel = False 196 | Caption = "Flash" 197 | Default = False 198 | Enabled = True 199 | Height = 22 200 | HelpTag = "" 201 | Index = -2147483648 202 | InitialParent = "" 203 | Italic = False 204 | Left = 466 205 | LockBottom = False 206 | LockedInPosition= False 207 | LockLeft = True 208 | LockRight = False 209 | LockTop = True 210 | Scope = 0 211 | TabIndex = 7 212 | TabPanelIndex = 0 213 | TabStop = True 214 | TextFont = "System" 215 | TextSize = 0.0 216 | TextUnit = 0 217 | Top = 19 218 | Transparent = True 219 | Underline = False 220 | Visible = True 221 | Width = 114 222 | End 223 | Begin DesktopButton TopmostToggleButton 224 | AutoDeactivate = True 225 | Bold = False 226 | ButtonStyle = 0 227 | Cancel = False 228 | Caption = "Toggle Topmost" 229 | Default = False 230 | Enabled = True 231 | Height = 22 232 | HelpTag = "" 233 | Index = -2147483648 234 | InitialParent = "" 235 | Italic = False 236 | Left = 466 237 | LockBottom = False 238 | LockedInPosition= False 239 | LockLeft = True 240 | LockRight = False 241 | LockTop = True 242 | Scope = 0 243 | TabIndex = 8 244 | TabPanelIndex = 0 245 | TabStop = True 246 | TextFont = "System" 247 | TextSize = 0.0 248 | TextUnit = 0 249 | Top = 51 250 | Transparent = True 251 | Underline = False 252 | Visible = True 253 | Width = 114 254 | End 255 | Begin DesktopButton SystemInfoButton 256 | AutoDeactivate = True 257 | Bold = False 258 | ButtonStyle = 0 259 | Cancel = False 260 | Caption = "System Info" 261 | Default = False 262 | Enabled = True 263 | Height = 22 264 | HelpTag = "" 265 | Index = -2147483648 266 | InitialParent = "" 267 | Italic = False 268 | Left = 20 269 | LockBottom = False 270 | LockedInPosition= False 271 | LockLeft = True 272 | LockRight = False 273 | LockTop = True 274 | Scope = 2 275 | TabIndex = 9 276 | TabPanelIndex = 0 277 | TabStop = True 278 | TextFont = "System" 279 | TextSize = 0.0 280 | TextUnit = 0 281 | Top = 51 282 | Transparent = True 283 | Underline = False 284 | Visible = True 285 | Width = 107 286 | End 287 | Begin DesktopButton OSVersionButton 288 | AutoDeactivate = True 289 | Bold = False 290 | ButtonStyle = 0 291 | Cancel = False 292 | Caption = "OS Version Info" 293 | Default = False 294 | Enabled = True 295 | Height = 22 296 | HelpTag = "" 297 | Index = -2147483648 298 | InitialParent = "" 299 | Italic = False 300 | Left = 20 301 | LockBottom = False 302 | LockedInPosition= False 303 | LockLeft = True 304 | LockRight = False 305 | LockTop = True 306 | Scope = 0 307 | TabIndex = 10 308 | TabPanelIndex = 0 309 | TabStop = True 310 | TextFont = "System" 311 | TextSize = 0.0 312 | TextUnit = 0 313 | Top = 85 314 | Transparent = True 315 | Underline = False 316 | Visible = True 317 | Width = 107 318 | End 319 | Begin DesktopButton LaunchAndWaitButton 320 | AutoDeactivate = True 321 | Bold = False 322 | ButtonStyle = 0 323 | Cancel = False 324 | Caption = "Launch and Wait Notepad" 325 | Default = False 326 | Enabled = True 327 | Height = 22 328 | HelpTag = "" 329 | Index = -2147483648 330 | InitialParent = "" 331 | Italic = False 332 | Left = 412 333 | LockBottom = False 334 | LockedInPosition= False 335 | LockLeft = True 336 | LockRight = False 337 | LockTop = True 338 | Scope = 0 339 | TabIndex = 11 340 | TabPanelIndex = 0 341 | TabStop = True 342 | TextFont = "System" 343 | TextSize = 0.0 344 | TextUnit = 0 345 | Top = 85 346 | Transparent = True 347 | Underline = False 348 | Visible = True 349 | Width = 168 350 | End 351 | Begin DesktopButton SelectFolderButton 352 | AutoDeactivate = True 353 | Bold = False 354 | ButtonStyle = 0 355 | Cancel = False 356 | Caption = "Minimalistic Select Folder" 357 | Default = False 358 | Enabled = True 359 | Height = 22 360 | HelpTag = "" 361 | Index = -2147483648 362 | InitialParent = "" 363 | Italic = False 364 | Left = 412 365 | LockBottom = False 366 | LockedInPosition= False 367 | LockLeft = True 368 | LockRight = False 369 | LockTop = True 370 | Scope = 0 371 | TabIndex = 12 372 | TabPanelIndex = 0 373 | TabStop = True 374 | TextFont = "System" 375 | TextSize = 0.0 376 | TextUnit = 0 377 | Top = 119 378 | Transparent = True 379 | Underline = False 380 | Visible = True 381 | Width = 168 382 | End 383 | Begin DesktopCheckBox LimitSelectFolderCheckBox 384 | AutoDeactivate = True 385 | Bold = False 386 | Caption = "Limit to Favorites" 387 | Enabled = True 388 | Height = 20 389 | HelpTag = "" 390 | Index = -2147483648 391 | InitialParent = "" 392 | Italic = False 393 | Left = 412 394 | LockBottom = False 395 | LockedInPosition= False 396 | LockLeft = True 397 | LockRight = False 398 | LockTop = True 399 | Scope = 0 400 | State = 0 401 | TabIndex = 13 402 | TabPanelIndex = 0 403 | TabStop = True 404 | TextFont = "System" 405 | TextSize = 0.0 406 | TextUnit = 0 407 | Top = 153 408 | Transparent = True 409 | Underline = False 410 | Value = False 411 | Visible = True 412 | Width = 177 413 | End 414 | Begin DesktopButton SlideButton 415 | AutoDeactivate = True 416 | Bold = False 417 | ButtonStyle = 0 418 | Cancel = False 419 | Caption = "Slide" 420 | Default = False 421 | Enabled = True 422 | Height = 20 423 | HelpTag = "" 424 | Index = -2147483648 425 | InitialParent = "" 426 | Italic = False 427 | Left = 485 428 | LockBottom = False 429 | LockedInPosition= False 430 | LockLeft = True 431 | LockRight = False 432 | LockTop = True 433 | Scope = 2 434 | TabIndex = 14 435 | TabPanelIndex = 0 436 | TabStop = True 437 | TextFont = "System" 438 | TextSize = 0.0 439 | TextUnit = 0 440 | Top = 281 441 | Transparent = False 442 | Underline = False 443 | Visible = True 444 | Width = 95 445 | End 446 | Begin DesktopButton collapseButton 447 | AutoDeactivate = True 448 | Bold = False 449 | ButtonStyle = 0 450 | Cancel = False 451 | Caption = "Collapse" 452 | Default = False 453 | Enabled = True 454 | Height = 20 455 | HelpTag = "" 456 | Index = -2147483648 457 | InitialParent = "" 458 | Italic = False 459 | Left = 378 460 | LockBottom = False 461 | LockedInPosition= False 462 | LockLeft = True 463 | LockRight = False 464 | LockTop = True 465 | Scope = 2 466 | TabIndex = 15 467 | TabPanelIndex = 0 468 | TabStop = True 469 | TextFont = "System" 470 | TextSize = 0.0 471 | TextUnit = 0 472 | Top = 313 473 | Transparent = False 474 | Underline = False 475 | Visible = True 476 | Width = 95 477 | End 478 | Begin DesktopButton ExpandButton 479 | AutoDeactivate = True 480 | Bold = False 481 | ButtonStyle = 0 482 | Cancel = False 483 | Caption = "Expand" 484 | Default = False 485 | Enabled = True 486 | Height = 20 487 | HelpTag = "" 488 | Index = -2147483648 489 | InitialParent = "" 490 | Italic = False 491 | Left = 485 492 | LockBottom = False 493 | LockedInPosition= False 494 | LockLeft = True 495 | LockRight = False 496 | LockTop = True 497 | Scope = 2 498 | TabIndex = 16 499 | TabPanelIndex = 0 500 | TabStop = True 501 | TextFont = "System" 502 | TextSize = 0.0 503 | TextUnit = 0 504 | Top = 313 505 | Transparent = False 506 | Underline = False 507 | Visible = True 508 | Width = 95 509 | End 510 | Begin DesktopButton FadeButton 511 | AutoDeactivate = True 512 | Bold = False 513 | ButtonStyle = 0 514 | Cancel = False 515 | Caption = "Fade" 516 | Default = False 517 | Enabled = True 518 | Height = 20 519 | HelpTag = "" 520 | Index = -2147483648 521 | InitialParent = "" 522 | Italic = False 523 | Left = 378 524 | LockBottom = False 525 | LockedInPosition= False 526 | LockLeft = True 527 | LockRight = False 528 | LockTop = True 529 | Scope = 2 530 | TabIndex = 17 531 | TabPanelIndex = 0 532 | TabStop = True 533 | TextFont = "System" 534 | TextSize = 0.0 535 | TextUnit = 0 536 | Top = 345 537 | Transparent = False 538 | Underline = False 539 | Visible = True 540 | Width = 95 541 | End 542 | Begin DesktopButton RollButton 543 | AutoDeactivate = True 544 | Bold = False 545 | ButtonStyle = 0 546 | Cancel = False 547 | Caption = "Roll" 548 | Default = False 549 | Enabled = True 550 | Height = 20 551 | HelpTag = "" 552 | Index = -2147483648 553 | InitialParent = "" 554 | Italic = False 555 | Left = 378 556 | LockBottom = False 557 | LockedInPosition= False 558 | LockLeft = True 559 | LockRight = False 560 | LockTop = True 561 | Scope = 2 562 | TabIndex = 18 563 | TabPanelIndex = 0 564 | TabStop = True 565 | TextFont = "System" 566 | TextSize = 0.0 567 | TextUnit = 0 568 | Top = 280 569 | Transparent = False 570 | Underline = False 571 | Visible = True 572 | Width = 95 573 | End 574 | Begin DesktopLabel AnimateWindowLabel 575 | AutoDeactivate = True 576 | Bold = False 577 | Enabled = True 578 | Height = 20 579 | HelpTag = "" 580 | Index = -2147483648 581 | InitialParent = "" 582 | Italic = False 583 | Left = 378 584 | LockBottom = False 585 | LockedInPosition= False 586 | LockLeft = True 587 | LockRight = False 588 | LockTop = True 589 | Multiline = False 590 | Scope = 0 591 | Selectable = False 592 | TabIndex = 19 593 | TabPanelIndex = 0 594 | TabStop = True 595 | Text = "AnimateWindow Examples" 596 | TextAlign = 3 597 | TextColor = &c00000000 598 | TextFont = "System" 599 | TextSize = 0.0 600 | TextUnit = 0 601 | Top = 222 602 | Transparent = True 603 | Underline = False 604 | Visible = True 605 | Width = 202 606 | End 607 | Begin DesktopTextField animateSpeedTextfield 608 | AcceptTabs = False 609 | Alignment = 3 610 | AutoDeactivate = True 611 | AutomaticallyCheckSpelling= False 612 | BackColor = &cFFFFFF00 613 | Bold = False 614 | Border = True 615 | CueText = "" 616 | Enabled = True 617 | Format = "" 618 | Height = 22 619 | HelpTag = "" 620 | Index = -2147483648 621 | Italic = False 622 | Left = 378 623 | LimitText = 0 624 | LockBottom = False 625 | LockedInPosition= False 626 | LockLeft = True 627 | LockRight = False 628 | LockTop = True 629 | Mask = "" 630 | Password = False 631 | ReadOnly = False 632 | Scope = 0 633 | TabIndex = 20 634 | TabPanelIndex = 0 635 | TabStop = True 636 | Text = "80" 637 | TextColor = &c00000000 638 | TextFont = "System" 639 | TextSize = 0.0 640 | TextUnit = 0 641 | Top = 247 642 | Transparent = False 643 | Underline = False 644 | UseFocusRing = True 645 | Visible = True 646 | Width = 49 647 | End 648 | Begin DesktopLabel AnimateWindowSpeedLabel 649 | AutoDeactivate = True 650 | Bold = False 651 | Enabled = True 652 | Height = 20 653 | HelpTag = "" 654 | Index = -2147483648 655 | InitialParent = "" 656 | Italic = False 657 | Left = 439 658 | LockBottom = False 659 | LockedInPosition= False 660 | LockLeft = True 661 | LockRight = False 662 | LockTop = True 663 | Multiline = False 664 | Scope = 0 665 | Selectable = False 666 | TabIndex = 21 667 | TabPanelIndex = 0 668 | TabStop = True 669 | Text = "Speed (MS)" 670 | TextAlign = 0 671 | TextColor = &c00000000 672 | TextFont = "System" 673 | TextSize = 0.0 674 | TextUnit = 0 675 | Top = 248 676 | Transparent = True 677 | Underline = False 678 | Visible = True 679 | Width = 141 680 | End 681 | End 682 | #tag EndDesktopWindow 683 | 684 | #tag WindowCode 685 | #tag Property, Flags = &h0 686 | AnimationTestWindow As Animate_Window 687 | #tag EndProperty 688 | 689 | 690 | #tag EndWindowCode 691 | 692 | #tag Events ScreenCaptureButton 693 | #tag Event 694 | Sub Pressed() 695 | Var w As New ScreenCaptureWindow 696 | w.Show 697 | End Sub 698 | #tag EndEvent 699 | #tag EndEvents 700 | #tag Events OpacitySlider 701 | #tag Event 702 | Sub ValueChanged() 703 | Var newOpacity As CGFloat = Me.Value / Me.MaximumValue 704 | 705 | // Don't want to go 100% transparent since the user 706 | // couldn't change the value back! So limit it to 10%. 707 | newOpacity = Max(0.10, newOpacity) 708 | 709 | // Set the window's opacity 710 | // (Defined as an extension method for Window in WindowExtensions module.) 711 | WinAPILib.Window.SetOpacity(Self, newOpacity) 712 | End Sub 713 | #tag EndEvent 714 | #tag EndEvents 715 | #tag Events CPUUsageTimer 716 | #tag Event 717 | Sub Action() 718 | Var cpu As Integer = WinAPILib.SystemInfo.CPUUsage 719 | CPUUsageLabel.Text = "CPU Usage: " + cpu.ToString + "%" 720 | End Sub 721 | #tag EndEvent 722 | #tag EndEvents 723 | #tag Events CommandLink1 724 | #tag Event 725 | Sub Open() 726 | Me.SetText(Me.Name) 727 | Me.SetNote("Command note") 728 | 729 | End Sub 730 | #tag EndEvent 731 | #tag Event 732 | Sub Action() 733 | MessageBox("Action") 734 | End Sub 735 | #tag EndEvent 736 | #tag EndEvents 737 | #tag Events FlashButton 738 | #tag Event 739 | Sub Pressed() 740 | WinAPILib.Window.Flash(Self) 741 | End Sub 742 | #tag EndEvent 743 | #tag EndEvents 744 | #tag Events TopmostToggleButton 745 | #tag Event 746 | Sub Pressed() 747 | WinAPILib.Window.AlwaysTopmost(Self) = Not WinAPILib.Window.AlwaysTopmost(Self) 748 | 749 | End Sub 750 | #tag EndEvent 751 | #tag EndEvents 752 | #tag Events SystemInfoButton 753 | #tag Event 754 | Sub Pressed() 755 | Var w As New SystemInfoWindow 756 | w.Show 757 | End Sub 758 | #tag EndEvent 759 | #tag EndEvents 760 | #tag Events OSVersionButton 761 | #tag Event 762 | Sub Pressed() 763 | Var w As New OSVersionInfoWindow 764 | w.Show 765 | End Sub 766 | #tag EndEvent 767 | #tag EndEvents 768 | #tag Events LaunchAndWaitButton 769 | #tag Event 770 | Sub Pressed() 771 | Var notepad As FolderItem = SpecialFolder.Windows.Child("Notepad.exe") 772 | If notepad.Exists Then 773 | WinAPILib.FileIO.LaunchAndWait(notepad) 774 | MessageBox("Notepad closed.") 775 | End If 776 | End Sub 777 | #tag EndEvent 778 | #tag EndEvents 779 | #tag Events SelectFolderButton 780 | #tag Event 781 | Sub Pressed() 782 | Var d As New WinAPILib.SelectFolderDialog 783 | d.PromptText = "Find a folder" 784 | If LimitSelectFolderCheckBox.Value Then 785 | d.InitialDirectory = WinAPILib.SelectFolderDialog.RootFolders.CSIDL_FAVORITES 786 | End If 787 | Var f As FolderItem = d.ShowModal 788 | 789 | If f <> Nil Then MessageBox(f.NativePath) 790 | End Sub 791 | #tag EndEvent 792 | #tag EndEvents 793 | #tag Events SlideButton 794 | #tag Event 795 | Sub Pressed() 796 | #If TargetWindows Then 797 | // SLIDE EXAMPLE 798 | AnimationTestWindow = New Animate_Window 799 | AnimationTestWindow.Title = "Slide Window Example" 800 | 801 | Var animationTimeInt As Integer = animateSpeedTextfield.Text.ToDouble 802 | Var windowHandleInt As Ptr = AnimationTestWindow.Handle 803 | Var activateWindowInt As Integer = WinAPILib.AnimateWindow.AW_ACTIVATE 804 | Var slideEffectInt As Integer = WinAPILib.AnimateWindow.AW_HOR_POSITIVE 805 | 806 | Var activateInt As Integer = WinAPILib.AnimateWindow.AnimateWindow(windowHandleInt, animationTimeInt, activateWindowInt) 807 | Var resultInt As Integer = WinAPILib.AnimateWindow.AnimateWindow(windowHandleInt, animationTimeInt, slideEffectInt) 808 | #EndIf 809 | 810 | 811 | End Sub 812 | #tag EndEvent 813 | #tag EndEvents 814 | #tag Events collapseButton 815 | #tag Event 816 | Sub Pressed() 817 | #If TargetWindows Then 818 | // COLLAPSE EXAMPLE 819 | AnimationTestWindow = New Animate_Window 820 | AnimationTestWindow.Title = "Collapse Window Example" 821 | 822 | Var animationTimeInt As Integer = animateSpeedTextfield.Text.ToDouble 823 | Var windowHandleInt As Ptr = AnimationTestWindow.Handle 824 | Var activateWindowInt As Integer = WinAPILib.AnimateWindow.AW_ACTIVATE 825 | Var collapseInt As Integer = WinAPILib.AnimateWindow.AW_HIDE 826 | 827 | Var activateInt As Integer = WinAPILib.AnimateWindow.AnimateWindow(windowHandleInt, animationTimeInt, activateWindowInt) 828 | Var resultInt As Integer = WinAPILib.AnimateWindow.AnimateWindow(windowHandleInt, animationTimeInt, collapseInt) 829 | #EndIf 830 | 831 | End Sub 832 | #tag EndEvent 833 | #tag EndEvents 834 | #tag Events ExpandButton 835 | #tag Event 836 | Sub Pressed() 837 | #If TargetWindows Then 838 | // EXPAND EXAMPLE 839 | AnimationTestWindow = New Animate_Window 840 | AnimationTestWindow.Title = "Expand Window Example" 841 | 842 | Var animationTimeInt As Integer = animateSpeedTextfield.Text.ToDouble 843 | Var windowHandleInt As Ptr = AnimationTestWindow.Handle 844 | Var activateWindowInt As Integer = WinAPILib.AnimateWindow.AW_ACTIVATE 845 | Var expandEffectInt As Integer = WinAPILib.AnimateWindow.AW_CENTER 846 | 847 | Var activateInt As Integer = WinAPILib.AnimateWindow.AnimateWindow(windowHandleInt, animationTimeInt, activateWindowInt) 848 | Var resultInt As Integer = WinAPILib.AnimateWindow.AnimateWindow(windowHandleInt, animationTimeInt, expandEffectInt) 849 | #EndIf 850 | 851 | 852 | End Sub 853 | #tag EndEvent 854 | #tag EndEvents 855 | #tag Events FadeButton 856 | #tag Event 857 | Sub Pressed() 858 | #If TargetWindows Then 859 | // FADE EXAMPLE 860 | AnimationTestWindow = New Animate_Window 861 | AnimationTestWindow.Title = "Fade Window Example" 862 | 863 | Var animationTimeInt As Integer = animateSpeedTextfield.Text.ToDouble 864 | Var windowHandleInt As Ptr = AnimationTestWindow.Handle 865 | Var activateWindowInt As Integer = WinAPILib.AnimateWindow.AW_ACTIVATE 866 | Var fadeEffectInt As Integer = WinAPILib.AnimateWindow.AW_BLEND 867 | 868 | Var activateInt As Integer = WinAPILib.AnimateWindow.AnimateWindow(windowHandleInt, animationTimeInt, activateWindowInt) 869 | Var resultInt As Integer = WinAPILib.AnimateWindow.AnimateWindow(windowHandleInt, animationTimeInt, fadeEffectInt) 870 | #EndIf 871 | 872 | 873 | End Sub 874 | #tag EndEvent 875 | #tag EndEvents 876 | #tag Events RollButton 877 | #tag Event 878 | Sub Pressed() 879 | #If TargetWindows Then 880 | // ROLL EXAMPLE 881 | AnimationTestWindow = New Animate_Window 882 | AnimationTestWindow.Title = "Roll Window Example" 883 | 884 | Var animationTimeInt As Integer = animateSpeedTextfield.Text.ToDouble 885 | Var windowHandleInt As Ptr = AnimationTestWindow.Handle 886 | Var activateWindowInt As Integer = WinAPILib.AnimateWindow.AW_ACTIVATE 887 | Var rollEffectInt As Integer = WinAPILib.AnimateWindow.AW_HOR_NEGATIVE 888 | 889 | Var activateInt As Integer = WinAPILib.AnimateWindow.AnimateWindow(windowHandleInt, animationTimeInt, activateWindowInt) 890 | Var resultInt As Integer = WinAPILib.AnimateWindow.AnimateWindow(windowHandleInt, animationTimeInt, rollEffectInt) 891 | #EndIf 892 | 893 | End Sub 894 | #tag EndEvent 895 | #tag EndEvents 896 | #tag Events animateSpeedTextfield 897 | #tag Event 898 | Function KeyDown(key As String) As Boolean 899 | // ONLY ALLOW DIGITS 900 | Select Case Asc(Key) 901 | Case 8 902 | // ALLOW BACKSPACE 903 | 904 | Case 10, 13 905 | // ALLOW ENTER 906 | 907 | Case 48 to 57 908 | // ALLOW NUMBERS 909 | 910 | Else 911 | // BLOCK THE REST 912 | Return True 913 | 914 | End Select 915 | End Function 916 | #tag EndEvent 917 | #tag EndEvents 918 | #tag ViewBehavior 919 | #tag ViewProperty 920 | Name="MinimumWidth" 921 | Visible=true 922 | Group="Size" 923 | InitialValue="64" 924 | Type="Integer" 925 | EditorType="" 926 | #tag EndViewProperty 927 | #tag ViewProperty 928 | Name="MinimumHeight" 929 | Visible=true 930 | Group="Size" 931 | InitialValue="64" 932 | Type="Integer" 933 | EditorType="" 934 | #tag EndViewProperty 935 | #tag ViewProperty 936 | Name="MaximumWidth" 937 | Visible=true 938 | Group="Size" 939 | InitialValue="32000" 940 | Type="Integer" 941 | EditorType="" 942 | #tag EndViewProperty 943 | #tag ViewProperty 944 | Name="MaximumHeight" 945 | Visible=true 946 | Group="Size" 947 | InitialValue="32000" 948 | Type="Integer" 949 | EditorType="" 950 | #tag EndViewProperty 951 | #tag ViewProperty 952 | Name="Type" 953 | Visible=true 954 | Group="Frame" 955 | InitialValue="0" 956 | Type="Types" 957 | EditorType="Enum" 958 | #tag EnumValues 959 | "0 - Document" 960 | "1 - Movable Modal" 961 | "2 - Modal Dialog" 962 | "3 - Floating Window" 963 | "4 - Plain Box" 964 | "5 - Shadowed Box" 965 | "6 - Rounded Window" 966 | "7 - Global Floating Window" 967 | "8 - Sheet Window" 968 | "9 - Metal Window" 969 | "11 - Modeless Dialog" 970 | #tag EndEnumValues 971 | #tag EndViewProperty 972 | #tag ViewProperty 973 | Name="HasCloseButton" 974 | Visible=true 975 | Group="Frame" 976 | InitialValue="True" 977 | Type="Boolean" 978 | EditorType="" 979 | #tag EndViewProperty 980 | #tag ViewProperty 981 | Name="HasMaximizeButton" 982 | Visible=true 983 | Group="Frame" 984 | InitialValue="True" 985 | Type="Boolean" 986 | EditorType="" 987 | #tag EndViewProperty 988 | #tag ViewProperty 989 | Name="HasMinimizeButton" 990 | Visible=true 991 | Group="Frame" 992 | InitialValue="True" 993 | Type="Boolean" 994 | EditorType="" 995 | #tag EndViewProperty 996 | #tag ViewProperty 997 | Name="HasFullScreenButton" 998 | Visible=true 999 | Group="Frame" 1000 | InitialValue="False" 1001 | Type="Boolean" 1002 | EditorType="" 1003 | #tag EndViewProperty 1004 | #tag ViewProperty 1005 | Name="DefaultLocation" 1006 | Visible=true 1007 | Group="Behavior" 1008 | InitialValue="0" 1009 | Type="Locations" 1010 | EditorType="Enum" 1011 | #tag EnumValues 1012 | "0 - Default" 1013 | "1 - Parent Window" 1014 | "2 - Main Screen" 1015 | "3 - Parent Window Screen" 1016 | "4 - Stagger" 1017 | #tag EndEnumValues 1018 | #tag EndViewProperty 1019 | #tag ViewProperty 1020 | Name="HasBackgroundColor" 1021 | Visible=true 1022 | Group="Background" 1023 | InitialValue="False" 1024 | Type="Boolean" 1025 | EditorType="" 1026 | #tag EndViewProperty 1027 | #tag ViewProperty 1028 | Name="BackgroundColor" 1029 | Visible=true 1030 | Group="Background" 1031 | InitialValue="&hFFFFFF" 1032 | Type="Color" 1033 | EditorType="Color" 1034 | #tag EndViewProperty 1035 | #tag ViewProperty 1036 | Name="Backdrop" 1037 | Visible=true 1038 | Group="Background" 1039 | InitialValue="" 1040 | Type="Picture" 1041 | EditorType="" 1042 | #tag EndViewProperty 1043 | #tag ViewProperty 1044 | Name="Composite" 1045 | Visible=false 1046 | Group="OS X (Carbon)" 1047 | InitialValue="False" 1048 | Type="Boolean" 1049 | EditorType="" 1050 | #tag EndViewProperty 1051 | #tag ViewProperty 1052 | Name="FullScreen" 1053 | Visible=false 1054 | Group="Behavior" 1055 | InitialValue="False" 1056 | Type="Boolean" 1057 | EditorType="" 1058 | #tag EndViewProperty 1059 | #tag ViewProperty 1060 | Name="Height" 1061 | Visible=true 1062 | Group="Size" 1063 | InitialValue="400" 1064 | Type="Integer" 1065 | EditorType="" 1066 | #tag EndViewProperty 1067 | #tag ViewProperty 1068 | Name="ImplicitInstance" 1069 | Visible=true 1070 | Group="Behavior" 1071 | InitialValue="True" 1072 | Type="Boolean" 1073 | EditorType="" 1074 | #tag EndViewProperty 1075 | #tag ViewProperty 1076 | Name="Interfaces" 1077 | Visible=true 1078 | Group="ID" 1079 | InitialValue="" 1080 | Type="String" 1081 | EditorType="" 1082 | #tag EndViewProperty 1083 | #tag ViewProperty 1084 | Name="MacProcID" 1085 | Visible=false 1086 | Group="OS X (Carbon)" 1087 | InitialValue="0" 1088 | Type="Integer" 1089 | EditorType="" 1090 | #tag EndViewProperty 1091 | #tag ViewProperty 1092 | Name="MenuBar" 1093 | Visible=true 1094 | Group="Menus" 1095 | InitialValue="" 1096 | Type="MenuBar" 1097 | EditorType="" 1098 | #tag EndViewProperty 1099 | #tag ViewProperty 1100 | Name="MenuBarVisible" 1101 | Visible=false 1102 | Group="Behavior" 1103 | InitialValue="True" 1104 | Type="Boolean" 1105 | EditorType="" 1106 | #tag EndViewProperty 1107 | #tag ViewProperty 1108 | Name="Name" 1109 | Visible=true 1110 | Group="ID" 1111 | InitialValue="" 1112 | Type="String" 1113 | EditorType="" 1114 | #tag EndViewProperty 1115 | #tag ViewProperty 1116 | Name="Resizeable" 1117 | Visible=true 1118 | Group="Frame" 1119 | InitialValue="True" 1120 | Type="Boolean" 1121 | EditorType="" 1122 | #tag EndViewProperty 1123 | #tag ViewProperty 1124 | Name="Super" 1125 | Visible=true 1126 | Group="ID" 1127 | InitialValue="" 1128 | Type="String" 1129 | EditorType="" 1130 | #tag EndViewProperty 1131 | #tag ViewProperty 1132 | Name="Title" 1133 | Visible=true 1134 | Group="Frame" 1135 | InitialValue="Untitled" 1136 | Type="String" 1137 | EditorType="" 1138 | #tag EndViewProperty 1139 | #tag ViewProperty 1140 | Name="Visible" 1141 | Visible=true 1142 | Group="Behavior" 1143 | InitialValue="True" 1144 | Type="Boolean" 1145 | EditorType="" 1146 | #tag EndViewProperty 1147 | #tag ViewProperty 1148 | Name="Width" 1149 | Visible=true 1150 | Group="Size" 1151 | InitialValue="600" 1152 | Type="Integer" 1153 | EditorType="" 1154 | #tag EndViewProperty 1155 | #tag EndViewBehavior 1156 | --------------------------------------------------------------------------------