Click here to Skip to main content
15,908,768 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: how to access the history list of CHtmlView? Pin
«_Superman_»22-Apr-12 17:38
professional«_Superman_»22-Apr-12 17:38 
QuestionTrying to take ownership of a Directory but it fails... Pin
varunpandeyengg12-Apr-12 23:32
varunpandeyengg12-Apr-12 23:32 
Questionswprintf_s procedure not find in xp Pin
vishalgpt1-Apr-12 6:09
vishalgpt1-Apr-12 6:09 
AnswerRe: swprintf_s procedure not find in xp Pin
Richard MacCutchan1-Apr-12 22:25
mveRichard MacCutchan1-Apr-12 22:25 
Questionwindow hooks and control ID Pin
daemonna28-Mar-12 5:43
daemonna28-Mar-12 5:43 
AnswerRe: window hooks and control ID Pin
«_Superman_»28-Mar-12 21:58
professional«_Superman_»28-Mar-12 21:58 
GeneralRe: window hooks and control ID Pin
daemonna28-Mar-12 22:27
daemonna28-Mar-12 22:27 
Questionusage of KeyboardLayout function Pin
subhendu_m27-Mar-12 4:38
subhendu_m27-Mar-12 4: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.
C++
#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 1:36
Pachner20-Mar-12 1:36 
AnswerRe: IWebBrowser2: When submitting data via a form, the form appears again Pin
Pachner22-Mar-12 1:15
Pachner22-Mar-12 1:15 
QuestionRelease COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA8-Mar-12 22:14
MrKBA8-Mar-12 22:14 
AnswerRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
barneyman9-Mar-12 0:36
barneyman9-Mar-12 0:36 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA21-Mar-12 2:11
MrKBA21-Mar-12 2:11 
AnswerRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
Richard MacCutchan9-Mar-12 20:52
mveRichard MacCutchan9-Mar-12 20:52 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA21-Mar-12 2:11
MrKBA21-Mar-12 2:11 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
barneyman21-Mar-12 2:34
barneyman21-Mar-12 2:34 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA21-Mar-12 2:46
MrKBA21-Mar-12 2:46 
GeneralRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
barneyman21-Mar-12 12:25
barneyman21-Mar-12 12:25 
AnswerRe: Release COM dll crash problem (Windows 7 64bit OS) Pin
MrKBA21-Mar-12 2:10
MrKBA21-Mar-12 2:10 
QuestionHow do I detect when a print job starts? Pin
LetsMond2-Mar-12 1:11
LetsMond2-Mar-12 1:11 
AnswerRe: How do I detect when a print job starts? Pin
AminMhmdi7-Mar-12 20:27
professionalAminMhmdi7-Mar-12 20:27 
GeneralRe: How do I detect when a print job starts? Pin
LetsMond7-Mar-12 22:30
LetsMond7-Mar-12 22:30 
QuestionATL Sink in .NET process Pin
Vikram123428-Feb-12 15:50
Vikram123428-Feb-12 15:50 
AnswerRe: ATL Sink in .NET process Pin
barneyman29-Feb-12 16:01
barneyman29-Feb-12 16:01 
GeneralRe: ATL Sink in .NET process Pin
Vikram123429-Feb-12 16:10
Vikram123429-Feb-12 16: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.