diff --git a/comtypes/shelllink.py b/comtypes/shelllink.py index 6cc4cc30..1736b696 100644 --- a/comtypes/shelllink.py +++ b/comtypes/shelllink.py @@ -18,19 +18,24 @@ SLGP_RAWPATH = 0x4 # for SetShowCmd, GetShowCmd -##SW_SHOWNORMAL -##SW_SHOWMAXIMIZED -##SW_SHOWMINNOACTIVE - +SW_SHOWNORMAL = 0x01 +SW_SHOWMAXIMIZED = 0x03 +SW_SHOWMINNOACTIVE = 0x07 # for Resolve -##SLR_INVOKE_MSI -##SLR_NOLINKINFO -##SLR_NO_UI -##SLR_NOUPDATE -##SLR_NOSEARCH -##SLR_NOTRACK -##SLR_UPDATE +SLR_INVOKE_MSI = 0x0080 +SLR_NOLINKINFO = 0x0040 +SLR_NO_UI = 0x0001 +SLR_NOUPDATE = 0x0008 +SLR_NOSEARCH = 0x0010 +SLR_NOTRACK = 0x0020 +SLR_UPDATE = 0x0004 + +# for Hotkey +HOTKEYF_ALT = 0x04 +HOTKEYF_CONTROL = 0x02 +HOTKEYF_EXT = 0x08 +HOTKEYF_SHIFT = 0x01 # fake these... ITEMIDLIST = c_int diff --git a/comtypes/test/test_shelllink.py b/comtypes/test/test_shelllink.py index c7689400..70fab981 100644 --- a/comtypes/test/test_shelllink.py +++ b/comtypes/test/test_shelllink.py @@ -50,17 +50,15 @@ def test_set_and_get_arguments(self): self.assertEqual(shortcut.GetArguments(), b"-f") def test_set_and_get_hotkey(self): - HOTKEYF_ALT = 0x04 - HOTKEYF_CONTROL = 0x02 + hotkey = shelllink.HOTKEYF_ALT | shelllink.HOTKEYF_CONTROL shortcut = self._create_shortcut() - shortcut.Hotkey = HOTKEYF_ALT | HOTKEYF_CONTROL - self.assertEqual(shortcut.Hotkey, HOTKEYF_ALT | HOTKEYF_CONTROL) + shortcut.Hotkey = hotkey + self.assertEqual(shortcut.Hotkey, hotkey) def test_set_and_get_showcmd(self): - SW_SHOWMAXIMIZED = 0x03 shortcut = self._create_shortcut() - shortcut.ShowCmd = SW_SHOWMAXIMIZED - self.assertEqual(shortcut.ShowCmd, SW_SHOWMAXIMIZED) + shortcut.ShowCmd = shelllink.SW_SHOWMAXIMIZED + self.assertEqual(shortcut.ShowCmd, shelllink.SW_SHOWMAXIMIZED) def test_set_and_get_icon_location(self): shortcut = self._create_shortcut() @@ -113,17 +111,15 @@ def test_set_and_get_arguments(self): self.assertEqual(shortcut.GetArguments(), "-f") def test_set_and_get_hotkey(self): - HOTKEYF_ALT = 0x04 - HOTKEYF_CONTROL = 0x02 + hotkey = shelllink.HOTKEYF_ALT | shelllink.HOTKEYF_CONTROL shortcut = self._create_shortcut() - shortcut.Hotkey = HOTKEYF_ALT | HOTKEYF_CONTROL - self.assertEqual(shortcut.Hotkey, HOTKEYF_ALT | HOTKEYF_CONTROL) + shortcut.Hotkey = hotkey + self.assertEqual(shortcut.Hotkey, hotkey) def test_set_and_get_showcmd(self): - SW_SHOWMAXIMIZED = 0x03 shortcut = self._create_shortcut() - shortcut.ShowCmd = SW_SHOWMAXIMIZED - self.assertEqual(shortcut.ShowCmd, SW_SHOWMAXIMIZED) + shortcut.ShowCmd = shelllink.SW_SHOWMAXIMIZED + self.assertEqual(shortcut.ShowCmd, shelllink.SW_SHOWMAXIMIZED) def test_set_and_get_icon_location(self): shortcut = self._create_shortcut()