Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting rid of on screen keyboard
Message
From
08/12/2004 12:57:13
 
 
To
08/12/2004 08:13:08
Brian O'Donovan
Crescent Computers
Cork, Ireland
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00967702
Message ID:
00967814
Views:
7
I like shellexecute, findwindow, and postmessage:
DECLARE INTEGER ShellExecute IN "Shell32.dll" ;
	INTEGER HWND, ;
	STRING lpVerb, ;
	STRING lpFile, ;
	STRING lpParameters, ;
	STRING lpDirectory, ;
	LONG nShowCmd

= ShellExecute(0, "open", "osk.exe", '', "", 0)

* The below is just for test purposes to give the
* on-screen keyboard a chance to actually load and display
* before VFP tries to find its window handle
i = 0
DO WHILE i < 100000
   i = i + 1
ENDDO

* See if the On-Screen Keyboard is running and if so, close it
lcWindow = "On-Screen Keyboard"
lnHand=CheckWin(lcWindow)

#DEFINE WM_QUIT 0x12

DECLARE SHORT PostMessage IN USER32.DLL ;
	INTEGER HWND, ;
	INTEGER uMsg, ;
	INTEGER wParam, ;
	INTEGER LPARAM

IF UPPER(TYPE('lnHand'))="N" .AND. lnHand > 0
   =PostMessage(lnHand,WM_QUIT,0,0)
ENDIF
RETURN

PROCEDURE CheckWin
PARAMETER tcTitle

DECLARE INTEGER FindWindow IN Win32API AS FindWindow STRING, STRING
lnHand=FindWindow(0,tcTitle)
RETURN lnHand
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform