Home > Software engineering >  According to the books on win32 sine curve <default normal environmental test has successfully>
According to the books on win32 sine curve <default normal environmental test has successfully>

Time:10-06

 
#include
#include

# define NUM 1000
# define TWOPI (2 * 3.1415)
LRESULT a CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

Int WINAPI WinMain (HINSTANCE HINSTANCE, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
The static TCHAR szAppName []=TEXT (" SineWave ");
The HWND HWND;
MSG MSG.
WNDCLASS WNDCLASS;

Wndclass. Style=CS_HREDRAW | CS_VREDRAW;
Wndclass. LpfnWndProc=WndProc;
Wndclass. CbClsExtra=0;
Wndclass. CbWndExtra=0;
Wndclass. HInstance=hInstance;
Wndclass. HIcon=LoadIcon (NULL, IDI_APPLICATION);
Wndclass. HCursor=LoadCursor (NULL, IDC_ARROW);
Wndclass. HbrBackground=(HBRUSH) GetStockObject (WHITE_BRUSH);
Wndclass. LpszMenuName=NULL;
Wndclass. LpszClassName=szAppName;

if(! RegisterClass (& amp; Wndclass))
{
MessageBox (NULL, TEXT (" above the program requires Windows NT version "),
SzAppName, MB_ICONERROR);
return 0;
}
HWND=CreateWindow (szAppName, TEXT (" sine curve with POLYLINE picture "), WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT CW_USEDEFAULT, CW_USEDEFAULT CW_USEDEFAULT,
NULL, NULL, hInstance, NULL);
ShowWindow (HWND, iCmdShow);
UpdateWindow (HWND);
While (GetMessage (& amp; MSG, NULL, 0, 0))
{
TranslateMessage (& amp; MSG);
DispatchMessage (& amp; MSG);
}
Return MSG. WParam;
}

LRESULT a CALLBACK WndProc (HWND HWND, UINT message, WPARAM WPARAM, LPARAM LPARAM)
{
Static int cxClient cyClient;
HDC HDC.
Int I;
PAINTSTRUCT ps;
POINT apt (NUM);

The switch (the message)
{
Case WM_SIZE:
CxClient=LOWORD (lParam);
CyClient=HIWORD (lParam);
return 0;

In case the WM_PAINT:
HDC=BeginPaint (HWND, & amp; Ps);
MoveToEx (HDC, 0, cyClient/2, NULL);
LineTo (HDC, cxClient cyClient/2);
for(i=0; i{
Apt [I]. X=I * cxClient/NUM;
Apt [I] y=(int) (cyClient/2 * (1 - sin (TWOPI * I/NUM)));
}
Polylines (HDC, apt, NUM);
return 0;

Case WM_DESTROY:
The PostQuitMessage (0);
return 0;
}
Return DefWindowProc (HWND, message, wParam, lParam);
}

CodePudding user response:

What's the problem? Mapped out in the right image or images are not mapped out

CodePudding user response:

The example code inside a lot of, don't have to knock,
MSDN98_1. ISO http://pan.baidu.com/s/1dDF41ix, MSDN98_2. ISO http://pan.baidu.com/s/1bnGo0Vl

CodePudding user response:

@ zhao4zhong1
Oh, my mom, someone knocked at the hundreds of megabytes of code

CodePudding user response:

reference 1st floor lx624909677 response:
what's the problem? Mapped out in the right image or images are not mapped

No problem, I just draw the curve of knock out record on the post, after that, take a look at it when you are going to use it record and CTRL + v + c, by the way

CodePudding user response:

CSDNdarker
reference 4 floor response:
Quote: refer to 1st floor lx624909677 response:

What's the problem? Mapped out in the right image or images are not mapped

No problem, I just draw the curve of knock out record on the post, take a look at it when you are going to use it after the record, by the way, CTRL + v + c

Note to write blog better ~!

CodePudding user response:

C/C + + int main () {} [code]

CodePudding user response:

[code=c + +] int main () {} [/code]

CodePudding user response:

 int main {} 

CodePudding user response:

  • Related