在c语言中作出widows界面来吗?
来源:百度知道 编辑:UC知道 时间:2024/06/06 20:19:36
可以的话,是不是直接调用windows API 函数就可以了啊?
都说很麻烦,请问到底麻烦到什么程度啊?从头学的话半天时间可以搞定吗?
调用win32 API 函数很容易的可以做出来一个窗口。
我给你写个示例程序,你看下就知道了,在VC6.0,VC7.0和BOLAND5.5下都能编译通过。
#include <windows.h>
#define MAX_LOADSTRING 100
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
HINSTANCE hInstance;
int main()
{
hInstance = (HINSTANCE)GetModuleHandle(NULL);
static TCHAR szAppName[] = TEXT ("Checker1") ;
HWND hwnd ;
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) ;<