-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bd565a9
Showing
7 changed files
with
1,177 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.obj | ||
*.*proj.user | ||
*.pdb | ||
/Debug/ | ||
/Release/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Task tray button | ||
|
||
Displays a button on the task tray, by shrinking the window list and positioning itself between that and the | ||
notification area. | ||
|
||
The taskbar is a window, having child windows like this: | ||
|
||
[start][search][windows ][icons|clock] | ||
|
||
|
||
The tray button is just another child window, inserted between the window list and icons: | ||
|
||
[start][search][windows ][button][icons|clock] | ||
|
||
|
||
This was extracted from the original Morphic application, [gpii-app/trayButton](https://github.com/GPII/gpii-app/tree/master/trayButton). | ||
|
||
## Build | ||
|
||
Run `build.ps1`, or use Visual Studio. | ||
|
||
## Operation | ||
|
||
### Control | ||
|
||
It is controlled by the parent process via standard input, with the following commands: | ||
|
||
Set the icon to `file`: | ||
|
||
ICON file | ||
|
||
Set the high-contrast icon to `file`: | ||
|
||
ICON_HC file | ||
|
||
Set the tooltip `text`: | ||
|
||
TOOLTIP text | ||
|
||
Specify a window handle `hwnd` belonging to the parent process, to focus when the button is clicked: | ||
|
||
HWND hwnd | ||
|
||
Set the checked state to `bool`: | ||
|
||
STATE bool | ||
|
||
Remove the icon, re-adjust the taskbar, and end the process: | ||
|
||
DESTROY | ||
|
||
### Events | ||
|
||
The tray-button process will produce the following notifications on its standard output: | ||
|
||
* `CLICK`: The left button is clicked. | ||
* `SHOWMENU`: The right button is clicked. | ||
* `MOUSEENTER`, `MOUSELEAVE`: The mouse cursor has entered or left the button. | ||
* `POSITION MAKELONG(x,y) MAKELONG(w,h): Position of the button has changed. | ||
* `UPDATE`: Configuration is required. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
powershell -ExecutionPolicy ByPass "%~dp0\build.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Function Get-MSBuild { | ||
Param ( | ||
[Parameter(Mandatory=$true)] | ||
[string] $version | ||
) | ||
|
||
# TODO: Check version validity. | ||
# Valid versions are [2.0, 3.5, 4.0] | ||
|
||
$dotNetVersion = $version | ||
$regKey = "HKLM:\software\Microsoft\MSBuild\ToolsVersions\$dotNetVersion" | ||
$regProperty = "MSBuildToolsPath" | ||
|
||
$msbuild = Join-Path -path (Get-ItemPropertyweb.tw $regKey).$regProperty -childpath "msbuild.exe" | ||
|
||
return $msbuild | ||
} | ||
|
||
|
||
$msbuild = Get-MSBuild "4.0" | ||
Start-Process -FilePath $msbuild -ArgumentList "tray-button.vcxproj /p:Configuration=Release" -PassThru -NoNewWindow |
Oops, something went wrong.