Click here to Skip to main content
13,626,436 members
Click here to Skip to main content

Stats

215.8K views
6.2K downloads
65 bookmarked
Posted 24 May 2002
Licenced CPOL

Toggling the Num Lock, Caps Lock, and Scroll Lock keys

, 24 May 2002
How to toggle the Num Lock, Caps Lock, and Scroll Lock keys programmatically.
# Microsoft Developer Studio Generated NMAKE File, Based on ToggleKeys.dsp
!IF "$(CFG)" == ""
CFG=ToggleKeys - Win32 Debug
!MESSAGE No configuration specified. Defaulting to ToggleKeys - Win32 Debug.
!ENDIF 

!IF "$(CFG)" != "ToggleKeys - Win32 Release" && "$(CFG)" != "ToggleKeys - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "ToggleKeys.mak" CFG="ToggleKeys - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "ToggleKeys - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "ToggleKeys - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE 
!ERROR An invalid configuration is specified.
!ENDIF 

!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE 
NULL=nul
!ENDIF 

CPP=cl.exe
MTL=midl.exe
RSC=rc.exe

!IF  "$(CFG)" == "ToggleKeys - Win32 Release"

OUTDIR=.\Release
INTDIR=.\Release
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros

ALL : "$(OUTDIR)\ToggleKeys.exe"


CLEAN :
	-@erase "$(INTDIR)\MainFrm.obj"
	-@erase "$(INTDIR)\StatusBarEx.obj"
	-@erase "$(INTDIR)\StdAfx.obj"
	-@erase "$(INTDIR)\ToggleKeys.obj"
	-@erase "$(INTDIR)\ToggleKeys.pch"
	-@erase "$(INTDIR)\ToggleKeys.res"
	-@erase "$(INTDIR)\ToggleKeysDoc.obj"
	-@erase "$(INTDIR)\ToggleKeysView.obj"
	-@erase "$(INTDIR)\vc60.idb"
	-@erase "$(OUTDIR)\ToggleKeys.exe"

"$(OUTDIR)" :
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\ToggleKeys.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\ToggleKeys.res" /d "NDEBUG" /d "_AFXDLL" 
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ToggleKeys.bsc" 
BSC32_SBRS= \
	
LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\ToggleKeys.pdb" /machine:I386 /out:"$(OUTDIR)\ToggleKeys.exe" 
LINK32_OBJS= \
	"$(INTDIR)\ToggleKeys.obj" \
	"$(INTDIR)\StdAfx.obj" \
	"$(INTDIR)\MainFrm.obj" \
	"$(INTDIR)\ToggleKeysDoc.obj" \
	"$(INTDIR)\ToggleKeysView.obj" \
	"$(INTDIR)\ToggleKeys.res" \
	"$(INTDIR)\StatusBarEx.obj"

"$(OUTDIR)\ToggleKeys.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
    $(LINK32) @<<
  $(LINK32_FLAGS) $(LINK32_OBJS)
<<

!ELSEIF  "$(CFG)" == "ToggleKeys - Win32 Debug"

OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros

ALL : "$(OUTDIR)\ToggleKeys.exe"


CLEAN :
	-@erase "$(INTDIR)\MainFrm.obj"
	-@erase "$(INTDIR)\StatusBarEx.obj"
	-@erase "$(INTDIR)\StdAfx.obj"
	-@erase "$(INTDIR)\ToggleKeys.obj"
	-@erase "$(INTDIR)\ToggleKeys.pch"
	-@erase "$(INTDIR)\ToggleKeys.res"
	-@erase "$(INTDIR)\ToggleKeysDoc.obj"
	-@erase "$(INTDIR)\ToggleKeysView.obj"
	-@erase "$(INTDIR)\vc60.idb"
	-@erase "$(INTDIR)\vc60.pdb"
	-@erase "$(OUTDIR)\ToggleKeys.exe"
	-@erase "$(OUTDIR)\ToggleKeys.ilk"
	-@erase "$(OUTDIR)\ToggleKeys.pdb"

"$(OUTDIR)" :
    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\ToggleKeys.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ   /c 
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\ToggleKeys.res" /d "_DEBUG" /d "_AFXDLL" 
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ToggleKeys.bsc" 
BSC32_SBRS= \
	
LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\ToggleKeys.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ToggleKeys.exe" /pdbtype:sept 
LINK32_OBJS= \
	"$(INTDIR)\ToggleKeys.obj" \
	"$(INTDIR)\StdAfx.obj" \
	"$(INTDIR)\MainFrm.obj" \
	"$(INTDIR)\ToggleKeysDoc.obj" \
	"$(INTDIR)\ToggleKeysView.obj" \
	"$(INTDIR)\ToggleKeys.res" \
	"$(INTDIR)\StatusBarEx.obj"

"$(OUTDIR)\ToggleKeys.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
    $(LINK32) @<<
  $(LINK32_FLAGS) $(LINK32_OBJS)
<<

!ENDIF 

.c{$(INTDIR)}.obj::
   $(CPP) @<<
   $(CPP_PROJ) $< 
<<

.cpp{$(INTDIR)}.obj::
   $(CPP) @<<
   $(CPP_PROJ) $< 
<<

.cxx{$(INTDIR)}.obj::
   $(CPP) @<<
   $(CPP_PROJ) $< 
<<

.c{$(INTDIR)}.sbr::
   $(CPP) @<<
   $(CPP_PROJ) $< 
<<

.cpp{$(INTDIR)}.sbr::
   $(CPP) @<<
   $(CPP_PROJ) $< 
<<

.cxx{$(INTDIR)}.sbr::
   $(CPP) @<<
   $(CPP_PROJ) $< 
<<


!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("ToggleKeys.dep")
!INCLUDE "ToggleKeys.dep"
!ELSE 
!MESSAGE Warning: cannot find "ToggleKeys.dep"
!ENDIF 
!ENDIF 


!IF "$(CFG)" == "ToggleKeys - Win32 Release" || "$(CFG)" == "ToggleKeys - Win32 Debug"
SOURCE=.\MainFrm.cpp

"$(INTDIR)\MainFrm.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\ToggleKeys.pch"


SOURCE=.\StatusBarEx.cpp

"$(INTDIR)\StatusBarEx.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\ToggleKeys.pch"


SOURCE=.\StdAfx.cpp

!IF  "$(CFG)" == "ToggleKeys - Win32 Release"

CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\ToggleKeys.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c 

"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\ToggleKeys.pch" : $(SOURCE) "$(INTDIR)"
	$(CPP) @<<
  $(CPP_SWITCHES) $(SOURCE)
<<


!ELSEIF  "$(CFG)" == "ToggleKeys - Win32 Debug"

CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)\ToggleKeys.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ   /c 

"$(INTDIR)\StdAfx.obj"	"$(INTDIR)\ToggleKeys.pch" : $(SOURCE) "$(INTDIR)"
	$(CPP) @<<
  $(CPP_SWITCHES) $(SOURCE)
<<


!ENDIF 

SOURCE=.\ToggleKeys.cpp

"$(INTDIR)\ToggleKeys.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\ToggleKeys.pch"


SOURCE=.\ToggleKeys.rc

"$(INTDIR)\ToggleKeys.res" : $(SOURCE) "$(INTDIR)"
	$(RSC) $(RSC_PROJ) $(SOURCE)


SOURCE=.\ToggleKeysDoc.cpp

"$(INTDIR)\ToggleKeysDoc.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\ToggleKeys.pch"


SOURCE=.\ToggleKeysView.cpp

"$(INTDIR)\ToggleKeysView.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\ToggleKeys.pch"



!ENDIF 

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Armen Hakobyan
Software Developer (Senior) SafeNet Inc
United States United States
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02 | 2.8.180712.1 | Last Updated 25 May 2002
Article Copyright 2002 by Armen Hakobyan
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid