Click here to Skip to main content
15,910,009 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Worker Thread Pin
Roger6518-Mar-05 13:39
Roger6518-Mar-05 13:39 
GeneralRe: Worker Thread Pin
PJ Arends18-Mar-05 14:03
professionalPJ Arends18-Mar-05 14:03 
GeneralRe: Worker Thread Pin
Roger6518-Mar-05 14:45
Roger6518-Mar-05 14:45 
GeneralMFC: Unicode and Code Pages Pin
Jim Herren18-Mar-05 12:57
Jim Herren18-Mar-05 12:57 
GeneralRe: MFC: Unicode and Code Pages Pin
Mike Dimmick19-Mar-05 13:19
Mike Dimmick19-Mar-05 13:19 
GeneralRe: MFC: Unicode and Code Pages Pin
Jim Herren19-Mar-05 16:38
Jim Herren19-Mar-05 16:38 
GeneralGet "Text" with Hook Pin
postler-t18-Mar-05 11:25
postler-t18-Mar-05 11:25 
GeneralRe: Get "Text" with Hook Pin
Alexander M.,19-Mar-05 4:53
Alexander M.,19-Mar-05 4:53 
KBDLLHOOKSTRUCT.vkCode is the key that was pressed. It is a number between 0 and 254 (ASCII).
Create an array with n items (n is the length of the string you are searching for) and a counter, which represents the current index of the array.

This example is for the word "hello":

char szArray[5];
int iIndex = 0;

void func(KBDLLHOOKSTRUCT kbs)
{
  int i, iCurrentIndex;
  char szLocalArray[6];  // <- 6 = 5 + 1(zero-terminator)

  szArray[iIndex++] = (char)kbs.vkCode;
  if( iIndex == 5 )
    iIndex = 0;

  for( i = 0, iCurrentIndex = iIndex, szLocalArray[5] = '\0'; i < 5; i++ )
  {
    szLocalArray[i] = szArray[iCurrentIndex++];
    if( iCurrentIndex == 5 )
      iCurrentIndex = 0;
  }

  if( stricmp( szLocalArray, "hello" ) == 0 )
    // ---- text is equal to hello, case is ignored!
}


I hope that helps (maybe there an error in the code, didn't have to time to test it *hehe*).

Don't try it, just do it! Wink | ;-)
GeneralRe: Get &quot;Text&quot; with Hook Pin
postler-t19-Mar-05 6:44
postler-t19-Mar-05 6:44 
Generalproblem with TBSTYLE_FLAT toolbar Pin
ljr2418-Mar-05 11:10
ljr2418-Mar-05 11:10 
GeneralOnSize execution, locks Pin
Vancouver18-Mar-05 11:02
Vancouver18-Mar-05 11:02 
GeneralRe: OnSize execution, locks Pin
Blake Miller18-Mar-05 11:42
Blake Miller18-Mar-05 11:42 
GeneralRe: OnSize execution, locks Pin
Vancouver18-Mar-05 11:56
Vancouver18-Mar-05 11:56 
GeneralRe: OnSize execution, locks Pin
Blake Miller18-Mar-05 12:18
Blake Miller18-Mar-05 12:18 
GeneralRe: OnSize execution, locks Pin
Vancouver18-Mar-05 15:33
Vancouver18-Mar-05 15:33 
GeneralFinal explanation Pin
Vancouver19-Mar-05 10:59
Vancouver19-Mar-05 10:59 
Generalsizeof() question Pin
BlackDice18-Mar-05 10:22
BlackDice18-Mar-05 10:22 
GeneralRe: sizeof() question Pin
Ravi Bhavnani18-Mar-05 10:27
professionalRavi Bhavnani18-Mar-05 10:27 
GeneralRe: sizeof() question Pin
BlackDice18-Mar-05 10:42
BlackDice18-Mar-05 10:42 
GeneralRe: sizeof() question Pin
Ravi Bhavnani18-Mar-05 11:21
professionalRavi Bhavnani18-Mar-05 11:21 
GeneralRe: sizeof() question Pin
Blake Miller18-Mar-05 11:44
Blake Miller18-Mar-05 11:44 
GeneralRe: sizeof() question Pin
Ravi Bhavnani18-Mar-05 11:53
professionalRavi Bhavnani18-Mar-05 11:53 
QuestionHow do I treat a key combination? Pin
Anonymous18-Mar-05 10:10
Anonymous18-Mar-05 10:10 
AnswerRe: How do I treat a key combination? Pin
includeh1018-Mar-05 10:33
includeh1018-Mar-05 10:33 
GeneralRe: How do I treat a key combination? Pin
Anonymous18-Mar-05 10:43
Anonymous18-Mar-05 10:43 

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.