Solved

Show Windows Contents While Dragging

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb.Net Loading Word 11 107
Problem to DocumentFormat 8 124
What the difference between blend and Visual Studio 3 275
.NET tools for adding thread safety to a web app? 3 56
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

680 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