The name "static" may seem to imply that it is constant, but this is not true. What it means is that there is only ONE instance of the variable in your whole address space. Any calls to the variable, from any instance of the class, go to the same memory location. This is useful in saving memory if something does not change between instances of a class.
Another use of it is in non-member functions. If you need to retain data between calls to a function, declare a variable as static:
In that case, even if the function is called multiple times, only one instance of 'counter' will be created. Therefore, during each call, it retains the same value it had before.
LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
static int counter;