不要用MFC 谁会可以告诉我一下吗
----------------解决方案--------------------------------------------------------
文本框??怎么觉得这是office中的概念阿!!
----------------解决方案--------------------------------------------------------
晕。。。。。
一般来说,不使用MFC的都是为了写游戏。。。。
至于你的文本框问题嘛。。。。
----------------解决方案--------------------------------------------------------
用CreateWindowEx 类名‘EDIT’
----------------解决方案--------------------------------------------------------
你说的是不是这个:
#include <windows.h>
#include <math.h>
#define IDE_RESULT 101
HWND hwnd ;
int cxClient, cyClient ;
HWND hEditResult ;
HINSTANCE hInst ;
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("SineWave") ;
MSG msg ;
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc= WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground= (HBRUSH) GetStockObject (LTGRAY_BRUSH) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName = szAppName ;
if (!RegisterClass (&wndclass))
{
MessageBox ( NULL, TEXT ("Program requires Windows NT!"),
szAppName, MB_ICONERROR) ;
return 0 ;
}
hwnd = CreateWindow ( szAppName, TEXT ("文本框"),
WS_OVERLAPPEDWINDOW,
10, 10,
800, 600,
NULL, NULL, hInstance, NULL) ;
ShowWindow (hwnd, iCmdShow) ;
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)
{
HDC hdc ;
PAINTSTRUCT ps ;
switch (message)
{
case WM_CREATE:
hEditResult=CreateWindow("EDIT", //建立文本框
NULL,
WS_CHILD | WS_VISIBLE | ES_RIGHT | WS_BORDER,
330,60,
300,24,
hwnd,
(HMENU)IDE_RESULT,
hInst,
NULL);
SetWindowText(hEditResult,"这个是不是你要的文本框啊?");
case WM_SIZE:
cxClient = LOWORD (lParam) ;
cyClient = HIWORD (lParam) ;
return 0 ;
case WM_PAINT:
hdc = BeginPaint (hwnd, &ps) ;
EndPaint (hwnd, &ps) ;
return 0 ;
case WM_DESTROY:
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
----------------解决方案--------------------------------------------------------
楼上API强人哇
----------------解决方案--------------------------------------------------------
请大家不要用TC来学习C语言
什么意思 这么鄙视TC?
----------------解决方案--------------------------------------------------------
呵呵 写写 “牛B” 我可没有鄙视TC 以前我用的都是WINTC
我只是不想用MFC 我是新手想从基础学起
----------------解决方案--------------------------------------------------------
也谢谢 无理取闹 呵呵 回复的 我都谢谢
----------------解决方案--------------------------------------------------------
我可是先回答的哦
----------------解决方案--------------------------------------------------------