用api啊
是不是做sdk程序?
是不是做sdk程序?
解决方案 »
- 【MFC使用BCG edit控件如何多次打开并读写同一个文件】
- 书上说,并发服务器的实现中,单经常轮询方式不断监测状态浪费了cpu时间,用select可以不浪费。但
- 何谓技术路线?
- 病毒virus_system.exe
- Dialogic ADPCM转换成wav流
- 请问在vc中将CPU控制权交出的涵数叫什么?相当于VB中的DoEvents()
- 纠结的画图问题
- 怎样在VC内调用DDK函数
- 如何给用ATL写的对话框加入DDX?
- mfc 新建一个按钮怎么实现关闭对话框功能
- 串口通讯的问题(writefile成功 ,可是readfile得不到结果),
- 用C编一个CGI小模块,在Linux用浏览器上载jpg图片到APACHE SERVER,用该小模块通过改变jpg文件本身来改变图象的几何尺寸,压缩,嵌到简单html文件中,在Linux用浏览器浏览。
//
// #include "simwin.h"
#include "menu.h"
#include <string.h>
#include <windows.h>
LRESULT CALLBACK MainWndProc(HWND,UINT,WPARAM,LPARAM);
BOOL InitApplication(HINSTANCE);
BOOL InitInstance(HINSTANCE,int);
char *hello="窗口外的世界很精彩,窗口外的的天地也很奇妙";HINSTANCE hInst;
HWND hWndMain;
int APIENTRY WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
InitApplication(hInstance);//定义窗口
// return (TRUE);
// if (!InitInstance(hInstance,nCmdShow))
InitInstance(hInstance,nCmdShow);//创建窗口
// return (FALSE);
while(GetMessage(&msg,
NULL,
0,
0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (msg.wParam );
}
BOOL InitApplication(HINSTANCE hInstance)//定义窗口
{
WNDCLASS wc;
wc.style =CS_DBLCLKS;
wc.lpfnWndProc =(WNDPROC)MainWndProc;
wc.cbClsExtra =0;
wc.cbWndExtra =0;
wc.hInstance =hInstance;
wc.hIcon =LoadIcon(NULL,IDI_ASTERISK);
wc.hCursor =LoadCursor(NULL,IDC_ARROW);
wc.hbrBackground =(HBRUSH)GetStockObject(GRAY_BRUSH);
wc.lpszMenuName ="MENUAPPMENU";
wc.lpszClassName ="WC";//SimpwinWclass";
return (RegisterClass(&wc));
}
BOOL InitInstance(
HINSTANCE hInstance,
int nCmdShow)
{
hInst=hInstance;
hWndMain=CreateWindow("WC",
"我的窗口",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
NULL,NULL,hInstance,NULL);
if(!hWndMain)
return(FALSE);
ShowWindow(hWndMain,nCmdShow);
UpdateWindow(hWndMain);
return (TRUE);
}
LRESULT CALLBACK MainWndProc(
HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
switch (message)
{
case WM_PAINT:
hdc=BeginPaint(hWnd,&ps);
TextOut(hdc,20,10,hello,lstrlen(hello));
EndPaint(hWnd,&ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case IDM_EXIT :
PostQuitMessage(0);
break;
case IDM_EDITUNDO:
hdc=BeginPaint(hWnd,&ps);
TextOut(hdc,40,30,hello,lstrlen(hello));
EndPaint(hWnd,&ps);
break;
default:
return (DefWindowProc(hWnd,message,wParam,lParam));
}
return (0);
}
具体的参数参见msdn