Solved

Show Windows Contents While Dragging

Posted on 1998-09-04
4
524 Views
Last Modified: 2013-12-03
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 .
0
Comment
Question by:bwilhelm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Expert Comment

by:snoegler
ID: 1414216
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 :) :) :)
0
 

Author Comment

by:bwilhelm
ID: 1414217
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?

0
 
LVL 6

Accepted Solution

by:
snoegler earned 100 total points
ID: 1414218
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);
::RegQueryValueEx(hMainKey,"DragFullWindows",NULL,&dwVarType,(LPBYTE)valueBuffer,&dwBufSize);
// Make sure that we are getting a string as result
// (see description of RegQueryValueEx)
ASSERT(dwVarType==REG_SZ);
::RegCloseKey(hMainKey);
// get the result into bDragFullWindows
bDragFullWindows=atoi(valueBuffer)?TRUE:FALSE;

After that, bDragFullWindows contains the value of the registry path i gave you.
PS:
RegOpenKeyEx(
   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
subkey.
'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
specified.

RegQueryValueEx(
   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
values.
'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
RegOpenKeyEx().

I hope this helped :)
0
 
LVL 23

Expert Comment

by:chensu
ID: 1414219
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.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question