2009-11-14 3 views
1

Windows 7에서 화면을 터치하면 터치 포인트에서 발생하는 짧은 애니메이션이 있습니다.WPF에서 Windows 7 터치 애니메이션 사용 안 함

내 WPF 앱에서 Windows에서 제공하는 것을 표시하지 않고 자체 터치 포인트를 표시하려고합니다.

앱에서 사용 중지하는 방법에 대한 아이디어가 있으십니까?

답변

1

Windows Touch 용 서피스 툴킷을 살펴보면 오늘이 사실을 알게되었습니다. 루트 응용 프로그램의 창에서이 작업을 수행 할 경우

// override on the Window class 
protected override void OnSourceInitialized(EventArgs e) 
{ 
    EnableTabletGestures(this, false); 
} 

[DllImport("kernel32.dll", CharSet = CharSet.Unicode)] 
public static extern short GlobalAddAtom(string atom); 

[DllImport("user32.dll", CharSet = CharSet.Unicode)] 
public static extern IntPtr RemoveProp(IntPtr hWnd, string atom); 

[DllImport("user32.dll", CharSet = CharSet.Unicode)] 
public static extern int SetProp(IntPtr hWnd, string atom, IntPtr handle); 

public bool EnableTabletGestures(Window window, bool enable) 
{ 
    var hWnd = ((HwndSource)PresentationSource.FromVisual(window)).Handle; 

    long num = 0L; 
    string atom = "MicrosoftTabletPenServiceProperty"; 
    num = GlobalAddAtom(atom); 
    if (num == 0L) 
    { 
     return false; 
    } 
    if (enable) 
    { 
     return (RemoveProp(hWnd, atom).ToInt64() == 1L); 
    } 
    int num2 = 0x1010019; 
    return (SetProp(hWnd, atom, new IntPtr(num2)) == 1); 
} 
4

당신은, 최선의하지만, 특별히 특정 경우에, 당 관리 기준을 해제 할 수 있습니다, 어떤이 (팝업 포함) 창을 양산. 당신의 XAML 파일의 ""요소에 다음 연결된 속성을 추가, 그래서 당신은이 같은 끝낼 : 당신이 Microsoft Surface Toolkit for Windows Touch을 (현재 베타)를 사용하는 경우,

<Window x:Class="MyWPFTouchFreeApp" 
... [<omitted elements>] 
Stylus.IsTapFeedbackEnabled="False" Stylus.IsTouchFeedbackEnabled="False" 
Stylus.IsPressAndHoldEnabled="False" Stylus.IsFlicksEnabled="False" 
... [<any other omitted attributes>] 
> 
    <Grid ... 

    </Grid> 
</Window> 

또한, SurfaceWindow를 사용하여 자동으로 비활성화됩니다 이것들은 당신을 위해 (팝업은 여전히 ​​수동으로 처리되어야합니다).

관련 문제