#include <stdio.h>
#include <windows.h>
#include <math.h>
// 来自:<span style="color: #008000; text-decoration: underline;">http://support.microsoft.com/kb/124103[/color]
// 获取控制台窗口句柄 微软官方网站的程序 直接拿来用了
HWND GetConsoleHwnd(void)
{
#define MY_BUFSIZE 1024 // Buffer size for console window titles.
HWND hwndFound; // This is what is returned to the caller.
char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated
char pszOldWindowTitle[MY_BUFSIZE]; // Contains original
GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
wsprintf(pszNewWindowTitle,"%d/%d",
GetTickCount(),
GetCurrentProcessId());
SetConsoleTitle(pszNewWindowTitle);
Sleep(40);
hwndFound=FindWindow(NULL, pszNewWindowTitle);
SetConsoleTitle(pszOldWindowTitle);
return(hwndFound);
}
int main (void)
{
HWND hConsole = GetConsoleHwnd(); // 获得控制台窗口句柄
HDC hDC = Ge
GDI画sin曲线
最新推荐文章于 2022-10-28 17:35:52 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)