ytftdkjxkj 2016-04-21 12:02 采纳率: 50%
浏览 2000

vs2012 c# SystemParametersInfo 在win7下无法设置桌面背景

程序在win10下可用.在win7下一直返回值:0
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

    private void Form1_Load(object sender, EventArgs e)
    {
        int temp = SystemParametersInfo(20,0,"C:\\Windows\\Web\\Wallpaper\\img0.bmp",0);
        Console.WriteLine(temp);
    }


    [DllImport("user32.dll", EntryPoint = "SystemParametersInfo")]
    public static extern int SystemParametersInfo(
     int uAction,
     int uParam,
     string lpvParam,
     int fuWinIni
     );


}

}

在win10下正常.在WIN7下一直返回零,麻烦各位大神支个招

  • 写回答

4条回答

  • ytftdkjxkj 2016-04-21 14:00
    关注

    修改注册也只在WIN10有用.WIN7无用.真是奇了怪了

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料