Skip to content

Commit

Permalink
push v2 instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
NarodGaming committed Sep 30, 2022
1 parent 291c33b commit f15481f
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 17 deletions.
43 changes: 43 additions & 0 deletions README-v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Narod's Game Detector
A .NET library written in VB.NET to detect full screen applications and games.

## Summary
Searches for on-screen fullscreen windows on the currently focussed screen. Will return a List(Of Object).

## Usage (V2)
V1 has been replaced by V2. If you're using 2.0.0 or newer, please [take a look here for instructions.](https://github.com/NarodGaming/gamedetector/blob/main/README.md)

## Usage (V1)
Code examples in VB.NET
- Download the 1.2.0 release from the releases tab, or find in the NuGet package manager ([Narod.FullscreenDetector](https://www.nuget.org/packages/Narod.FullscreenDetector))
- (Only required if downloaded from releases) Add a reference of the library in your project. (Project -> Add Reference... -> Browse -> Browse...)
- Import in to your program
```vb.net
Imports FullScreenDetection
```
- Create instance of FullscreenDetecter
```vb.net
Dim FullscreenDetectClient as New FullscreenDetecter
```
- Call with either the DetectFullscreenApplication function, or DetectGameFullscreen.
```vb.net
Dim detectionappresponse As List(Of Object) = FullscreenDetectClient.DetectFullscreenApplication()
Dim detectiongameresponse As List(Of Object) = FullscreenDetectClient.DetectGameFullscreen()
Dim customappresponse As List(Of Object) = FullscreenDetectClient.DetectCustomFullscreen("(partial/complete)-window-title-of-application-here")
```

Both functions will return the a list of objects:
* Position 0 is a boolean, which will be True if it successfully detected something, or False if not.
* Position 1 is a string, with the window text of the program detected (if detected, otherwise no item added)
* Position 2 is a UInteger, with the process PID of the program detected (if detected, otherwise no item added)

DetectFullscreenApplication will return any full screen application.
DetectGameFullscreen will filter out select programs that checks are in place for (e.g. web browsers).

## Further Help
Please see my video here: https://www.youtube.com/watch?v=BfuTOI5MK0A

## Helping
I'm not accepting updates or issues for V1.

You'll need to update to V2, please [take a look here for how to migrate.](https://github.com/NarodGaming/gamedetector/blob/main/v1-to-v2.md)
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,36 @@
A .NET library written in VB.NET to detect full screen applications and games.

## Summary
Searches for on-screen fullscreen windows on the currently focussed screen. Will return a List(Of Object).
Searches for on-screen fullscreen windows on the currently focussed screen.

## Usage
## Usage (V1)
V1 has been replaced by V2. If you're still using 1.2.0 or older, please [take a look here for instructions.](https://github.com/NarodGaming/gamedetector/blob/main/README-v1.md)

## Usage (V2)
Code examples in VB.NET
- Download the latest release from the releases tab, or find in the NuGet package manager ([Narod.FullscreenDetector](https://www.nuget.org/packages/Narod.FullscreenDetector))
- (Only required if downloaded from releases) Add a reference of the library in your project. (Project -> Add Reference... -> Browse -> Browse...)
- Import in to your program
```vb.net
Imports FullScreenDetection
Imports Narod.FullscreenDetection
```
- Create instance of FullscreenDetecter
```vb.net
Dim FullscreenDetectClient as New FullscreenDetecter
Dim FullscreenDetectClient As New FullscreenDetector
```
- Call with either the DetectFullscreenApplication function, or DetectGameFullscreen.
- Call with the DetectFullscreenApplication function.
```vb.net
Dim detectionappresponse As List(Of Object) = FullscreenDetectClient.DetectFullscreenApplication()
Dim detectiongameresponse As List(Of Object) = FullscreenDetectClient.DetectGameFullscreen()
Dim customappresponse As List(Of Object) = FullscreenDetectClient.DetectCustomFullscreen("(partial/complete)-window-title-of-application-here")
FullscreenDetectClient.DetectFullscreenApplication()
```
- Get output
```vb.net
Dim hasDetectedFullscreenApplication as Boolean = FullscreenDetectClient.GetHasDetected()
Dim programNameDetected As String = FullscreenDetectClient.GetProgramDetected() // throws nullreferenceexception if GetHasDetected is False
Dim processIDDetected As UInteger = FullscreenDetectClient.GetProcessIDDetected() // throws nullreferenceexception if GetHasDetected is False
```

Both functions will return the a list of objects:
* Position 0 is a boolean, which will be True if it successfully detected something, or False if not.
* Position 1 is a string, with the window text of the program detected (if detected, otherwise no item added)
* Position 2 is a UInteger, with the process PID of the program detected (if detected, otherwise no item added)

DetectFullscreenApplication will return any full screen application.
DetectGameFullscreen will filter out select programs that checks are in place for (e.g. web browsers).

## Further Help
Please see my video here: https://www.youtube.com/watch?v=BfuTOI5MK0A
I'll release a video at some point detailing how to use V2. My current video is for V1 which is significantly different, so those instructions won't work.

## Helping
If you find any bugs, please report it as an issue.
Expand Down
65 changes: 65 additions & 0 deletions v1-to-v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# V1 to V2
Here's a list of the important changes from V1 to V2 to help you migrate.

All code examples are in VB.NET

## Namespace change

In V1, you used to import:
```vb.net
Imports FullScreenDetection
```

In V2, you now import:
```vb.net
Imports Narod.FullscreenDetection
```

## Object name change

In V1, you used to create an object instance like:
```vb.net
Dim FullscreenDetectClient as New FullscreenDetecter
```

In V2, you now create an object instance like:
```vb.net
Dim FullscreenDetectClient As New FullscreenDetector
```

## Change from 2D list to clean getters

In V1, you got an output from the function directly like:
```vb.net
Dim detectionappresponse As List(Of Object) = FullscreenDetectClient.DetectFullscreenApplication()
```

In V2, you now get an output like:
```vb.net
FullscreenDetectClient.DetectFullscreenApplication()

Dim hasDetectedFullscreenApplication as Boolean = FullscreenDetectClient.GetHasDetected()
Dim programNameDetected As String = FullscreenDetectClient.GetProgramDetected() // throws nullreferenceexception if GetHasDetected is False
Dim processIDDetected As UInteger = FullscreenDetectClient.GetProcessIDDetected() // throws nullreferenceexception if GetHasDetected is False
```

## Removal of functions

In V1, you could use any of the following functions:
```vb.net
Dim detectionappresponse As List(Of Object) = FullscreenDetectClient.DetectFullscreenApplication()
Dim detectiongameresponse As List(Of Object) = FullscreenDetectClient.DetectGameFullscreen()
Dim customappresponse As List(Of Object) = FullscreenDetectClient.DetectCustomFullscreen("(partial/complete)-window-title-of-application-here")
```

In V2, you can now only use the following function:
```vb.net
FullScreenDetectClient.DetectFullscreenApplication()
```

You should instead check the program title yourself within your own program to see if it's what you are looking for. This way you don't even need to store it locally, should you wish:
```vb.net
If (FullScreenDetectClient.GetProgramDetected() = "Google Chrome") Then
Console.WriteLine("Google Chrome detected!")
End If
```

0 comments on commit f15481f

Please sign in to comment.