none
EnumChildProc - Get Values from an array

    Question

  • I have 6 child windows that are to receive random numbers when I click my "roll" button.  If I make the random number within ECP (EnumerateChildProc) I have no problem.  However, these values are supposed to come from an array (global scope).  How would I tell ECP to get different array indices depending upon the window it is looking at?

    I never like posts with a lot of code, but here is the "before"

    BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lParam)

    {

    DiceLogic dice;

    TCHAR rndNum[16];

    short int roll = dice.roll(6);

    SendMessage(hWnd, WM_SETTEXT, NULL, (LPARAM)myItoa(rndNum, roll));

    return TRUE;

    }

    Basically, I would want something like this:

    BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lParam) { TCHAR rndNum[16]; short int roll = array[idx]; // but how to get idx? SendMessage(hWnd, WM_SETTEXT, NULL, (LPARAM)myItoa(rndNum, roll));

    return TRUE; }

    (Not as much code as I thought :))

    Thanks

    Edit:  An idea:  Make idx a global variable and have :

    short int roll = array[idx++];

    Just making sure it starts at zero for ECP.

     




    Tuesday, June 26, 2012 2:06 PM

All replies

  • Hi Lowest0ne,

    Base on my understanding, you are meeting the issue of color management with monitor calibration profile.

    I will move the thread from the forum "Windows Forms General" to the "User Interface development for Windows Desktop" forum, you can get more help there.

    If there are any concers, please feel free to let me know.


    Chester Hong
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, June 28, 2012 8:59 AM