如何用C语言编辑一个图形界面

Aoby34 2010-01-10 02:55:44
小弟初来乍到,在此特向各位大哥大姐,大叔大婶,大爷大妈们问好...

为了把课程设计做得漂亮些,希望能够做点儿图形界面出来,希望各位大虾不吝赐教,给小弟一点儿建议或把您的

大作挂出来让我研究一下,谢谢!
...全文
476 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
yzx714 2010-02-01
  • 打赏
  • 举报
回复
C的话当然是使用gtk库了
MicroSky2813 2010-02-01
  • 打赏
  • 举报
回复
QT吧,简单实用,还能一份代码到处编译,并且开源有LGPL
InfidelX 2010-01-29
  • 打赏
  • 举报
回复
简单的看看windows程序设计吧,看前三章就可以了,然后大概明白一些原理之后可以用vc做出来,问题不是很大。
  • 打赏
  • 举报
回复
#include <windows.h>

LRESULT CALLBACK vvc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch(msg)
{
case WM_CREATE:
//MessageBox(NULL,"aa","bb",MB_OK);
return 0;
case WM_PRINT:
hdc=BeginPaint(hwnd,&ps);
DrawText ( hdc, "fuck", -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER) ;
EndPaint(hwnd,&ps);
return 0 ;
case WM_DESTROY:
PostQuitMessage(0);
return 0 ;
case WM_LBUTTONDBLCLK:
//SendMessage(hwnd,WM_DESTROY,NULL,NULL);
MessageBox(hwnd,"aa","bb",MB_OKCANCEL);
return 0 ;
default:
return DefWindowProc(hwnd,msg,wParam,lParam);
}
}
char szClassName[] = "afd";
int WINAPI WinMain(HINSTANCE hThisInstance,HINSTANCE hPrevInstance,LPSTR lpszArgument,int nFunsterStil)
{
/* TODO: Place code here.*/
char ch[]="test";
WNDCLASSEX wincl;
HWND hwnd=NULL;
MSG msge;


wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = vvc; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);

/* Use default icon and mouse-pointer */
wincl.hIcon = NULL;
wincl.hIconSm = NULL;
wincl.hCursor = NULL;
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);

if(!RegisterClassEx (&wincl))
{
MessageBoxA(NULL,"xx","xx",0);
return 0;
}

hwnd=CreateWindowEx(0, /* Extended possibilites for variation */
szClassName, /* Classname */
"aavvcc", /* Title Text */
WS_SYSMENU, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL );

ShowWindow(hwnd,SW_SHOWNORMAL);

UpdateWindow(hwnd);
while (GetMessage(&msge, NULL, 0, 0))
{
TranslateMessage (&msge) ;
DispatchMessage (&msge) ;
}
return msge.wParam ;
}
Aoby34 2010-01-12
  • 打赏
  • 举报
回复
谢谢LS的,希望能发个写好的源程序上来,参考一下
  • 打赏
  • 举报
回复
QT,wxWidgets这些都可以
yuanlin2008 2010-01-10
  • 打赏
  • 举报
回复
如果用c++,建议你用wxWidgets
Aoby34 2010-01-10
  • 打赏
  • 举报
回复
天冷,小弟就坐在沙发上等

5,530

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 模式及实现
社区管理员
  • 模式及实现社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧