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 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog