Show Windows Contents While Dragging

Is there an Windows API I can use to return the value
of Show Windows Contents While Dragging?
On NT, this option is set by the user via Settings /
Control Panel / Display / Plus! / Visual Settings .
Who is Participating?
snoeglerConnect With a Mentor Commented:
The following piece of code should do what you want.
Make sure that you #include "winreg.h" in the file where you place the code in:

BOOL      bDragFullWindows; // receives your required information later
HKEY      hMainKey;// key to the registry path
DWORD      dwVarType;// receives the value type of DragFullWindows
DWORD      dwBufSize=256;// size of the value buffer
char      valueBuffer[256];// receives the value
::RegOpenKeyEx(HKEY_USERS,".Default\\Control Panel\\desktop",0,KEY_ALL_ACCESS,&hMainKey);
// Make sure that we are getting a string as result
// (see description of RegQueryValueEx)
// get the result into bDragFullWindows

After that, bDragFullWindows contains the value of the registry path i gave you.
   HKEY hKey,
   LPCTSTR lpSubKey,
   DWORD ulOptions,
   REGSAM samDesired,
   PHKEY phkResult);

Opens a key to the registry. 'hKey' (1st param) tells which main branch to use.
This may be either HKEY_LOCAL_MACHINE or other predefined values, or any other
'lpSubKey' gives the path after the main branch, in the example, HKEY_USERS is the
main branch, '.Desktop\Control Panel\Desktop' is the sub-path.
'ulOptions' must be NULL currently,
'samDesired' can always be KEY_ALL_ACCESS, allowing your program all operations,
like deleting, renaming, and so on. Unless you don't code security-relevant program sections,
set this to KEY_ALL_ACCESS.
phkResult is a pointer to a HKEY variable, which will receive the handle to the branch you

   HKEY hKey,
   LPTSTR lpValueName,
   LPDWORD lpReserved,
   LPDWORD lpType,
   LPBYTE lpData,
   LPDWORD lpcbData);

'hKey' is the branch from which the value 'lpValueName' should be retrieved.
'lpReserved' must be NULL currently,
'lpType' is a pointer to a DWORD variable which receives the type of data stored in the
registry value you retrieved. This is always REG_SZ if you receive string-type registry
'lpData' is a pointer to a buffer space which will receive the information.
The data type of this buffer varies with lpType. If the type is REG_SZ, your the data buffer
contains simply the text information of the registry value after this function.
'lpcbData' is a pointer to a DWORD variable which hold *before* the function the size
of your data buffer. If your data buffer is 256 bytes big, then set the DWORD variable
you supply to the function to this value before. *after* the function call, this variable receives
the size in bytes which has actually been copied to your buffer.

RegCloseKey(HKEY hKey) simply closes the key which has former been opened using

I hope this helped :)
I hope the following helps:
The registry key HKEY_USERS\.Default\Control Panel\desktop\DragFullWindows
contains '1' if enabled, '0' if disabled - if that is what you meant.
(Tested with Win95, but i am quite sure that it's the same with NT)
If you think this has answered your question, feel free to let me know that i should post an
answer :) :) :)
bwilhelmAuthor Commented:
Yes, that location in the registry is very helpful.
Now I just need a way to obtain that value programatically.
Can you use GetProfileInt() somehow to retrieve the value?

BOOL SystemParametersInfo(  UINT uiAction, // system parameter to query or set
  UINT uiParam,  // depends on action to be taken
  PVOID pvParam, // depends on action to be taken
  UINT fWinIni   // user profile update flag);

SPI_GETDRAGFULLWINDOWS Determines whether dragging of full windows is enabled. The pvParam parameter must point to a BOOL variable that receives TRUE if enabled, or FALSE otherwise.
Windows 95: This flag is supported only if Windows Plus! is installed. See SPI_GETWINDOWSEXTENSION.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.