Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


RegSetDword and Setting Last Bit to 0

Keywords: 	  RegSetDword

Question:

I have a Dword value in my registry, and I want to set the last bit in the value, no matter what it is currently set to (would be either a 0 or a 1), to a 0. How do I do that?

Answer:

In the example below, substitute your registry handle and paths in the "..." slots:
	val=RegQueryDword(...,...)
	val=val & (~1)
	RegSetDword(...,...,val)

Article ID:   W14289
Filename:   RegSetDword and Setting Last Bit to 0.txt