1、将form的Opacity从100%调为我们想要的透明度,例如this->Opacity = 0.2;
2、在form_load函数中加入:
HWND hWnd=::FindWindow(NULL,L"Form1");
DWORD dwNewLong = GetWindowLong(hWnd, GWL_EXSTYLE);
dwNewLong |= WS_EX_TRANSPARENT |WS_EX_LAYERED;
SetWindowLong(hWnd, GWL_EXSTYLE, dwNewLong);
当然要加些头文件#include <windows.h>
#pragma comment(lib, "User32.lib")
3、设置屏幕的WindowState为Maximized;设置屏幕的TopMost为true,然后设置想要的遮罩层的颜色为form的backcolor