Flashing a window

本文提供了一个使用 Windows API 实现窗口闪烁效果的示例代码。通过创建一个简单的应用程序,演示了如何利用 FlashWindow 和 FlashWindowEx 函数使按钮所在的窗口产生闪烁效果。
#include <windows.h>

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);


int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PWSTR lpCmdLine, int nCmdShow)
{
  MSG  msg;    
  WNDCLASSW wc = {0};
  wc.lpszClassName = L"Flash";
  wc.hInstance     = hInstance;
  wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
  wc.lpfnWndProc   = WndProc;
  wc.hCursor       = LoadCursor(0,IDC_ARROW);

  RegisterClassW(&wc);
  CreateWindowW(wc.lpszClassName, L"Flash",
               WS_OVERLAPPEDWINDOW | WS_VISIBLE,
               100, 100, 250, 180, 0, 0, hInstance, 0);

  while( GetMessage(&msg, NULL, 0, 0)) {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
  }

  return (int) msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
    WPARAM wParam, LPARAM lParam )
{
  FLASHWINFO fwi;

  switch(msg)  
  {
      case WM_CREATE:

          CreateWindowW(L"Button", L"Flash",
                  WS_CHILD | WS_VISIBLE,
                  10, 10, 80, 25, 
                  hwnd, (HMENU) 1, NULL, NULL);
          break;

      case WM_COMMAND:

          fwi.cbSize = sizeof(fwi);
          fwi.dwFlags = FLASHW_ALL;
          fwi.dwTimeout = 0;
          fwi.hwnd = hwnd;
          fwi.uCount = 4;

          FlashWindowEx(&fwi);
          break;

      case WM_DESTROY:

          PostQuitMessage(0);
          break; 
  }

  return DefWindowProcW(hwnd, msg, wParam, lParam);
}

#### 1.2.4. Game 3 - Memorisation (17 marks) This game is loosely based off of a [memorisation game](https://youtu.be/ki43Fp7dEos). * This screen exists on the route `/game/memory` and contains the nav bar and other details from `1.2.0`. (0.5) * This page will consist of a 4 x 4 grid of cells that are all 25% width and 25% height of the surrounding container (so that they are all evenly distributed). (2) * The cells have a border of `rgb(255,255,0) 1px solid` and have a background colour of white. (1) * When the component mounts, or when the game is reset, an confirmation box pops up that asks "Would you like to play?". If the user clicks yes/confirm, then the game begins. If the user clicks no, then the dialogue disappears and nothing happens until the game is reset again (1). * Gameplay is as follows: 1) Begin stage 1: (4.5) a) A random cell in the grid flashes (i.e. has background `#999` for 0.5 seconds) b) Once complete, the user is then able to click on any of the cells. If they click on the random cell that flashed before, they move onto stage 2. If they click the wrong one, all cells flash with a `red` background for 0.5 seconds and the user repeats this step. 2) Begin stage 2: (5) a) A random cell in the grid flashes for 0.5s, and then a second random cell in the grid flashes immediately after for 0.5s. These cells can be the same. b) Once the flashing in (a) is complete, the user is then able to click on any of the cells. They need to click on two cells one at a time, in the same order originally displayed. If they click on them in the correct order, they move onto stage 3. If they click on them in the wrong order, all cells flash with a `red` background for 0.5 seconds and the user repeats this step. 3) Begin stage 3: stage 3 is identical to stage 2 except there are 3 cells to memorise (1) 4) Begin stage 4: stage 4 is identical to stage 3 except there are 4 cells to memorise (1) 5) Begin stage 5: stage 5 is identical to stage 4 except there are 5 cells to memorise, and when they guess them successfully there is an alert that says `Congratulations` and the game is now considered to have been "won", and the game repeats. (1)这个题目怎么写,请用Memorisation.jsx和App.css
12-06
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"> <title>hello🎉の个人主页</title> <meta name="description" content="这里是Hello逍遥の个人主页,欢迎访问哟~"> <meta name="keywords" content="Hello逍遥,Hello逍遥の个人主页,主页,前端"> <link rel="stylesheet" type="text/css" href="./css/FiraCode.css"> <link rel="stylesheet" type="text/css" href="./css/flesx.css"> <link rel="shortcut icon" href="http://syxywl.cn/img/tx.png"> </head> <body> <div id="box"> <!-- 个人资料卡片 --> <div class="meBox"> <!-- 头像 --> <div class="headPhoto"></div> <!-- 介绍 --> <div class="meBox-title"> <p>Hello逍遥</p> <div class="fg"></div> </div> <div class="meBox-text"> <p>喜欢学习📚</p> <p>热爱互联网💻</p> <p>甜品-鉴赏师 <img src="./img/002.png" alt="冰激凌" style="width: 15px; vertical-align: middle;"></p> <p>摸鱼组-组长 <img src="./img/fish.png" alt="冰激凌" style="width: 15px; vertical-align: middle;"></p> <p>瞎折腾浪费时间最在行</p> </div> <!-- 两个按钮 --> <div class="meBox-Button"> <a href="">⚽</a> <a href="">🐧</a> </div> </div> <!-- 伪终端介绍 --> <div id="cmdBox"> <!-- 第一个终端 --> <div class="cmd"> <!-- 三个按钮 --> <div class="click"> <div class="red"></div> <div class="yellow"></div> <div class="green"></div> </div> <!-- 顶部标题 --> <div class="title"> <span>FancyPig - bash</span> </div> <!-- 终端内文字 --> <div class="cmdText"> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);">./fancypig.sh</span> <br /> <iframe scrolling="no" src="https://tianqiapi.com/api.php?style=tu&skin=pitaya" frameborder="0" width="350" height="24" allowtransparency="true"></iframe> <br /> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);">cat ./me.txt</span> <p>昵称:逍遥</p> <p>性别:男</p> <p>年龄:25岁</p> <p>地址:中国</p> <p>邮箱:28009618@qq.com</p> <br> <p>Golang才能改变世界</p> <p>机器学习是网安的未来</p> <p>这条路我才刚刚迈开了我的第一步</p> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);"></br>sudo rm -rf ./过去的自己/*</span> <p>sudo: 请输入密码: *******</p> <p>bash: 已删除</p> <span style="color: blue;">~~</span> </div> </div> <!-- 第二个终端 --> <div class="cmd cmd2"> <!-- 三个按钮 --> <div class="click"> <div class="red"></div> <div class="yellow"></div> <div class="green"></div> </div> <!-- 顶部标题 --> <div class="title"> <span>fancypig - bash</span> </div> <!-- 终端内文字 --> <div class="cmdText"> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);">./links.sh</span> <p>我的站点:</p> <ul class="ul"> <li><a href="">flashing</a></li> <li><a href="">Genshin</a></li> <li><a href="">Douluo</a></li> </ul> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);">./yiyan.sh</span> <p class="hito">恰沐春风共同游,终只叹,木已舟。</p> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);">./ip.sh</span> <p class="getip"></p> </div> </div> </div> </div> <!-- 页脚 --> <div id="footer"> <p>© 2022 By FancyPig 🎇 <a href="https://beian.miit.gov.cn/#/Integrated/recordQuery">苏ICP备2022032841号-1</a> <img src="./img/b2.png"> <a href="https://beian.mps.gov.cn/#/query/webSearch">苏公网安备32032202000416</a></p> </div> <script src="https://v1.hitokoto.cn/?encode=js&select=.hito" defer></script> <script src="https://pv.sohu.com/cityjson?ie=utf-8"></script> <script type="text/javascript">(function getip(selector){var ip="你的 IP: "+returnCitySN["cip"];var ele=document.querySelector(selector);Array.isArray(ele)?ele[0].innerText=ip:ele.innerText=ip;})('.getip')</script> </body> </html> 重写 可以改变UI 使用最优方案
最新发布
12-28
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"> <title>hello🎉の个人主页</title> <meta name="description" content="这里是Hello逍遥の个人主页,欢迎访问哟~"> <meta name="keywords" content="Hello逍遥,Hello逍遥の个人主页,主页,前端"> <link rel="stylesheet" type="text/css" href="./css/FiraCode.css"> <link rel="stylesheet" type="text/css" href="./css/flesx.css"> <link rel="shortcut icon" href="http://syxywl.cn/img/tx.png"> </head> <body> <div id="box"> <!-- 个人资料卡片 --> <div class="meBox"> <!-- 头像 --> <div class="headPhoto"></div> <!-- 介绍 --> <div class="meBox-title"> <p>Hello逍遥</p> <div class="fg"></div> </div> <div class="meBox-text"> <p>喜欢学习📚</p> <p>热爱互联网💻</p> <p>甜品-鉴赏师 <img src="./img/002.png" alt="冰激凌" style="width: 15px; vertical-align: middle;"></p> <p>摸鱼组-组长 <img src="./img/fish.png" alt="冰激凌" style="width: 15px; vertical-align: middle;"></p> <p>瞎折腾浪费时间最在行</p> </div> <!-- 两个按钮 --> <div class="meBox-Button"> <a href="">⚽</a> <a href="">🐧</a> </div> </div> <!-- 伪终端介绍 --> <div id="cmdBox"> <!-- 第一个终端 --> <div class="cmd"> <!-- 三个按钮 --> <div class="click"> <div class="red"></div> <div class="yellow"></div> <div class="green"></div> </div> <!-- 顶部标题 --> <div class="title"> <span>FancyPig - bash</span> </div> <!-- 终端内文字 --> <div class="cmdText"> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);">./fancypig.sh</span> <br /> <iframe scrolling="no" src="https://tianqiapi.com/api.php?style=tu&skin=pitaya" frameborder="0" width="350" height="24" allowtransparency="true"></iframe> <br /> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);">cat ./me.txt</span> <p>昵称:逍遥</p> <p>性别:男</p> <p>年龄:25岁</p> <p>地址:中国</p> <p>邮箱:28009618@qq.com</p> <br> <p>Golang才能改变世界</p> <p>机器学习是网安的未来</p> <p>这条路我才刚刚迈开了我的第一步</p> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);"></br>sudo rm -rf ./过去的自己/*</span> <p>sudo: 请输入密码: *******</p> <p>bash: 已删除</p> <span style="color: blue;">~~</span> </div> </div> <!-- 第二个终端 --> <div class="cmd cmd2"> <!-- 三个按钮 --> <div class="click"> <div class="red"></div> <div class="yellow"></div> <div class="green"></div> </div> <!-- 顶部标题 --> <div class="title"> <span>fancypig - bash</span> </div> <!-- 终端内文字 --> <div class="cmdText"> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);">./links.sh</span> <p>我的站点:</p> <ul class="ul"> <li><a href="http://syxywl.cn/ymxy/sszg/">flashing</a></li> <li><a href="http://syxywl.cn/ymxy/ys/">Genshin</a></li> <li><a href="http://syxywl.cn/ymxy/dldl/">Douluo</a></li> </ul> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);">./yiyan.sh</span> <p class="hito">恰沐春风共同游,终只叹,木已舟。</p> <span style="color: rgb(0, 190, 0);">root@fancypig</span> <span style="color: blue;">~</span> <span style="color: rgb(39, 39, 39);">./ip.sh</span> <p class="getip"></p> </div> </div> </div> </div> <!-- 页脚 --> <div id="footer"> <p>© 2022 By FancyPig 🎇 <a href="https://beian.miit.gov.cn/#/Integrated/recordQuery">苏ICP备2022032841号-1</a> <img src="./img/b2.png"> <a href="https://beian.mps.gov.cn/#/query/webSearch">苏公网安备32032202000416</a></p> </div> <script src="https://v1.hitokoto.cn/?encode=js&select=.hito" defer></script> <script src="https://pv.sohu.com/cityjson?ie=utf-8"></script> <script type="text/javascript">(function getip(selector){var ip="你的 IP: "+returnCitySN["cip"];var ele=document.querySelector(selector);Array.isArray(ele)?ele[0].innerText=ip:ele.innerText=ip;})('.getip')</script> </body> </html> 优化加载速度 调整 头像大小 我默认上传的是 800*800 http://syxywl.cn/img/tx.png 整体优化 使用最优方案 完整写出
12-28
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值