Click here to Skip to main content
14,773,484 members
Home » Discussions » ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: how to access the history list of CHtmlView? Pin
«_Superman_»22-Apr-12 18:38
professional«_Superman_»22-Apr-12 18:38 
QuestionTrying to take ownership of a Directory but it fails... Pin
varunpandeyengg13-Apr-12 0:32
Membervarunpandeyengg13-Apr-12 0:32 
Questionswprintf_s procedure not find in xp Pin
vishalgpt1-Apr-12 7:09
Membervishalgpt1-Apr-12 7:09 
AnswerRe: swprintf_s procedure not find in xp Pin
Richard MacCutchan1-Apr-12 23:25
mveRichard MacCutchan1-Apr-12 23:25 
Questionwindow hooks and control ID Pin
daemonna28-Mar-12 6:43
Memberdaemonna28-Mar-12 6:43 
AnswerRe: window hooks and control ID Pin
«_Superman_»28-Mar-12 22:58
professional«_Superman_»28-Mar-12 22:58 
GeneralRe: window hooks and control ID Pin
daemonna28-Mar-12 23:27
Memberdaemonna28-Mar-12 23:27 
Questionusage of KeyboardLayout function Pin
subhendu_m27-Mar-12 5:38
Membersubhendu_m27-Mar-12 5:38 
i'm trying to change the keyboard layout from my program. it loads the new keyboard but doesn't activates it to the new layout.
here's my code:

please help me. i've to submit it asap.
#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <conio.h>

using namespace std;
// Keyboard layout structure
class _KeyboardLayout
{
public:
	HKL hBengali;
	bool bBengali;
	HKL hEnglish;
	bool bEnglish;
	_KeyboardLayout();
} ;

_KeyboardLayout::_KeyboardLayout()
{
// setting default values (as not installed = false)
bBengali=false;
bEnglish=false;
}


int main()
{
	
	_KeyboardLayout KeyboardLayout;
	// Get layout’s count
TCHAR szKeyboard[KL_NAMELENGTH];
int nBuff=::GetKeyboardLayoutList(0, NULL);
int nKeyboard;
HKL * phkl;
if((phkl = new HKL[nBuff])==NULL)
{
	cout<<"Out of Memory !";
	return 1;
}

// Get and parse layout items
int x=::GetKeyboardLayoutList(nBuff,phkl);
// iterate through list to check needed layouts
for(nKeyboard=0; nKeyboard<nBuff; nKeyboard++)
{
	::ActivateKeyboardLayout(phkl[nKeyboard], KLF_SETFORPROCESS);
	GetKeyboardLayoutName(szKeyboard);
	if(wcscmp(szKeyboard,_T("00000445"))==0)
	{
		KeyboardLayout.bBengali=true;
		KeyboardLayout.hBengali=phkl[nKeyboard];
		cout<<phkl[nKeyboard];
	}
	if(wcscmp(szKeyboard,_T("00000409"))==0)
	{
		KeyboardLayout.bEnglish=true;
		KeyboardLayout.hEnglish=phkl[nKeyboard];
	}

}
delete [] phkl;

if(!KeyboardLayout.bBengali)
	cout<<"error in bengali layout";
	//MessageBox(NULL,_T("Bengali keyboard layout not installed"),_T("Warning"),MB_OK|MB_ICONEXCLAMATION);
if(!KeyboardLayout.bEnglish)
	MessageBox(NULL,_T("English (USA) keyboard layout not installed"),_T("Warning"),MB_OK|MB_ICONEXCLAMATION);
else
{}
cout<<endl<<::LoadKeyboardLayoutW(_T("00000445"),KLF_ACTIVATE | KLF_SETFORPROCESS);
if(KeyboardLayout.bBengali)
{ 
cout<<endl<<::ActivateKeyboardLayout(HKL(HKL_PREV), KLF_REORDER);}
return 0;
}

QuestionIWebBrowser2: When submitting data via a form, the form appears again Pin
Pachner20-Mar-12 2:36
MemberPachner20-Mar-12 2:36 
AnswerRe: IWebBrowser2: When submitting data via a form, the form appears again Pin
Pachner22-Mar-12 2:15
MemberPachner22-Mar-12 2:15 
QuestionRelease COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA8-Mar-12 23:14
MemberMrKBA8-Mar-12 23:14 
AnswerRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
barneyman9-Mar-12 1:36
Memberbarneyman9-Mar-12 1:36 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA21-Mar-12 3:11
MemberMrKBA21-Mar-12 3:11 
AnswerRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
Richard MacCutchan9-Mar-12 21:52
mveRichard MacCutchan9-Mar-12 21:52 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA21-Mar-12 3:11
MemberMrKBA21-Mar-12 3:11 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
barneyman21-Mar-12 3:34
Memberbarneyman21-Mar-12 3:34 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA21-Mar-12 3:46
MemberMrKBA21-Mar-12 3:46 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
barneyman21-Mar-12 13:25
Memberbarneyman21-Mar-12 13:25 
AnswerRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA21-Mar-12 3:10
MemberMrKBA21-Mar-12 3:10 
QuestionHow do I detect when a print job starts? Pin
LetsMond2-Mar-12 2:11
MemberLetsMond2-Mar-12 2:11 
AnswerRe: How do I detect when a print job starts? Pin
AminMhmdi7-Mar-12 21:27
professionalAminMhmdi7-Mar-12 21:27 
GeneralRe: How do I detect when a print job starts? Pin
LetsMond7-Mar-12 23:30
MemberLetsMond7-Mar-12 23:30 
QuestionATL Sink in .NET process Pin
Vikram123428-Feb-12 16:50
MemberVikram123428-Feb-12 16:50 
AnswerRe: ATL Sink in .NET process Pin
barneyman29-Feb-12 17:01
Memberbarneyman29-Feb-12 17:01 
GeneralRe: ATL Sink in .NET process Pin
Vikram123429-Feb-12 17:10
MemberVikram123429-Feb-12 17:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.