Hi, I have a error with my createwindow for the edit control:C2198 to few parameters.
As far as I can see the parameters are correct or am I not seeing something stupid that I did. If I comment out the createwindow for the edit control all compiles ok.
Code:
#include <windows.h>
#define IDC_EDIT WM_USER + 1000;
LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
HINSTANCE hInst;
int WINAPI WinMain( HINSTANCE hThisInst, HINSTANCE hPrevInst, LPSTR lpszArgs, int nWinMode )
{
WNDCLASSEX wc;
HWND hwnd;
HWND hEdit;
MSG msg;
hInst = hThisInst;
// register window class
wc.cbSize = sizeof( WNDCLASSEX );
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInst;
wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wc.hIconSm = NULL;
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = ( HBRUSH )GetStockObject( BLACK_BRUSH );
wc.lpszMenuName = NULL;
wc.lpszClassName = "EditBoxTest";
RegisterClassEx( &wc );
// create main window
hwnd = CreateWindow( "EditBoxTest",
"EditBox Test",
WS_OVERLAPPEDWINDOW,
0, 0, 800, 600,
NULL, NULL, hInst, NULL );
// create edit box
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE,TEXT("Edit"),"",WS_CHILD|WS_VISIBLE,
10,10,200,30,hwnd,
(HMENU)IDC_EDIT,hInst,NULL);
ShowWindow( hwnd, nWinMode );
UpdateWindow( hwnd );
while( GetMessage( &msg, NULL, 0, 0 ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch( message )
{
case WM_DESTROY: PostQuitMessage( 0 );
break;
default: return DefWindowProc( hwnd, message, wParam, lParam );
break;
}
return 0;
}