News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

ToolTip Icon

Started by bomz, December 10, 2012, 04:50:41 AM

Previous topic - Next topic

CommonTater

Quote from: bomz on December 10, 2012, 06:03:50 AM
I read msdn. It's example not working. I find one forum where C programmers says about manifests(?) and SetWindowTheme

You need to set a manifest for common controls and for somethings you may have to change settings using UxTheme??? functions...

http://msdn.microsoft.com/en-us/library/windows/desktop/bb773187(v=vs.85).aspx

Here's an example manifest...

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity type="win32"
                    name="AutoLogon"
                    version="1.0.0.0"
                    processorArchitecture="*" />
  <description>
    Auto logon tool
  </description>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32"
                        name="Microsoft.Windows.Common-Controls"
                        version="6.0.0.0"
                        processorArchitecture="*"
                        publicKeyToken="6595b64144ccf1df"
                        language="*" />
    </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel  level="asInvoker"
                                  uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>


You would save this as an xml file and include it into your program's resources with RC.

bomz

I don't know what this - manifest. only see it in WinSxS

May be subclass or enumchildwindows simply use to change icon?

hfheatherfox07

Hey bomz
Did that example that I uploaded for you not work?
It does what you asked for ..... Uses custom icon and adds a close button to tool tip

Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

bomz

May be it work, I try connect my phone what have any effect for program

jj2007

Hi bomz,

You can specify the style TTS_CLOSE in CreateWindowEx to get the close box (but I have not managed to click on it - the damn tooltip disappears as soon as I move the mouse...).

And here is code to put an icon:
      push rv(LoadIcon, hInstance, IDI_APPLICATION)
      invoke SendMessage, hTT, TTM_SETTITLE, eax, chr$("Tooltips may have titles")
      call DestroyIcon

:icon14:

hfheatherfox07

Quote from: bomz on December 10, 2012, 10:10:36 AM
May be it work, I try connect my phone what have any effect for program

No need to do that,
I uploaded the whole software for you as soon as you turn it on you will see icon
every thing you need to load custom icon and close button on tool tip is there and simple to follow :t
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.


Magnum

That  P2kAutostart.zip was a mess to clean up.

It put files in about 15 directories.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

jj2007

Quote from: Magnum on December 10, 2012, 04:26:21 PM
That  P2kAutostart.zip was a mess to clean up.
It put files in about 15 directories.

And you still have to find in that mess the two lines that I posted above :lol:

Magnum

I am not sure if I used HfHeatherfox's version or Bomz.

I don't feel so bad about some of my programming "boofs."

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

dedndave

bomz,

i am sure that what you need is a manifest to ensure common controls v6 is present and loaded
there are 2 common ways to include a manifest file

you can put a manifest file in the same folder as the EXE...
MyProgram.exe
MyProgram.exe.manifest

that's ok for testing, perhaps, but if you distribute a program that way,
it assumes the manifest will be in the same folder as the exe   :P
(see below for what the manifest file looks like)

probably a better way - and more common, i think,
is to include the manifest file as a resource by referencing it in the program's RC file
when you do it this way, the XML text of the manifest is added to the EXE
(i assume you already know how to compile and link resource files with your project)

MyProgram.rc
;#############################################################

#include "\masm32\include\resource.h"

#ifndef  CREATEPROCESS_MANIFEST_RESOURCE_ID
#define  CREATEPROCESS_MANIFEST_RESOURCE_ID  1
#endif

#ifndef  RT_MANIFEST
#define  RT_MANIFEST                         24
#endif

;#############################################################

CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "MyProgram.xml"

;#############################################################


MyProgram.xml
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"/>
    </dependentAssembly>
  </dependency>
</assembly>


no matter which way you get the manifest file loaded...
in your program, you want to use InitCommonControlsEx
        .DATA
icc INITCOMMONCONTROLSEX <sizeof INITCOMMONCONTROLSEX,ICC_BAR_CLASSES>

        .CODE
Start:
        INVOKE  InitCommonControlsEx,offset icc
;
;rest of program...
;
        END     Start

notice that i used ICC_BAR_CLASSES
you may want to combine more flags or use ICC_WIN95_CLASSES, which combines several
ICC_BAR_CLASSES is used because you want to use a tooltip
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775507%28v=vs.85%29.aspx
the call to InitCommonControlsEx should be performed early in the program
i usually make it the first thing executed

farrier

A nice example of different tooltips for MASM, found on the fasm site:

http://board.flatassembler.net/topic.php?p=143198#143198

includes source.

farrier
For the code is dark, and full of errors!
It's a good day to code!
Don't Bogart that code, my friend!

bomz

dedndave
I try this. With manifest any tooltip appear. when I del manifest file - tooltip appear without TT_CLOSE and icon

dedndave

let me play with it.....

bomz