Below is a quick bit of code which is purely to show were my problem is. Using this exact same peice of code, I am able to change the style of the window itself (i.e. remove WS_CAPTION etc) or even a button control, yet no matter how I approach it, I cannot change the styles of a simple edit box. Is there any tricks or am I doing something really very silly here? GetLastError() doesn't give me any info either...
Code:
hwndEdit = CreateWindowEx(0, TEXT("edit"), TEXT(""), WS_CHILD | WS_VISIBLE , 10, 10, 100, 20, hwnd, (HMENU) EDIT_ID,
hInstance, NULL);
SetWindowLong(hwndEdit, GWL_STYLE, (LONG)GetWindowLong(hwndEdit, GWL_STYLE) | ES_READONLY);
SetWindowPos(hwndEdit, HWND_NOTOPMOST, 10, 40, 100, 50, SWP_NOZORDER);
Thanks