Solved

Show Windows Contents While Dragging

Posted on 1998-09-04
4
494 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
  • 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now