Sendkeys doesn't work to dhtml edit control on win xp - vb6

The code below will send the keystrokes to the DHTML edit control on Windows Vista but not on windows xp.
DHTMLEdit1.SetFocus
MySendKeys ("zzz")
MySendKeys refers to a replacement for VB6 Sendkeys written by Karl Peterson for windows vista and beyond. But I don't think that's relevant because the following code does not work on xp either
DHTMLEdit1.SetFocus
SendKeys ("zzz")
On windows xp the DHTML edit control is "DHTML Edit Control for IE5" according to the project components window in vb6
On windows vista it's the "DHTML Editing Control" which does not come pre-installed with windows but is available from Microsoft.
Does anyone know how to make it work?

SendKeys() isn't so compatible anymore. DHTML editor likely has another method of inputting data that doesn't require you to hack something together like that. For the most part, it's usually a security risk.
Also, it's likely a different control altogether, and it might not even properly respond to key strokes.
Perhaps you can elaborate on what you're attempting - maybe there's a better solution than sending key strokes.

I ended up using this inelegant solution
Clipboard.SetText "zzz"
DHTMLEdit1.ExecCommand DECMD_PASTE, OLECMDEXECOPT_DODEFAULT
DHTMLEdit1.SetFocus
On vista and later it's effect is the same as sendkeys.
On xp it inserts the text correctly but doesn't leave you
with a blinking cursor (you have to manually click the control
to resume typing from the keyboard).

Related

Is it possible to use the letter keys to access programs on Windows 8.1 Metro, like in XP?

For those who remember (or still use) Windows XP, you might remember that you could launch the start bar with your Windows key on your keyboard and then hit the letter of the program/folder/file you wanted and as long as there wasn't another program/folder/file on the start bar starting with the same letter, it'd launch right away.
e.g. If you wanted to open excel, you'd hit the windows key and press the letter "e" and excel would launch.
So, for those who do remember that feature, I'm wondering, is there any way to get that functionality back in Windows 8.1? Right now, what happens is that when you hit the windows key, Metro pops up (which is fine) but if you type "e", for example, windows will automatically start searching instead of just launching Excel (or whatever letter you've typed).
I'd rather keep the interface as it is and, if possible, prefer not to install any 3rd party software (unless there's no other go). My preference is to be able to utilize the OS to get that option (if available), even if that includes going through regedit.
Just a note, I am already aware that 8.1 and XP are completely different architectures and I also realize that automatic searching does have its benefits but I prefer that specific XP functionality so it'd be great if I could get it back in 8.1.
Thanks in advance for your help.
This isn't the exact thing that I'm looking for but I've found somewhat of a workaround. You can create global keyboard shortcuts and thereby circumvent the metro/start screen altogether.
To do so, create a shortcut of the program/folder/file you want to easily access (the shortcut can be placed anywhere). Then, go to the properties of the shortcut and go to the shortcut tab where you can enter a global shortcut key (about half way down the box).
Of course, there are limitations to this because there are only a few keys (key combinations) free that you can use globally whereas with the XP method I was looking for, you could essentially have up to 36 different items you can access with just two keystrokes (26 letters, 10 numbers - not sure if other characters worked).
If anyone has figured out the XP method, though, that would be great.

Is it possible to change Windows IME globally?

First of all, I am NOT asking about how to change the IME of my own application.
I would like to create a IME toggle program for my own use, like that of Mac OS. Windows 8 got better but Windows 7 sucks at here. Alt+Shift to cycling through more than 2 IMEs are painful. (I use three.) I can assign a shortcut for each language but the keyboard combination sucks and more importantly, there is a bug that the shortcut keeps disappearing.
To create such a program, I need to
1)know the current IME mode (global)
2)set a specific IME mode (globally)
I looked up Windows' IME API, but I could not find any. Is there any way? If there is none, please tell me so. I will also accept that as an answer. If there is any way, just hint me the names of the API, I will search for the details.
Thank you.
I found out the answer myself.
"GetKeyboardLayout"
PostMessage WM_INPUTLANGCHANGEREQUEST
The ImmSimulateHotKey function can toggle IME on windows 7 ,but I find the ImmIsIME function is invalidation on win 7。

How does the explorer/windows taskbar work internally?

I am trying to write a very limited taskbar replacement without the start menu and the standard desktop.
But now i wonder how explorer.exe works internally.
1.) How does the taskbar catch minimizing windows?
2.) How do the taskbar get to know when a window opens or closes or somthing? (Is there an api?)
3.) How does explorer.exe enable visual styles? (If it doesn't run all styles are disabled and it looks like win9x)
Review the SetWindowsHookEx() documentation in the MSDN Library. The important hook type here is WH_SHELL.
SetWindowsHookEx with a WH_CBT or WH_SHELL hook (I'm not sure if WH_SHELL works 100% on all systems when explorer is not running)
As far as #3 goes, I don't think I have seen that problem.
Explorer uses a lot of undocumented functions, you should take a look at some of the open source replacement shells or google RegisterShellHook, ShellDDEInit and ARW_HIDE
Check RegisterShellHookWindow, I believe Microsoft added it to avoid having to maitain a 32-bit and a 64-bit hook on newer x64 OS versions.

How to change the text in standard dialog button in Windows 7?

How can I change the "OK" text into "Great!" on all buttons in Windows 7's dialog windows?
The MessageBox function is documented as being in User32.dll. Modify that and you should be set.
A couple of caveats:
This is an important system DLL and Microsoft will have gone to some lengths to keep it from being modified. Not only will you have trouble modifying it, but if you succeed Windows might restore it from a backup as soon as it can.
If you screw up you might make your system unbootable.
If I ever find you doing this to any PC of mine, prepare to hide and hide well, because I will be looking for you.

How does edit.exe work?

There is an exe in system32 called edit.com . It is an old text editor. I'm wondering how they made a console app have a gui, and work with the mouse? Thanks
There are no shortcuts.The mouse had to be interfaced with through assembly code.You would call interrupt 33 to have access to several functions like reading the mouse motion counters and button states. Then you'd read the CPU registers to get those numbers. From there on you could do everything else in C, including the GUI-like interface. There's no shortcut to that either - it must be manually done, each individual square has to be painted the correct color.
edit.com is REALLY old. It was written before the Windows GUI was really popular. They probably use special DOS functions to create the graphics and recognize the mouse.
Well prior to Windows 3.1 there used to be an operating system call DOS and I believe the mouse thing came with DOS 5.0 or DOS 4.0.
Your best bet for adding mouse and color support to a console is to use some kind of TextArea control and make your own console instead of using the DOS console. You could also look into ncurses for Windows but I don't recommend it. If you just want color you could also look at this tutorial.

Resources