C 目標平台x86下啟動軟鍵盤

2021-10-04 01:33:53 字數 2941 閱讀 7418

實現方式:

以下****網際網路

#region 目標平台x86下啟動系統軟鍵盤		

[dllimport

("kernel32.dll"

, setlasterror =

true)]

public

static

extern

bool

wow64disablewow64fsredirection

(ref

intptr ptr);[

dllimport

("kernel32.dll"

, setlasterror =

true)]

public

static

extern

bool

wow64revertwow64fsredirection

(intptr ptr)

;public

const

uint32 wm_syscommand =

0x112

;public

const

uint32 sc_restore =

0xf120;[

dllimport

("user32.dll"

, charset = charset.auto)

]public

static

extern

intptr

sendmessage

(intptr hwnd,

uint32 msg,

intptr wparam,

intptr lparam)

;"osk.exe"

;private

void

startosk()

// osk.exe is in windows/system folder. so we can directky call it without path

using

(process osk =

newprocess()

)// re-enable directory virtualisation if it was disabled.

if(environment.is64bitoperatingsystem)

if(sucessfullydisabledwow64redirect)

wow64revertwow64fsredirection

(ptr);}

else

}

效果預覽:

需要引用:devcomponents.dotnetbar.keyboard.dll

在窗體中建立touchkeyboard例項

然後對textbox1設定

this.touchkeyboard1.setshowtouchkeyboard(this.textbox1, devcomponents.dotnetbar.keyboard.touchkeyboardstyle.inline);

例項化virtualkeyboardcolortable。

通過修改touchkeyboardstyle的值可以更新鍵盤展示方式。

通過對virtualkeyboardcolortable的屬性修改可以更改鍵盤樣式。

完整**:

form6.designer.cs

namespace testvirtualkeyboard

base

.dispose

(disposing);}

#region windows form designer generated code

///

/// required method for designer support - do not modify

/// the contents of this method with the code editor.

///

private

void

initializecomponent()

#endregion

private

system.windows.forms.textbox textbox1;

private

devcomponents.dotnetbar.keyboard.touchkeyboard touchkeyboard1;

}}

form6.cs

using system;

using system.collections.generic;

using system.componentmodel;

using system.data;

using system.drawing;

using system.text;

using system.windows.forms;

using devcomponents.dotnetbar.keyboard;

namespace testvirtualkeyboard

private

void

form6_load

(object sender,

eventargs e)

private

void

form6_formclosing

(object sender,

formclosingeventargs e)

}}

x86平台下linux配置編譯與啟動

以前學習的基礎知識都忘記了,趁放假回來好好補補基礎。今天下午辦完簽證後,回來重新在x86平台上面配置編譯了一下linux核心,並且設定啟動。所有的工作是在虛擬機器下面進行的。下面首先談談理論上編譯配置核心需要用哪些步驟 make clean remove all generate files but...

X86平台下,Caffe MKL安裝詳解

ffmpeg安裝opencv安裝boost庫安裝cmake 3.12安裝mkl安裝gflags安裝 2 配置 mkdir build cd build cmake dcmake install prefix home yzhang env gflags d build shared libs on ...

X86架構下Linux啟動過程分析

1 x86架構下的從開機到 start kernel 啟動的總體過程 這個過程簡要概述為 開機 bios grub lilo linux kernel 其執行的流程圖和重要函式如下圖所示 2 載入 linux 核心 基於 x86 的記憶體布局圖 0a0000 reserved for bios do...