还有,那个鼠标坐标是怎么得到的? 就是说:窗口是操作系统的一部分,而不上语言的特性
用basic语言也可写窗口 那如果要学做windows下的*.exe应用程序一般要看什么书呢?LEE能帮我推荐一本吗?我好买来系统学习一下!谢谢了! 我的沙发贴不就告诉你了么...算了...都被无视了... 引用第6楼yzk0370于2006-12-27 12:23发表的“”:
我的沙发贴不就告诉你了么...算了...都被无视了...
非常抱歉!是我大意了!谢谢你啊!
谢谢大家的帮忙! 最近淘到一本《Windows下的C/C++高级编程》,好像刚好就可以回答LZ的问题~~ 用C#吧,那个做窗口容易~ WIN32API Windows 窗口 有专门的API函数
C可能难以实现一点 我觉得还是Delphi好,很多东西都设计好了的,虽然说最近Borland发展得不怎么样,我还是一直支持Delphi的(偶Pascal学开头的,呵呵!) 学 VC#直接就可以画窗口 #include <windows.h>
/*Declare Windows procedure*/
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/*Make the class name into a global variable*/
char szClassName[ ] = "WindowsApp";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* 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 = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
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_BACKGROUND;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* 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 /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
/*This function is called by the Windows function DispatchMessage()*/
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
} 这个是一个最简单的窗口
调用windows api
显示窗口 刷新窗口 消息循环
在C语言中,窗口是怎么做出来的?
自学TC这么久了,写的程序都是在一个DOS窗口里运行的,想问一下各位,那些WINDOWS的窗口是怎么做的?还有,鼠标操作是怎么完成的?
还有,最大化,最小化是怎么完成的?
望高手解释一下!谢谢!
我是C语言的新手,各位别打我啊!!我闪!
页:
[1]