Merge from BRANCH: Fix for Bug # 3048290: hotkeys don't work in Windows 7 x64. Although I can't test this I am pretty sure the problem is due to not using an IntPtr but an int for the windows handle instead. As the old code was wrong I changed it anyhow, hopefully someone can test this.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@823 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2010-08-19 05:25:10 +00:00
commit bd60a8c339
2 changed files with 27 additions and 16 deletions

View file

@ -407,10 +407,10 @@ namespace Greenshot {
private void RegisterHotkeys() {
bool suc = true;
suc &= HotkeyHelper.RegisterHotKey((int)this.Handle, (int)HotkeyHelper.Modifiers.NONE, HotkeyHelper.VK_SNAPSHOT, new HotKeyHandler(CaptureRegion));
suc &= HotkeyHelper.RegisterHotKey((int)this.Handle, (int)HotkeyHelper.Modifiers.ALT, HotkeyHelper.VK_SNAPSHOT, new HotKeyHandler(CaptureWindow));
suc &= HotkeyHelper.RegisterHotKey((int)this.Handle, (int)HotkeyHelper.Modifiers.CTRL, HotkeyHelper.VK_SNAPSHOT, new HotKeyHandler(CaptureFullScreen));
suc &= HotkeyHelper.RegisterHotKey((int)this.Handle, (int)HotkeyHelper.Modifiers.SHIFT, HotkeyHelper.VK_SNAPSHOT, new HotKeyHandler(CaptureLastRegion));
suc &= HotkeyHelper.RegisterHotKey(this.Handle, (uint)HotkeyHelper.Modifiers.NONE, HotkeyHelper.VK_SNAPSHOT, new HotKeyHandler(CaptureRegion));
suc &= HotkeyHelper.RegisterHotKey(this.Handle, (uint)HotkeyHelper.Modifiers.ALT, HotkeyHelper.VK_SNAPSHOT, new HotKeyHandler(CaptureWindow));
suc &= HotkeyHelper.RegisterHotKey(this.Handle, (uint)HotkeyHelper.Modifiers.CTRL, HotkeyHelper.VK_SNAPSHOT, new HotKeyHandler(CaptureFullScreen));
suc &= HotkeyHelper.RegisterHotKey(this.Handle, (uint)HotkeyHelper.Modifiers.SHIFT, HotkeyHelper.VK_SNAPSHOT, new HotKeyHandler(CaptureLastRegion));
if (!suc) {
MessageBox.Show(lang.GetString(LangKey.warning_hotkeys),lang.GetString(LangKey.warning));
}
@ -644,7 +644,7 @@ namespace Greenshot {
LOG.Info("Exit: " + EnvironmentInfo.EnvironmentToString(false));
try {
// Make sure hotkeys are disabled
HotkeyHelper.UnregisterHotkeys(Handle.ToInt32());
HotkeyHelper.UnregisterHotkeys(Handle);
} catch (Exception e) {
LOG.Error("Error unregistering hotkeys!", e);
}