Forum Discussion

mcbane's avatar
mcbane
Contributor
4 years ago

Turning on/off High Contrast in Windows

I'm having trouble getting TestComplete to turn High Contrast on/off. I can get it to navigate through the control panel to do it, but I would like to:

  • Use the <Left Alt><Left Shift><PrtScn> key combination in Javascript
  • Be able to detect whether it's on or off before toggling it

Here are a few things I have tried unsuccessfully (with and without running TestComplete as admin):

 

Option 1

 

Aliases.explorer.wndProgman.SHELLDLL_DefView.FolderView.Keys("!~[PrtSc]");

 

Option 2

 

Aliases.explorer.wndProgman.SHELLDLL_DefView.FolderView.Keys("[Hold]!~[PrtSc][Release]");

 

Option 3

 

Sys.Desktop.KeyDown(VK_LSHIFT);
Sys.Desktop.KeyDown(VK_MENU);
Sys.Desktop.KeyDown(VK_SNAPSHOT);
Sys.Desktop.KeyUp(VK_LSHIFT);
Sys.Desktop.KeyUp(VK_MENU);
Sys.Desktop.KeyUp(VK_SNAPSHOT);

 

Has anyone had success with this? Thanks!

 

Tommy

No RepliesBe the first to reply