让您写的VC6.0程序在WindowsXP中拥有XP风格的外衣

比如,你生成的exe文件为“Example.exe”,则这个Example.exe.manifest的文件的内容如下:
新建一个文本文档,输入
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="CompanyName.ProductName.YourApp"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
 
    将以上内容保存为Example.exe.manifest。
Example.exe.manifest文件和Example.exe必须放在同一个目录。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,下面是一个简单的VC6.0++程序,可以画出驻波图形。 ```c++ #include <windows.h> #include <math.h> #define PI 3.14159265358979323846 LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { WNDCLASS wc; HWND hWnd; MSG msg; memset(&wc, 0, sizeof(wc)); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WndProc; wc.hInstance = hInstance; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wc.lpszClassName = TEXT("MyClass"); RegisterClass(&wc); hWnd = CreateWindow(TEXT("MyClass"), TEXT("驻波图形"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640, 480, NULL, NULL, hInstance, NULL); ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return (int)msg.wParam; } LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { static int cxClient, cyClient; static TCHAR szText[] = TEXT("驻波图形"); static HPEN hPen; static HDC hdc; static double f = 0; switch (message) { case WM_CREATE: hdc = GetDC(hWnd); hPen = CreatePen(PS_SOLID, 2, RGB(0, 0, 255)); SelectObject(hdc, hPen); break; case WM_SIZE: cxClient = LOWORD(lParam); cyClient = HIWORD(lParam); break; case WM_PAINT: { PAINTSTRUCT ps; hdc = BeginPaint(hWnd, &ps); SetBkMode(hdc, TRANSPARENT); int x1, x2, y1, y2; //绘制坐标轴 MoveToEx(hdc, 10, cyClient / 2, NULL); LineTo(hdc, cxClient - 10, cyClient / 2); MoveToEx(hdc, cxClient / 2, 10, NULL); LineTo(hdc, cxClient / 2, cyClient - 10); //绘制驻波图形 for (int i = -cxClient / 2; i <= cxClient / 2; i++) { x1 = i; y1 = (int)(cyClient / 2 * (1 + sin(2 * PI * i / 80 + f))); x2 = x1 + 1; y2 = (int)(cyClient / 2 * (1 + sin(2 * PI * (i + 1) / 80 + f))); MoveToEx(hdc, cxClient / 2 + x1, y1, NULL); LineTo(hdc, cxClient / 2 + x2, y2); } f += 0.02; EndPaint(hWnd, &ps); } break; case WM_DESTROY: DeleteObject(hPen); ReleaseDC(hWnd, hdc); PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } ``` 程序使用了sine函数来绘制驻波图形,sin函数的参数可以根据需要进行调整,可以得到不同的驻波图形。同时使用`WM_SIZE`消息获取窗口大小,使得驻波图形可以自适应窗口大小。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值