LRESULT CALLBACK MyWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
int WINAPI DecodeMain()
{
static char szAppName[]="Decode";
MSG msg;
WNDCLASSEX wndclass;
HINSTANCE hinstance; hinstance = AfxGetApp()->m_hInstance;
wndclass.cbSize = sizeof(wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = XvidWndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hinstance;
wndclass.hIcon = NULL;
wndclass.hIconSm = NULL;
wndclass.hCursor = NULL;
wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAppName; RegisterClassEx(&wndclass); g_hwnd = CreateWindow(szAppName,NULL,WS_OVERLAPPEDWINDOW,0,0,0,0,NULL,NULL,hinstance,NULL);
ShowWindow(g_hwnd, SW_HIDE);
UpdateWindow(g_hwnd); while(GetMessage(&msg, NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}LRESULT CALLBACK MyWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
switch (iMsg)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
} return DefWindowProc(hwnd, iMsg, wParam, lParam);
}// 启动线程
int start()
{
DecodeMain();
...........
...........
}
int WINAPI DecodeMain()
{
static char szAppName[]="Decode";
MSG msg;
WNDCLASSEX wndclass;
HINSTANCE hinstance; hinstance = AfxGetApp()->m_hInstance;
wndclass.cbSize = sizeof(wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = XvidWndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hinstance;
wndclass.hIcon = NULL;
wndclass.hIconSm = NULL;
wndclass.hCursor = NULL;
wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAppName; RegisterClassEx(&wndclass); g_hwnd = CreateWindow(szAppName,NULL,WS_OVERLAPPEDWINDOW,0,0,0,0,NULL,NULL,hinstance,NULL);
ShowWindow(g_hwnd, SW_HIDE);
UpdateWindow(g_hwnd); while(GetMessage(&msg, NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}LRESULT CALLBACK MyWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
switch (iMsg)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
} return DefWindowProc(hwnd, iMsg, wParam, lParam);
}// 启动线程
int start()
{
DecodeMain();
...........
...........
}
解决方案 »
- word2003,vc6,coleclientitem,如何操作word
- 如何调用自己建的窗口??
- 谁有DirectX那几个头文件,给我传些??
- 关于DLL初始化的问题
- 能提供学ActiveX的入门级好书么,是不是得有windows API 编程的基础呢?
- 奢望哪位同时懂得C语言与Delphi的程友帮我翻译一下这段时小程序...
- 谁能教我怎么做鼠标的指针文件???
- 请教一个vc的数据访问问题,想不通,巨郁闷
- 求IPv6地址输入的编辑框 (mfc)
- 急????----help 如何得到一个多文档的窗口图标-----------HELP
- 串口通讯有几种方法,在单文档类型中如何使用?
- 求救。关于UDP的包文发送
int start()
{
DWORD dwThreadId; CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)DecodeMain,
NULL, 0, &dwThreadId)
.......
.......
}
谢谢,不好意思。
PeekMessagewhile(GetMessage(...))
{
switch(msg)
{
case
可以使用PostThreadMessage给该线程发送消息