News:

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

Edit Control/Tooltip problems with Manifest File

Started by dedndave, April 24, 2011, 03:30:44 AM

Previous topic - Next topic

dedndave

as a result of this thread, i have been working on a little demo program
it has 2 edit controls with tooltips that pop up if caps lock is on
it works fairly well, until i add a manifest file
i have exhausted all i know about manifest files and resource files, which isn't all that much   :lol
i have added message boxes to the program to report certain related errors
i have tried a variety of manifest files and resource lines
i have also tried using PoLink instead of Link
i am using XP MCE2005, SP3 with all the updates except .NET 4.0

when the manifest file is added, there are 2 apparent symptoms:
1) no tooltips at all
2) the cursor seems to be located incorrectly when the focus shifts to the second edit control
it appears as it should in the first one



any help would be greatly appreciated

dedndave

i might add that there are no reported events in the Computer Management Event Viewer applet
and that my WinSxS folder has the following common control folders...
x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a
x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83
x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5705_x-ww_36cfed49

mineiro

Well, I cannot help much Sr Dedndave, but I have figured that when you move the mouse under the edit box, the tooltip appears.

dedndave

 :bg
what version of windows are you using ?
it seems that it adds the desired balloon tooltip because of the EM_SETPASSWORDCHAR message
or, it could be the TTF_UNDOCFLAG, which i found online   :P
i meant to comment that out
IFNDEF TTF_UNDOCFLAG
TTF_UNDOCFLAG   EQU 40h
ENDIF

TTF_IDISHWND or TTF_SUBCLASS or TTF_UNDOCFLAG      ;TOOLINFO.uFlags

mineiro

Hello Sr Dedndave, I spend some time to see why that tooltip appears to me, and I have commented some lines in your code to it disapear.
in source code
;        INVOKE  SendMessage,eax,EM_SETPASSWORDCHAR,'*',edi
In resource I removed the ES_PASSWORD.
;CONTROL "",IDC_EDT2,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|ES_PASSWORD,48,72,102,15,WS_EX_CLIENTEDGE

I play with your code, and changed to this:
Added in .data?
pointer         POINT   <>

and changed your source only a bit.
...
dProc1:
      invoke GetCursorPos,addr pointer
      mov      ecx,pointer.x
      mov      edx,pointer.y
      invoke   SetCursorPos,Ecx,Edx
      mov     ecx,FocusHandle
        mov     edx,ecs1.hTool
        mov     eax,ecs2.hTool
        jecxz   dProc2
...
Now it works here, is not a good implementations, I know, but have worked.
Regards Sr.
Oh, I forgot to answer your question, here is XP SP3.

dedndave

thanks   :U

but, now i am even more confused - you are using XP SP3 - so am i   :red

dedndave

 :lol

i figured out where i was gping wrong - lol
i had disabled balloons when i built the hard drive   :bg
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"EnableBalloonTips"=dword:00000001

it was 0 - i set it to 1, and now it works
i can eliminate a whole bunch of code   :bg

however, i still have the problem with the cursor being shifted to the right in the password box
this does not happen with no manifest and it does happen with one

mineiro

If I remove the ES_PASSWORD style in resource it get aligned, but with ES_PASSWORD the cursor shift to the right.
And in that previous code posted, if the mouse cursor is outside of edit box, so it don't work.
Regards.

sinsi

The only difference I can see is that a manifest uses a different version of the common controls.
Version 6 defaults to a black circle, user32 uses an asterisk. Maybe it calculates things depending on the character size?
Light travels faster than sound, that's why some people seem bright until you hear them.

hutch--

Dave,

I would be inclined to subclass the control, save the data in memory and display whatever character you want for a password blockout. This means you would not be dependent on the internals of Windows for the display format.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

sinsi - i explicitly set it to asterisk   :P

earlier on, i added ES_PASSWORD to the resource file edit control definition (learning - trying things out)
i did not see that it did what i was after all along because of my registry setting
as i read through all the documentation, i added some other things
one was to set the hidden password character
which, by the way, if you send that message with a NULL, it shows the chars, but still acts like a password entry (tooltip)

as for the indentation, that occurs, even if i make the 2 edit controls identical (with or without password style)
this seems to be true whenever a manifest is used to enable XP visual styles
i'm going to call it a bug   :bg
possibly, i can make the other edit control indent the same way and say "that's how it's supposed to be" - lol

the fact is, i wrote a lot of unnecessary code because of the registry setting disabling balloon tooltips
that's ok - it has been a good leaning experience   :P
i wanted to get my feet wet with dialogs and tooltips
if it had worked when i added the ES_PASSWORD style, i wouldn't have learned much
i also learned a little more about manifest files
i found this article to be particularly educational...
http://blogs.msdn.com/b/junfeng/archive/2007/06/26/rt-manifest-resource-and-isolation-aware-enabled.aspx
i also learned to use the event viewer, among other things, when troubleshooting manifest related problems

dedndave

this code fixes the indentation issue   :U
        INVOKE  SendMessage,hEdit1,EM_GETMARGINS,0,0
        INVOKE  SendMessage,hEdit2,EM_SETMARGINS,EC_LEFTMARGIN or EC_RIGHTMARGIN,eax

i put it near the end of the WM_INITDIALOG stuff

hutch--

Dave,

With a simple tweak you can individually set either side margin in a rich edit control.


    mov ecx, 14
    mov edx, 4
    mov ax, dx
    rol eax, 16
    mov ax, cx
    invoke SendMessage,hEdit,EM_SETMARGINS,EC_LEFTMARGIN or EC_RIGHTMARGIN,eax
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jj2007

Quote from: dedndave on April 24, 2011, 11:24:04 PM
Dave's simple tweak fixes the indentation issue   :U

Just trying a synthesis :green

dedndave

well - these aren't rich edit controls
but, i have re-thought the above code
it would be better to see what the value is and set them both to that,
rather than depending on the first one to be correct   :P

this makes no sense to me, Hutch   :bg
   mov ecx, 14
   mov edx, 4
   mov ax, dx
   rol eax, 16
   mov ax, cx


why not just do this...
invoke SendMessage,hEdit,EM_SETMARGINS,EC_LEFTMARGIN or EC_RIGHTMARGIN,40014h

:bg