2017-01-18 4 views

답변

2

당신은 기본 마우스 커서 테마를 변경하려면 :

enter image description here

그냥 레지스트리에서 변경할 수 있습니다

플레이에 와서 세 가지 레지스트리 키가 있습니다 . 이 커서 1B
)의 다른 유형 계획 소스가 커서 방식의 유형을 지정 있습니다 아래

  1. 레지스트리 키 HKEY_CURRENT_USER \ 제어판 \ 커서

    는 활성 사용자 커서

    1A) 값을 포함 현재 사용되고 있습니다.

    서로 다른 값은 다음과 같습니다

    "0"- Windows 기본
    "1"- 사용 계획
    "2"- 시스템 계획

  2. 레지스트리 키 HKEY_CURRENT_USER \ 제어판 \ 커서는 사용자 정의 커서 계획을 포함 (즉, 계획 출처 = 1)

  3. 레지스트리 키 HKEY_LOCAL_MACHINE의 \의 SOFTWA RE \ Microsoft \ Windows \ CurrentVersion \ Control Panel \ Schemes에는 시스템 커서 체계가 포함되어 있습니다. 계획 출처 = 2) 당신은 이미 HKCU \ 제어판 \ 커서에 커서 유형 중 하나의 경로를 변경하고 아무것도하지 않았다는 것을 깨달았다

enter image description here

합니다. HKCU \ Control Panel \ Cursors \ Arrow와 같이 키를 업데이트하면 정확하지 않습니다. 새 커서를로드하도록 창에 지시해야합니다.

여기가 SystemParametersInfo 전화가 오는 곳입니다.이 기능을 사용하려면 HKCU \ Control Panel \ Cursors \ Arrow를 C : \ WINDOWS \ Cursors \ appstar3.ani (이 아이콘이 있다고 가정)로 변경 한 다음 SystemParametersInfo를 호출합니다.AutoHotkey를 스크립트에서

:
SPI_SETCURSORS := 0x57 
result := DllCall("SystemParametersInfo", "UInt", SPI_SETCURSORS, "UInt", 0, "UInt", 0, "UInt", '0') 
MsgBox Error Level: %ErrorLevel% `nLast error: %A_LastError%`nresult: %result% 

가 C 번호로 번역 :

[DllImport("user32.dll", EntryPoint = "SystemParametersInfo")] 
public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, uint pvParam, uint fWinIni); 

const int SPI_SETCURSORS = 0x0057; 
const int SPIF_UPDATEINIFILE = 0x01; 
const int SPIF_SENDCHANGE = 0x02; 
SystemParametersInfo(SPI_SETCURSORS, 0, 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); 

기본 이제 윈도우 커서

까다로운 부분으로 변경. HKLM \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Control Panel \ Schemes를 보면 "Windows Default"가 ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," 실제 커서에!

지금 무엇을할까요? 걱정마. 다른 커서 유형을 빈 문자열로 설정 한 다음 SystemParametersInfo 호출을 평소와 같이 수행하기 만하면됩니다. 실제로 어떤 계획에서든 커서 유형을 빈 문자열로 설정할 수 있으며 Windows는 "Windows 기본값"체계에서 커서 유형을 기본값으로 사용합니다.

REF : 답장을 보내

https://thebitguru.com/articles/programmatically-changing-windows-mouse-cursors/3

https://social.msdn.microsoft.com/Forums/vstudio/en-US/977e2f40-3222-4e13-90ea-4e8d0cdf289c/faq-item-how-to-change-the-systems-cursor-using-visual-cnet?forum=csharpgeneral

+0

값을 변경하려했지만 아무 일도 일어나지 않았습니다. 여전히 기본 커서입니다. –

+0

업데이트보기 - SystemParametersInfo를 호출해야합니다. –

+0

여기에 오류가 있습니다 : http://i.imgur.com/Agns2vV.png. pvParam이 null 값을 허용하지 않았습니다. pvParam 값을 "0"으로 변경하려고하면 정상적으로 작동합니다. 정말 고맙습니다! –

1
using System; 
using System.ComponentModel; 
using System.Drawing; 
using System.Windows.Forms; 
using System.IO; 
using System.Runtime.InteropServices; 

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

    private void button1_Click(object sender, EventArgs e) { 
     Bitmap bmp = Properties.Resources.Image1; 
     bmp.MakeTransparent(Color.White); 
     IntPtr hIcon = bmp.GetHicon(); 
     Icon ico = Icon.FromHandle(hIcon); 
     Cursor cur = new Cursor(hIcon); 
     using (FileStream fs = new FileStream(@"c:\temp\test.cur", FileMode.Create, FileAccess.Write)) 
     ico.Save(fs); 
     cur.Dispose(); 
     ico.Dispose(); 
     DestroyIcon(hIcon); 

     // Test it 
     cur = new Cursor(@"c:\temp\test.cur"); 
     this.Cursor = cur; 
    } 
    [DllImport("user32.dll")] 
    extern static bool DestroyIcon(IntPtr handle); 
    } 
} 

REF :이 같이 할 수 https://social.msdn.microsoft.com/Forums/windows/en-US/9ea0bf74-760f-4f40-b64c-0cf7b0a56939/save-custom-cursor?forum=winforms

+0

감사합니다,하지만 난뿐만 아니라 현재에 대한 마우스 커서 (손, 화살표, 중, 도움말 선택 ...)을 모두 변경하려면 cursor –

3

. Cursor.cur 파일을 가져 와서 사용자 정의 커서를로드하십시오. MouseLeave에서 양식의 기본 커서를 설정하십시오.

public static Cursor ActuallyLoadCursor(String path) 
    { 
     return new Cursor(LoadCursorFromFile(path)); 
    } 

    [DllImport("user32.dll")] 
    private static extern IntPtr LoadCursorFromFile(string fileName); 

Button btn = new Button(); 
btn.MouseLeave += Btn_MouseLeave; 
btn.Cursor = ActuallyLoadCursor("Cursor.cur"); 

private static void Btn_MouseLeave(object sender, EventArgs e) 
    { 
     this.Cursor = Cursors.Default; 
    } 
+0

폼용뿐만 아니라 모든 Windows 커서를 변경하고 싶습니다. 당신의 도움을 주셔서 감사합니다! –