Skip to content

Commit

Permalink
Snapshot: v0.4, Mar 31 2011
Browse files Browse the repository at this point in the history
  • Loading branch information
mazmazz committed Feb 16, 2019
1 parent 7c9db93 commit f012358
Show file tree
Hide file tree
Showing 22 changed files with 351 additions and 120 deletions.
77 changes: 64 additions & 13 deletions Common/Defaults/Defaults/AHK/JLE_Common.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#NoTrayIcon
SetTitleMatchMode, 2
DetectHiddenWindows, On
DllCall("Wow64DisableWow64FsRedirection", "uint*", OldValue) ; Disables WOW64 redirection on x64. No more needing Sysnative! IT'S ALL SYSTEM32!


Expand Down Expand Up @@ -100,7 +101,7 @@ JLE_GetMostRecentWindow(processName, processWindowName = "", processWindowClass
WinGet, windowList, List, %processWindowName%
}

Loop { ; Loop through each entry of windowList
Loop, %windowList% { ; Loop through each entry of windowList
if windowList%A_Index% <= 0 ; Does array entry not exist?
break

Expand All @@ -127,22 +128,72 @@ JLE_GetMostRecentWindow(processName, processWindowName = "", processWindowClass
; Activates window, and then sends keystrokes to it
; Note: Window must be activated to receive keystrokes.
; Params: windowHandle -- Window to receive keystrokes
; keystroke -- Keystrokes in "Send" format, e.g. ^o ==> Ctrl+O; ^!{Del} ==> Ctrl+Alt+Del
; keystroke -- Keystrokes in "Send" format, e.g. ^o ==> Ctrl+O; ^!{Del} ==> Ctrl+Alt+Del
; background --
; Returns: 1 -- Keystroke successfully sent to window
; 0 -- Window could not be activated
JLE_SendKeystrokeToWindow(windowHandle, keystroke)
JLE_SendKeystrokeToWindow(windowHandle, keystroke, background = 0)
{
; Activate most recent window
WinActivate, ahk_id %windowHandle%

; Wait for most recent window to become active. Send keystroke.
; After 5 seconds, stop trying.
WinWaitActive, ahk_id %windowHandle%, , 5
if(ErrorLevel) {
return 0
; if background = 0 or 2, then activate the normal way
; if background = 2, minimize afterward. a "psuedo-background" keystroke, if you will
if(background != 1) {
if(background = 2) {
; Get the hwnd of the currently active window, for background=2.
DetectHiddenWindows, Off
WinGet, windowList, List
DetectHiddenWindows, On

; Get windowHandle of array entry. Check its process name for a match
Loop, %windowList% {
if(A_Index < 3) {
continue ; I'm positive that the winList goes Start, Taskbar, Last Active Window.
}
currentWindowHandle := windowList%A_Index%

WinGet, currentWindowMinimized, MinMax, ahk_id %currentWindowHandle%
;WinGetTitle, currentWindowTitle, ahk_id %currentWindowHandle% ;debug
;WinGet, currentWindowProcessName, ProcessName, ahk_id %currentWindowHandle% ;debug, might be useful
;Msgbox, %currentWindowMinimized%|%currentWindowTitle%|%currentWindowProcessName%

if(currentWindowMinimized > -1) {
break
}
}

currentActiveHwnd := currentWindowHandle
}

; Also get the minimized state of the program window
WinGet, windowMinimized, MinMax, ahk_id %windowHandle%

; Activate most recent window
WinActivate, ahk_id %windowHandle%

; Wait for most recent window to become active. Send keystroke.
; After 5 seconds, stop trying.
WinWaitActive, ahk_id %windowHandle%, , 5
if(ErrorLevel) {
return 0
} else {
Send %keystroke%

if(background = 2) {
if(windowMinimized = -1) {
WinMinimize, ahk_id %windowHandle%
} else if(currentActiveHwnd != windowHandle) {
WinActivate, ahk_id %currentActiveHwnd%
}
}
return 1
}
} else {
Send %keystroke%
return 1
; Use ControlSend to send keystroke in background. Hit-and-miss: does not work with all programs.
ControlSend, , %keystroke%, ahk_id %windowHandle%
if(ErrorLevel) {
return 0
} else {
return 1
}
}

return 0
Expand Down
3 changes: 2 additions & 1 deletion Common/Defaults/Defaults/Templates/Keyboard.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ JLE_AppWindowClassName := "{AppWindowClassName}"
JLE_StartNewProcess := {KBDStartNewProcess}
JLE_KBDIgnoreAbsent := {KBDIgnoreAbsent}
JLE_KBDIgnoreCurrent := {KBDIgnoreCurrent}
JLE_KBDSendBackground := {KBDSendBackground}

; Keystroke is below, on JLE_SendKeystrokeToWindow()

Expand All @@ -31,4 +32,4 @@ if(RecentWindow <= 0)
exit

; Send keystroke!
JLE_SendKeystrokeToWindow(RecentWindow, "{Keystroke}")
JLE_SendKeystrokeToWindow(RecentWindow, "{Keystroke}", JLE_KBDSendBackground)
24 changes: 24 additions & 0 deletions NSISInstaller/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
If you are upgrading or reinstalling, close the Jumplist Extender tray icon first.

===VERSION 0.4===
Version 0.4 is a '''MINOR BUG FIX''' release.

''FIXED:''
* Command line tasks and EXE shortcuts were being executed with the wrong working directory.
* Jump List Packs could not be imported because the "AppData\...\Icons\Imported" folder was missing.

''ADDED:''
* Keystrokes can now be sent to minimized/background windows without activating them.

''KNOWN ISSUES:''
* Recent/Frequent lists are not supported (yet).
* Small icons are not extracted from EXE files; only big ones.
* More at http://code.google.com/p/jumplist-extender/issues/list

===VERSION 0.3-B===
Version 0.3-B is a '''MINOR BUG FIX''' release.

''FIXED:''
* Log files were being made in the desktop by accident.

===VERSION 0.3===
Version 0.3 is a '''MAJOR BUG FIX''' release.

Expand All @@ -8,6 +29,9 @@ Version 0.3 is a '''MAJOR BUG FIX''' release.
* Broken update check would display weird code in the menus.
* Old web links were broken.

''KNOWN ISSUES:''
* Recent/Frequent lists are not supported (yet).

===Version 0.2-C===
Version 0.2-C is a '''MINOR BUG FIX''' release.

Expand Down
12 changes: 6 additions & 6 deletions NSISInstaller/MainInstall.iss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[Setup]
OutputBaseFilename=JumplistExtender_v0.3
VersionInfoVersion=0.3.0
VersionInfoProductVersion=0.3.0
AppVerName=Version 0.3
AppVersion=0.3
OutputBaseFilename=JumplistExtender_v0.4
VersionInfoVersion=0.4.0
VersionInfoProductVersion=0.4.0
AppVerName=Jumplist Extender v0.4
AppVersion=0.4
VersionInfoCompany=Marco Zafra
VersionInfoDescription=A custom jumplist creator for any program on Windows 7
VersionInfoDescription=A custom jump list creator for any program on Windows 7
VersionInfoCopyright=Released under GPLv3
Compression=lzma/ultra64
VersionInfoProductName=Jumplist Extender
Expand Down
4 changes: 3 additions & 1 deletion NSISInstaller/Primary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ private void InstallJLE()
}
else
{
// Do we want to keep prefs for a donate code?
Common.WritePref("InstallUpgrade", true.ToString()
, "DonateDialogDisable", false.ToString());
, "DonateDialogDisable", false.ToString()
, "DonateBalloonDisable", false.ToString());
}

// Write library
Expand Down
12 changes: 11 additions & 1 deletion T7EBackground/Primary.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 18 additions & 8 deletions T7EBackground/Primary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ public Primary()
this.Icon = PrimaryIcon;
TrayIcon.Icon = PrimaryIcon;
//MessageBox.Show("fucik");
#if DEBUG
LogTxtFile = new StreamWriter(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "T7EBackgroundLog_"+DateTime.Now.Hour.ToString()+DateTime.Now.Minute.ToString()+DateTime.Now.Second.ToString()+".txt"));
#endif
//MessageBox.Show("fidld");
CommonLog("Starting T7EBackground Primary Form", 1);

Expand Down Expand Up @@ -155,12 +157,14 @@ public Primary()
HookAppList();
CommonLog("Finished starting hooks");

TrayIconPath = Common.WebPath_DonateSite;

// Hook the update timer -- every 24 hours
CommonLog("Starting update check sequence");
CheckUpdateString();
StartUpdateTimer();
CommonLog("Finished update check sequence");

DonateTimer.Start();

CommonLog("Finished Primary Form start-up.", 0);
Expand Down Expand Up @@ -286,7 +290,7 @@ private void CheckUpdateString(bool download)
versionCheckParts.Length >= 3 ? versionCheckParts[2]
: versionCheckParts[0].Substring(0, 3));
TrayIcon.BalloonTipText = "Click to download.";
TrayIconPath = Common.WebPath_UpdateUrl;
TrayIconPath = versionCheckParts[1];
UpdatePath = versionCheckParts[1];
TrayIcon.ShowBalloonTip(1000); // Show for 10 seconds; msdn default
}
Expand Down Expand Up @@ -322,13 +326,13 @@ private void ShowDonateBalloon()
bool.TryParse(Common.ReadPref("InstallUpgrade"), out installUpgrade);
if ((DateTime.Today - installDate).Days >= 3 || installUpgrade == true)
{
bool donateDialogDisable = false;
bool.TryParse(Common.ReadPref("DonateDialogDisable"), out donateDialogDisable);
if (!donateDialogDisable)
bool donateBalloonDisable = false;
bool.TryParse(Common.ReadPref("DonateBalloonDisable"), out donateBalloonDisable);
if (!donateBalloonDisable)
{
TrayIcon.BalloonTipIcon = ToolTipIcon.Info;
TrayIcon.BalloonTipTitle = "Please consider donating";
TrayIcon.BalloonTipText = "Jumplist Extender may have been very helpful to you, and I'm a struggling student who worked hard on it. Why not donate to help me out?\r\n\r\nIt costs less than an average meal, and you'll also help me make Extender even better. Thank you for your help!\r\n(This alert can be disabled in the Settings, under \"Tools\".)";
TrayIcon.BalloonTipText = "Jumplist Extender may have been very helpful to you, and I'm a struggling student who worked hard on it. Why not donate to help me out?\r\n\r\nIt costs less than an average meal, and you'll also help me make Extender even better. Thank you for your help!";
TrayIconPath = Common.WebPath_DonateSite;
TrayIcon.ShowBalloonTip(1000); // Show for 10 seconds; msdn default
Common.WritePref("DonateBalloonShown", true.ToString());
Expand Down Expand Up @@ -435,8 +439,9 @@ private void Primary_FormClosing(object sender, FormClosingEventArgs e)
CommonLog("Received cleanup signal from Primary_FormClosing: Starting cleanup");
CleanUp();
CommonLog("Finished cleanup; passing to FormClosing to close app");
#if DEBUG
LogTxtFile.Close();

#endif
}

/// <summary>
Expand Down Expand Up @@ -485,7 +490,7 @@ static public void CommonLog(string messageString, int logChange)

static public void CommonLog(string messageString, int logChange, bool followingLine)
{
#if RELEASE
#if (!DEBUG)
return;
#endif
if (messageString.Length > 0)
Expand Down Expand Up @@ -513,5 +518,10 @@ private void DonateTimer_Tick(object sender, EventArgs e)
DonateTimer.Stop();
ShowDonateBalloon();
}

private void donateToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start("explorer.exe", "\"" + Common.WebPath_DonateSite + "\"");
}
}
}
6 changes: 3 additions & 3 deletions T7EBackground/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Jumplist Extender Background Process")]
[assembly: AssemblyDescription("Assigns custom jumplists to any program on Windows 7.")]
[assembly: AssemblyDescription("Detects user programs and assigns jump lists to them.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Marco Zafra")]
[assembly: AssemblyProduct("Jumplist Extender")]
Expand All @@ -29,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.3.*")]
[assembly: AssemblyFileVersion("0.3.0.0")]
[assembly: AssemblyVersion("0.4.*")]
[assembly: AssemblyFileVersion("0.4.0.0")]
10 changes: 5 additions & 5 deletions T7ECommon/Logging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public partial class Common
static string MailUserName = "jumplist.extender@gmail.com";
static string MailPassword = ""; //This must be filled in
static string MailRecipient = "digimarco35@yahoo.com";
static string MailVersion = "v0.3";
static string MailVersion = "v0.4";

static public void SendExceptionLog(Exception e)
{
Expand Down Expand Up @@ -54,7 +54,7 @@ static public void SendExceptionLog(Exception e, string appName, string appPath,
MailAddress fromAddress = new MailAddress(Common.MailUserName,
"JLE "
+ MailVersion
+ " Exception: " + Environment.UserName);
+ ": " + Environment.UserName);
MailAddress toAddress = new MailAddress(Common.MailRecipient, "JLE Developer");
string fromPassword = Common.MailPassword;
string subject = "JLEx: " + e.Message;
Expand Down Expand Up @@ -87,8 +87,8 @@ static public void SendExceptionLog(Exception e, string appName, string appPath,
MessageBoxIcon.Error);
}

MessageBox.Show("Email sent! Thanks for your consideration! If it's a serious bug, feel free to send mail to digimarco35@yahoo.com, to provide more information!" + Environment.NewLine
+ "Click \"OK\" to exit.",
MessageBox.Show("Email sent! Thanks for your consideration! If this bug happens repeatedly, please file a bug report at\r\n\r\nhttp://code.google.com/p/jumplist-extender/issues/list\r\n\r\nor email me at digimarco35@yahoo.com."
+ "\r\n\r\nClick \"OK\" to exit.",
"Email Sent",
MessageBoxButtons.OK,
MessageBoxIcon.Asterisk);
Expand Down Expand Up @@ -189,7 +189,7 @@ static public void Log(string messageString, int logChange)

static public void Log(string messageString, int logChange, bool followingLine)
{
#if RELEASE
#if (!DEBUG)
return;
#endif
if (messageString.Length > 0)
Expand Down
4 changes: 2 additions & 2 deletions T7ECommon/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.*")]
[assembly: AssemblyFileVersion("0.3")]
[assembly: AssemblyVersion("0.4.*")]
[assembly: AssemblyFileVersion("0.4")]
Loading

0 comments on commit f012358

Please sign in to comment.