没有合适的资源?快使用搜索试试~ 我知道了~
unity中实现发布后的程序显示在最前面的源码
4星 · 超过85%的资源 需积分: 33 102 下载量 26 浏览量
2017-11-16
11:56:41
上传
评论
收藏 1KB TXT 举报
温馨提示
试读
2页
unity中实现发布后的程序显示在最前面的源码,用C#编写
资源推荐
资源详情
资源评论
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
[DllImport("User32.dll")]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
[DllImport("User32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("User32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
void FixedUpdate()
{
// terrainToolkit用Product Name替换
IntPtr hwnd = FindWindow(null, "terrainToolkit");
// 如果没有找到,则不做任何操作(找不到一般就是apptitle错了)
if (hwnd == IntPtr.Zero)
{
return;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
[DllImport("User32.dll")]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
[DllImport("User32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("User32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
void FixedUpdate()
{
// terrainToolkit用Product Name替换
IntPtr hwnd = FindWindow(null, "terrainToolkit");
// 如果没有找到,则不做任何操作(找不到一般就是apptitle错了)
if (hwnd == IntPtr.Zero)
{
return;
资源评论
- qq_413198412019-07-23感觉没有用啊
- qq_372732942017-12-01一会试一下
- qq_218121372019-06-10看看怎么样
qq_39816832
- 粉丝: 3
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功