dev c++ 的头文件是和库其实是mingw 的头文件和库,肯定是从微软的sdk改造过来,而且是微软授权同意的。微软的sdk的版本是只是支持VC,且不断更新的,所以mingw 的头文件和库更新肯定是滞后于微软最新sdk版本的,所以当你用到某些功能最新SDK功能头文件找不到这个函数一点也不奇怪。理论上肯定应该只能用自己的头文件,因为头文件还要有相应的库支持,不能直接使用vc库。如果mingw不支持,你可以查看mingw相关文档通过库转换或者动态加载来调用这些函数,如果你够高手又有时间,你可以自己改造mingw的库来支持它,其实mingw文档上有说,再说它是开源的。
int WINAPI
WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_QUESTION);
wincl.hIconSm = LoadIcon (NULL, IDI_QUESTION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"我的托盘程序", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* 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 */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage() */
switch (message) /* handle the messages */
{
case WM_SIZE:
switch (wParam)
{
case SIZE_MINIMIZED:
ShowWindow (hwnd,SW_HIDE);
Shell_NotifyIcon(NIM_ADD, &myNID);
break;
}
break;
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}