网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
08月20日漏签0天
c语言吧 关注:799,021贴子:4,358,823
  • 看贴

  • 图片

  • 吧主推荐

  • 视频

  • 游戏

  • 3回复贴,共1页
<<返回c语言吧
>0< 加载中...

LOVE

  • 只看楼主
  • 收藏

  • 回复
  • lishiyan的海角
  • 超能力者
    9
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼


  • lishiyan的海角
  • 超能力者
    9
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include "stdafx.h"
#include "resource.h"
#include "windows.h"
#include "math.h"
#include "心形线.h"
//#include "tou.h"
#include <time.h>
#include <stdlib.h>
#define PI 3.1415926
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst;// current instance
TCHAR szTitle[MAX_LOADSTRING];// The title bar text
TCHAR szWindowClass[MAX_LOADSTRING];// The title bar text
// Foward declarations of functions included in this code module:
ATOMMyRegisterClass(HINSTANCE hInstance);
BOOLInitInstance(HINSTANCE, int);
LRESULT CALLBACKWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACKAbout(HWND, UINT, WPARAM, LPARAM);
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_MY, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_MY);
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage is only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style= CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc= (WNDPROC)WndProc;
wcex.cbClsExtra= 0;
wcex.cbWndExtra= 0;
wcex.hInstance= hInstance;
wcex.hIcon= LoadIcon(hInstance, (LPCTSTR)IDI_MY);
wcex.hCursor= LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground= (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName= (LPCSTR)IDC_MY;
wcex.lpszClassName= szWindowClass;
wcex.hIconSm= LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
return RegisterClassEx(&wcex);
}
//
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND- process the application menu
// WM_PAINT- Paint the main window
// WM_DESTROY- post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
POINT pt;
HDC hdc;
HBRUSH hBrush;
HPEN hpen,hpblack;
double m;
TCHAR szHello[MAX_LOADSTRING];
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
{InvalidateRect(hWnd, NULL, 0);
hdc = BeginPaint(hWnd, &ps);
//hpen=(HPEN)GetStockObject(NULL_PEN);
//SelectObject(hdc,hpen);
// LineTo(hdc,600,150);
//hpen=CreatePen(PS_SOLID,1,RGB(255,0,0));
//hBrush=CreateSolidBrush(RGB(255,0,0));
// SelectObject(hdc,hpen);
// SelectObject(hdc,hBrush);
for(double m=-1;m<=1;m=m+0.00001)
{//Pie(hdc,500+100*m,250-100*(pow(m,(2.0/3.0))+sqrt((1-pow(m,2)))),503+100*m,253-100*(pow(m,(2.0/3.0))+sqrt((1-pow(m,2)))),0,0,0,0);
// Pie(hdc,500+100*m,250-100*(pow(m,(2.0/3.0))-sqrt((1-pow(m,2)))),503+100*m,253-100*(pow(m,(2.0/3.0))-sqrt(1-pow(m,2))),0,0,0,0);
// Pie(hdc,500-100*m,250-100*(pow(m,(2.0/3.0))+sqrt((1-pow(m,2)))),503-100*m,253-100*(pow(m,(2.0/3.0))+sqrt((1-pow(m,2)))),0,0,0,0);
// Pie(hdc,500-100*m,250-100*(pow(m,(2.0/3.0))-sqrt((1-pow(m,2)))),503-100*m,253-100*(pow(m,(2.0/3.0))-sqrt(1-pow(m,2))),0,0,0,0);
hpen=(HPEN)GetStockObject(NULL_PEN);
SelectObject(hdc,hpen);
LineTo(hdc,500.0-100.0*m,250.0-100.0*(pow(m,(2.0/3.0))+sqrt((1.0-pow(m,2.0)))));
DeleteObject(hpen);
hpen=CreatePen(PS_SOLID,1,RGB(255,0,0));
SelectObject(hdc,hpen);
LineTo(hdc,500-100*m,250-100*(pow(m,(2.0/3.0))-sqrt((1-pow(m,2)))));
DeleteObject(hpen);
hpen=(HPEN)GetStockObject(NULL_PEN);
SelectObject(hdc,hpen);
LineTo(hdc,500+100*m,250-100*(pow(m,(2.0/3.0))+sqrt((1-pow(m,2)))));
DeleteObject(hpen);
hpen=CreatePen(PS_SOLID,1,RGB(255,0,0));
SelectObject(hdc,hpen);
LineTo(hdc,500+100*m,250-100*(pow(m,(2.0/3.0))-sqrt((1-pow(m,2)))));
DeleteObject(hpen);
}
}
// TODO: Add any drawing code here...
RECT rt;
GetClientRect(hWnd, &rt);
DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}


2025-08-20 18:32:05
广告
不感兴趣
开通SVIP免广告
  • lishiyan的海角
  • 超能力者
    9
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#define IDR_MAINFRAME128
#define IDD_MY_DIALOG102
#define IDD_ABOUTBOX103
#define IDS_APP_TITLE103
#define IDM_ABOUT104
#define IDM_EXIT105
#define IDS_HELLO106
#define IDI_MY 107
#define IDI_SMALL108
#define IDC_MY 109
#define IDC_MYICON2
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif


  • lishiyan的海角
  • 超能力者
    9
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#if !defined(AFX__H__C8406F5D_5F5F_478B_B951_E3A89C4366E9__INCLUDED_)
#define AFX__H__C8406F5D_5F5F_478B_B951_E3A89C4366E9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "resource.h"
#endif // !defined(AFX__H__C8406F5D_5F5F_478B_B951_E3A89C4366E9__INCLUDED_)


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 3回复贴,共1页
<<返回c语言吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示