Click here to Skip to main content
15,893,722 members
Articles / Desktop Programming / MFC

Loading keyboard layout (KbdLayerDescriptor) in 32/64-bit environment

Rate me:
Please Sign up or sign in to vote.
4.75/5 (12 votes)
13 Aug 2012Ms-PL3 min read 44.8K   2.2K   17  
When loading a keyboard dll as a 32-bit application on a 64-bit system, the keyboard-dll-files does not work as expected, this class fixes that problem
// KeyboardLayoutDlg.h : header file
//

#pragma once
#include "afxcmn.h"
#include "KLL.h"
#include "afxwin.h"
#include "KeyboardScanCode.h"


// CKeyboardLayoutDlg dialog
class CKeyboardLayoutDlg : public CDialogEx
{
// Construction
public:
	CKeyboardLayoutDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_KEYBOARDLAYOUT_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	//Sets welcome info and listview columns
	void SetListView();

	// List for showing chars and VK related
	CListCtrl m_list;

	//The Keyboard Layout Loader (KLL) manage 32/64-bit loading between
	CKLL m_kll;

	//Scan code presentation to comparison of the layout in "real life"
	CKeyboardScanCode *pScanCodeDlg;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedOk();
	afx_msg void OnBnClickedCancel();
	afx_msg void OnBnClickedLoadkbl();
	CStatic m_system;
	CStatic m_dll;
	afx_msg void OnBnClickedShowscancode();
	CButton m_scancodes;
};

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 Microsoft Public License (Ms-PL)


Written By
Engineer A/S Norske Shell (Dutch Shell)
Norway Norway
----------------------------------
Visit http://lars.werner.no/ for my blog!
----------------------------------
Retired programmer, Norway never had the jobs I wanted Smile | :)

Comments and Discussions