I
infobox0531
The system run on linux platform,i call createwindow,the program
automatically exit,why?Following is my code:
int RegisterClass_BackDesc()
{
static BOOL reg = FALSE;
WNDCLASS wcx;
if (reg)
return -1;
memset(&wcx, 0, sizeof(WNDCLASS));
wcx.lpszClassName = "HAIERSH_BACKDESCRIBE_WND";
wcx.lpfnWndProc = BackDescProc;
wcx.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
UnRegisterClass("HAIERSH_BACKDESCRIBE_WND");
if( !RegisterClass(&wcx) )
return FALSE;
reg = TRUE;
return 0;
}
HMENU CreatMenu_BackDesc()
{
CHAR buff1[40] = {0};
hMenu = CreateMenu();
if (!hMenu)
return NULL;
memset(buff1, 0, 40);
strcpy(buff1,"return");
AppendMenu(hMenu, MF_STRING, ID_M_RETURN, buff1);
return hMenu;
}
HWND CreateWindow_BackDesc(HWND hWndParent)
{
CHAR buff[40] = {0};
RegisterClass_BackDesc();
hMenu = CreatMenu_BackDesc();
hBackDesc = CreateWindow("HAIERSH_BACKDESCRIBE_WND", "", WS_CHILD |
WS_OVERLAPPEDWINDOW | WS_BORDER,
0, 0,
180, 120,
hWndParent, hMenu, 0, 0);
..........
..........
..........
}
besides,if i call createwindow,which head file should i include in
linux platform?
automatically exit,why?Following is my code:
int RegisterClass_BackDesc()
{
static BOOL reg = FALSE;
WNDCLASS wcx;
if (reg)
return -1;
memset(&wcx, 0, sizeof(WNDCLASS));
wcx.lpszClassName = "HAIERSH_BACKDESCRIBE_WND";
wcx.lpfnWndProc = BackDescProc;
wcx.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
UnRegisterClass("HAIERSH_BACKDESCRIBE_WND");
if( !RegisterClass(&wcx) )
return FALSE;
reg = TRUE;
return 0;
}
HMENU CreatMenu_BackDesc()
{
CHAR buff1[40] = {0};
hMenu = CreateMenu();
if (!hMenu)
return NULL;
memset(buff1, 0, 40);
strcpy(buff1,"return");
AppendMenu(hMenu, MF_STRING, ID_M_RETURN, buff1);
return hMenu;
}
HWND CreateWindow_BackDesc(HWND hWndParent)
{
CHAR buff[40] = {0};
RegisterClass_BackDesc();
hMenu = CreatMenu_BackDesc();
hBackDesc = CreateWindow("HAIERSH_BACKDESCRIBE_WND", "", WS_CHILD |
WS_OVERLAPPEDWINDOW | WS_BORDER,
0, 0,
180, 120,
hWndParent, hMenu, 0, 0);
..........
..........
..........
}
besides,if i call createwindow,which head file should i include in
linux platform?