put vars in separate function, but need reference
here is what i'm trying to do. what i want to do, so i dont clutter up the WM_CREATE message in the main window's procedure, is call a function so that it creates and modifies (font, size, placement, etc.) the controls for this main window. see, this function is a one-time call sort of thing, and i'm doing it just for neatness and readability, but i dont know how to logically go about this.
okay, here is my wndproc:
Code:
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HWND hwndControls[NUM_OF_CTRLS];
switch(message)
{
case WM_CREATE:
hwndControls = Setup_Controls();
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
break;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
and i want someway to modify (and create) the controls in another function but have the same scope and maneuverability for WnProc. how should i do this?
thanks!