WM_SERVER and WM_CLIENT are not standard windows messages, they will have to be defined in some way as an integer value similar to other windows messages. It is likely they will be defined at their point of origin but if they are not you can use
Originally Posted by Ducky
The actual values you give are not important so long as they are offset from WM_APP and thus not likely to collide with system messages.
#define WM_SERVER WM_APP + 1000
#define WM_CLIENT WM_APP + 1001
Now you can incorporate them directly into your switch statement...
Also, in Windows, where switch statements can become horridly complex, it's generally a bad idea to put code directly in cases. Instead, make everything a function call. This compartmentalizes your code and makes debugging a whole lot simpler.
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
hWin_1 = CreateWindowEx(WS_EX_CLIENTEDGE,"ListBox", 0,
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_WANTRETURN |
LBS_NOTIFY | WS_VSCROLL,
20, 20, 550, 460, hwnd, (HMENU)IDB_TEXT1, 0, NULL);
case WM_SERVER :
case WM_CLIENT :
Finally... don't use break in a windows switch statement... If you look up each message in the Windows SDK, you will discover they expect certain return values to be sent to the DefWindowProc... Generally if you use return 0; you are saying the default process should not do further work on the message, return 1; means you want it to handle the message (more), some messages even want returned values from variables.