블로그는 나의 힘!
[ Programing ]/MFC2013. 5. 21. 23:20

출처 : http://cafe.naver.com/jzsdn/5392

블로그 : http://blog.naver.com/neojzs 

 

 

 

프로그램 초기부분에서..

// 고정키 막기 
// 백업    
 STICKYKEYS sStickKeys;
 sStickKeys.cbSize = sizeof(STICKYKEYS);
 SystemParametersInfo( SPI_GETSTICKYKEYS, sizeof(STICKYKEYS), &sStickKeys, 0 );
 m_dwStickyKeysFlag = sStickKeys.dwFlags;
 // 설정
 sStickKeys.dwFlags &= ~(SKF_AVAILABLE|SKF_HOTKEYACTIVE);
 SystemParametersInfo( SPI_SETSTICKYKEYS, sizeof(STICKYKEYS), &sStickKeys, 0 );

 // 필터키 막기
 FILTERKEYS sFilterKeys;
 sFilterKeys.cbSize = sizeof(FILTERKEYS);
 SystemParametersInfo( SPI_GETFILTERKEYS, sizeof(FILTERKEYS), &sFilterKeys, 0 );
 m_dwFilterKeysFlag = sFilterKeys.dwFlags;
 sFilterKeys.dwFlags &= ~(FKF_AVAILABLE|FKF_HOTKEYACTIVE);
 SystemParametersInfo( SPI_SETFILTERKEYS, sizeof(FILTERKEYS), &sFilterKeys, 0 );

 

 

 

프로그램 마칠때..

// 고정키 복구
 STICKYKEYS sStickKeys;
 sStickKeys.cbSize = sizeof(STICKYKEYS);
 sStickKeys.dwFlags = m_dwStickyKeysFlag;
 SystemParametersInfo( SPI_SETSTICKYKEYS, sizeof(STICKYKEYS), &sStickKeys, 0 );
 // 필터키 복구
 FILTERKEYS sFilterKeys;
 sFilterKeys.cbSize = sizeof(FILTERKEYS);
 sFilterKeys.dwFlags = m_dwFilterKeysFlag;
 SystemParametersInfo( SPI_SETFILTERKEYS, sizeof(FILTERKEYS), &sFilterKeys, 0 );

 

 

Posted by Mister_Q