Skip to content

Instantly share code, notes, and snippets.

@neokril
Created December 19, 2013 08:15
Show Gist options
  • Save neokril/8035995 to your computer and use it in GitHub Desktop.
Save neokril/8035995 to your computer and use it in GitHub Desktop.
Little application for enabling Windows option "Show window contents while dragging". This app can be used as a fix for Citrix client incorrect behavior - it switches off this option from time to time. I tried this solution: http://aaronwalrath.wordpress.com/2010/12/05/fix-for-citrix-xenapp-published-apps-disabling-windows-visual-effects/ but it…
#include <windows.h>
#include <tchar.h>
#include <cstdio>
#pragma comment(lib, "user32.lib")
int _tmain(int argc, _TCHAR* argv[])
{
BOOL enabled;
SystemParametersInfo(SPI_GETDRAGFULLWINDOWS,
NULL, &enabled, 0);
printf("Current 'dragfullwindow' option status: %d\n", enabled);
if (!enabled)
{
SystemParametersInfo(SPI_SETDRAGFULLWINDOWS,
TRUE,
NULL,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
}
return 0;
}
@EMarshal
Copy link

EMarshal commented Jun 3, 2015

I actually wrote a .NET systray version of this to try and detect when the "show window contents while dragging" is changed and change it back. Unfortunately, while it's possible to detect when the setting is changed via the Windows UI, the Citrix client manages to change it completely silently, so the only way for it to work is to simply toggle the setting on some schedule... and scheduling a repeated task is exactly what the task scheduler is designed for, so there's not much reason to re-implement this while requiring the program to be open all the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment