News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Caps lock on Warnning while in edit box

Started by hfheatherfox07, April 18, 2011, 05:53:30 PM

Previous topic - Next topic

dedndave

Hutch,
i can get the key state - and the focus - no problem there
what i cannot do is control the tooltip - lol
i can create it, set the icon and delay times, and a whole bunch of other stuff
but, i can't force it to pop up
it wants a mousemove message, i think - i might be able to synthesize that message
and - the cursor has to be over the control, and it has to have focus for that
the activate message merely enables/disables - it does not force it to pop up
they don't really give you a simple on/off switch
qWord may have the right idea - owner-drawn   :P

hfheatherfox07,
that version does work - on anything with XP or newer
i think to go back to win2k, you may have to do something a little different
even on XP, i was not able to find a way to get the ES_PASSWORD tooltip handle
i tried enumerating windows, but that tooltip did not show up
that means - you can't get a lot of control on it
things like setting delay times or balloon width require the tooltip handle

hfheatherfox07

Humm... I am a little confused here....

I read everything people write.... I was so excited by seeing example 5 of dedndave that I decided to assemble my own "Cap locks on Example" tool tip with snippets form  dedndave......

I decided that I will start from scratch..... I saw that dedndave mentioned the password format for the edit box..... So I made a new exe with 2 edit boxes again( 2 so I can make sure that the caps lock on comes on only in the desired 1)...
and I added a Manifest... I compiled the exe.....

I must have left my Caps Locks on ....because when I tried the edit boxes that message that I wanted came on?????

I looks like this is a standard API thing with edit boxes that have "password" as the format instead of "Normal" or "Numbers" etc...

It looks like 2 things are needed to get that caps lock on message:

1. The edit box control must be set to "password"  ( I use ResEd by the way )
2. A Manifest

As you can see my ASM is empty, there is no getkeystate or tootip... I did not even initiate the edit boxes 

P.S
Here is Microsoft's  Manifest:
http://msdn.microsoft.com/en-us/library/aa375635%28v=vs.85%29.aspx

and Microsoft's Assembly Manifests:

http://msdn.microsoft.com/en-us/library/aa374219%28v=vs.85%29.aspx




hfheatherfox07

 @ dedndave please see this it deals with Manifest and Win2K Compatibility:

http://www.vbmonster.com/Uwe/Forum.aspx/vb/30889/Manifest-Requires-Win2K-Compatibility

can you use a resource editor and take out a working Manifest from an app on computer that you want this working on and add that Manifest as well as the XPManifest...

by the way will you post a copy of that older Manifest?

qWord

wow - ES_PASSWORD+xml -> it works! Also the warning comes in the users language  :bg
:thumbu
FPU in a trice: SmplMath
It's that simple!

dedndave

ok - i am a bit confused as to what your problem is   :P

the difference between my manifest and the one at that link is the version identity

yes - you can extract a manifest from an EXE with ResHacker or similar

you want me to post an "older mainfest"
i am not sure which "older" one you are talking about - lol
i have tried all kinds of things

in your last example code, the only problem i see is the margin needs to be set on edit control #2
to make sure they are the same, i sent this message to both edit controls
       INVOKE  SendMessage,hEdit,EM_SETMARGINS,EC_LEFTMARGIN or EC_RIGHTMARGIN,0
also, different versions use a different "mask character" to hide the password
so, i set it to "*"
       INVOKE  SendMessage,hEdit2,EM_SETPASSWORDCHAR,'*',0

it is not a "password format", per se
i used the ES_PASSWORD edit control "style"
this requires common controls version 6 or higher to work (XP or newer)
and, it also requires a manifest to work correctly with XP
and - InitCommonControlsEx
when using common controls version 6 or higher, the older InitCommonControls does nothing

i hope that answers all your questions
if not - please ask again   :P

the problem i see with using the ES_PASSWORD style is that it does not appear to work under win2k
so - if you want it to work under win2k (and, i guess win98), you have to make your own tooltip window
it's not that hard to do
but, now you are faced with a new problem   :bg
that is getting the tooltip to pop up when you want it to
specifically, when edit box 2 has focus, and you turn caps lock on - it does not pop up until the mouse moves
the mouse has to be over the edit control (not the same as keyboard focus)
i am sure, with some fine-tuning, you can make it work
another possible problem is eliminating the WS_PASSWORD style tooltip - lol
i can't find a way to get the handle of that bugger

hfheatherfox07

No problems here ....

I thought It was not working for you on an older version of windows...

ES_PASSWORD and a Manifest works great for me...

Thank you all for all your help... :U

mineiro

Made this one.
If you unsubclassing, you need uncomment some source.



dedndave