Home > Software engineering >  Urgent help!!!!!! The great god to come in and have a look
Urgent help!!!!!! The great god to come in and have a look

Time:10-21

I need a software using VB to do now, is a block input method of the soft keyboard (such as wangma wubi soft keyboard), various methods can be, as long as not the soft keyboard to use into (but input method can use) according to how to do it, the great god give a way of thinking,,,,

Tears shed tears

CodePudding user response:


This......
What's the purpose...

CodePudding user response:

Purpose, it's a long story, is mainly used to factory computer control machines, probably is to prevent production line operator wrong operation, anyhow can realize on OK ah, god is there what way ah, mentality is also OK, direction is OK

CodePudding user response:

This is a bit harder to achieve disabled, could really bad to do,

Don't know what do you want to disable all program (that is, the system running in any program) soft keyboard input method, or only for his own program?
If is your own programs, may be addressed by HOOK (as long as find opens the soft keyboard, immediately send message close it),

But want to use this method to deal with the third party programs, probably the effect is not very good,

CodePudding user response:

I think so, for example take the wangma wubi, I've been testing program wangma appears without wubi process, if appear, simply loop hair message to close the software plate line all the time? And I checked on the net a few API about input method, I don't know this a few apis can set the cancellation of the input method software offers?
GetKeyboardLayoutList
ImmGetDescription
ImmIsIME
ActivateKeyboardLayout
GetKeyboardLayout
Brother you can not see?

Thank you very much

CodePudding user response:

Is against the third party programs

CodePudding user response:

May change the way of thinking, to find better and closed the window of the soft keyboard, etc. It deals with the key messages sent through the keyboard, you has been difficult to distinguish the source of it,

CodePudding user response:

Find a simpler way to implement: as long as find opens the soft keyboard, I put it in the window to hide!
(window is hidden, nature can't operating software disc)

Create a new standard EXE engineering,
Then: Form1 remove, add a standard module, a class module (class name: claAtom),
The code is as follows:
 'standard module code: 
Option Explicit

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function ShowWindow Lib "User32" (ByVal hWnd As Long, ByVal nCmd As Long) As Long
Private Declare Function GetKeyState Lib "User32" (ByVal nVirtKey As Long) As an Integer
Private Declare Function FindWindowEx Lib "User32" Alias "FindWindowExW" (_
ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
ByVal lpsz1 As Long, ByVal lpsz2 As Long As Long)


Private Const ATOM_TEXT As String="SoftKBD_Surveillant"
Private Const SOFTKBDCLASS As String="SoftKBDClsC1"

Private Sub Main ()
Dim objAtom As claAtom
Dim lpSKclass As Long
Dim lHWnd As Long

'global atom is used to implement single instance running
The Set objAtom=New claAtom
If (Not objAtom. GetAtom (ATOM_TEXT) Then the Exit Sub
LpSKclass=StrPtr (SOFTKBDCLASS)
Do
LHWnd=FindWindowEx (0, 0, lpSKclass, 0)
Do
If (0=lHWnd) Then
The Exit Do
The Else
Call ShowWindow (lHWnd, 0)
The Exit Do
End the If
LHWnd=FindWindowEx (0, lHWnd lpSKclass, 0)
Loop
'by the end of F12 program (actual compiled exe, you can remove)
If (& amp; H8000 And GetKeyState (vbKeyF12)) Then Exit the Do
DoEvents
Call Sleep (10) 'can use 5 to 20 ms, time is too short don't need to, is too slow long,
Loop
End Sub

'===========================================

'class module code: (note that the name of the class: claAtom)
Option Explicit
'use of "global atom" to prevent double running program
Private Declare Function GlobalAddAtom Lib "kernel32" Alias "GlobalAddAtomA" (_
ByVal AtomName As String) As an Integer
Private Declare Function GlobalFindAtom Lib "kernel32" Alias "GlobalFindAtomA" (_
ByVal AtomName As String) As an Integer
Private Declare Function GlobalDeleteAtom Lib "kernel32" (ByVal AtomName As Integer) As an Integer

Private Atom As Integer

The Public Function getAtom (AtomName As String) As Boolean
The Atom=0
If (GlobalFindAtom (AtomName)=0) Then the Atom=GlobalAddAtom (AtomName)
GetAtom=Atom
End the Function

Private Sub Class_Terminate ()
If (Atom) Then Call GlobalDeleteAtom (Atom)
End Sub

  • Related