用MFC,一边学MFC,一边做,小半天功夫指定能写出来。
//main.cpp
#include
这些按钮,输入框其实就是调用一些windows api完成的。
给你来段实际的代码:
/* The class is registered, let's create the program*/
//WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX 初始一个不能缩放,不能最大化的窗口
//WS_OVERLAPPEDWINDOW 默认的窗口,可以自由缩放,最大化,最小化。
hwnd_root = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Web消息通知", /* Title Text */
WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
494, /* The programs width */
279, /* 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 */
);
/按钮,单选,复选 - button , dwStyle: BS_AUTORADIOBUTTON, BS_AUTOCHECKBOX
//单行文本框,多行文本框 - edit, dwStyle: ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE
//标签 - static
//按钮 - CreateWindow
/*
//CreatWindow方式
HWND button = CreateWindow("button", "你好",
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX ,
110, // xpos
104, // ypos
121, //width
21, //height
hwnd_root, (HMENU)1, hThisInstance, NULL ) ;
*/
hwnd_lURL = CreateWindowEx(0,"static", "Web消息源网址(Notify URL),一行一个网址,最多支持10个网址:",
WS_CHILD | WS_VISIBLE,
13, // xpos
13, // ypos
443, //width
21, //height
hwnd_root, (HMENU)idl_url, hThisInstance, NULL ) ;
//文本框 - 3D - CreateWindowEx(WS_EX_CLIENTEDGE
hwnd_tURL = CreateWindowEx(WS_EX_CLIENTEDGE, "edit", "",
WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | WS_VSCROLL,
12, // xpos
33, // ypos
463, //width
166, //height
hwnd_root, (HMENU)idt_url, hThisInstance, NULL);