登录Windows界面前执行自定义脚本,要求的函数不

首先展示错误信息:

通常情况下,进入Windows界面之前都有一个登录过程,如何在登录前让系统执行脚本呢?下面介绍一种方法。

图片 1图片 2

图片 3

1.打开组策略,在Run(运行)中输入GREDIT.MSC,点击确认。

 1 *-------------------------------------
 2     BEEPER1.C -- Timer Demo Program No.1
 3     (c) Charles Petzold, 1998
 4     -------------------------------------*/
 5 
 6 #include <Windows.h>
 7 
 8 #define ID_TIMER 1
 9 
10     LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
11 
12 int WINAPI WinMain( __in HINSTANCE hInstance
13     , __in_opt HINSTANCE hPrevInstance
14     , __in LPSTR lpCmdLine
15     , __in int nShowCmd )
16 {
17     static TCHAR szAppName[] = TEXT("Bepper1");
18     HWND hwnd;
19     MSG msg;
20     WNDCLASS wndclass;
21 
22     wndclass.style = CS_HREDRAW | CS_VREDRAW;
23     wndclass.lpfnWndProc = WndProc;
24     wndclass.cbClsExtra = 0;
25     wndclass.cbWndExtra = 0;
26     wndclass.hInstance = hInstance;
27     wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
28     wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
29     wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
30     wndclass.lpszMenuName = NULL;
31     wndclass.lpszClassName = szAppName;
32 
33     if (!RegisterClass(&wndclass))
34     {
35         MessageBox(NULL, TEXT("Program requires Windows NT!")
36             , szAppName, MB_ICONERROR);
37         return 0;
38     }
39 
40     hwnd = CreateWindow(szAppName, TEXT("Beeper1 Timer Demo")
41         , WS_OVERLAPPEDWINDOW
42         , CW_USEDEFAULT, CW_USEDEFAULT
43         , CW_USEDEFAULT, CW_USEDEFAULT
44         , NULL, NULL, hInstance, NULL);
45 
46     ShowWindow(hwnd, nShowCmd);
47     UpdateWindow(hwnd);
48 
49     while (GetMessage(&msg, NULL, 0, 0))
50     {
51         TranslateMessage(&msg);
52         DispatchMessage(&msg);
53     }
54 
55     return msg.wParam;
56 }
57 
58 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
59 {
60     static BOOL fFlipFlop = FALSE;
61     HBRUSH hBrush;
62     HDC hdc;
63     PAINTSTRUCT ps;
64     RECT rc;
65 
66     switch (message)
67     {
68     case WM_CREATE:
69         SetTimer(hwnd, ID_TIMER, 1000, NULL);
70         return 0;
71 
72     case WM_TIMER:
73         MessageBeep(-1);
74         fFlipFlop = !fFlipFlop;
75         InvalidateRect(hwnd, NULL, FALSE);
76         return 0;
77 
78     case WM_PAINT:
79         hdc = BeginPaint(hwnd, &ps);
80 
81         GetClientRect(hwnd, &rc);
82         hBrush = CreateSolidBrush(fFlipFlop ? RGB(255, 0, 0) : RGB(0, 0, 255));
83         FillRect(hdc, &rc, hBrush);
84 
85         EndPaint(hwnd, &ps);
86         DeleteObject(hBrush);
87         return 0;
88 
89     case WM_DESTROY:
90         KillTimer(hwnd, ID_TIMER);
91         PostQuitMessage(0);
92         return 0;
93     }
94 
95     return DefWindowProc(hwnd, message, wParam, lParam);
96 }

win10更新系统后,之前连接的服务器都连接不上了,应该用一下方法解决:

图片 4

BEEPER1.C

运行 gpedit.msc,打开本地组策略:计算机配置>管理模板>系统>凭据分配>加密Oracle修正,选择启用,选择易受攻击。

2.依次点击Computer Configuration -> Windows Settings -> Scripts(Startup/Shutdown)

 

本文由ca88手机版登录发布于ca88手机版,转载请注明出处:登录Windows界面前执行自定义脚本,要求的函数不

TAG标签: ca88手机版登录
Ctrl+D 将本页面保存为书签,全面了解最新资讯,方便快捷。