Author Topic: ToolTip Icon  (Read 15127 times)

CommonTater

  • Guest
Re: ToolTip Icon
« Reply #15 on: December 10, 2012, 08:14:44 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...
Code: [Select]
<?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

  • Guest
Re: ToolTip Icon
« Reply #16 on: December 10, 2012, 08:55:34 AM »
I don't know what this - manifest. only see it in WinSxS

May be subclass or enumchildwindows simply use to change icon?

hfheatherfox07

  • Member
  • ***
  • Posts: 464
Re: ToolTip Icon
« Reply #17 on: December 10, 2012, 09:56:05 AM »
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

  • Guest
Re: ToolTip Icon
« Reply #18 on: December 10, 2012, 10:10:36 AM »
May be it work, I try connect my phone what have any effect for program

jj2007

  • Member
  • *****
  • Posts: 10087
  • Assembler is fun ;-)
    • MasmBasic
Re: ToolTip Icon
« Reply #19 on: December 10, 2012, 11:02:04 AM »
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

  • Member
  • ***
  • Posts: 464
Re: ToolTip Icon
« Reply #20 on: December 10, 2012, 11:13:31 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.

bomz

  • Guest
Re: ToolTip Icon
« Reply #21 on: December 10, 2012, 04:05:07 PM »





Magnum

  • Member
  • *****
  • Posts: 2308
Lot of bugs ?? in P2Kautostart
« Reply #22 on: December 10, 2012, 04:26:21 PM »
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

  • Member
  • *****
  • Posts: 10087
  • Assembler is fun ;-)
    • MasmBasic
Re: Lot of bugs ?? in P2Kautostart
« Reply #23 on: December 10, 2012, 05:09:55 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

  • Member
  • *****
  • Posts: 2308
Re: ToolTip Icon
« Reply #24 on: December 10, 2012, 05:27:43 PM »
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

  • Member
  • *****
  • Posts: 8825
  • Still using Abacus 2.0
    • DednDave
Re: ToolTip Icon
« Reply #25 on: December 10, 2012, 09:59:08 PM »
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...
Code: [Select]
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
Code: [Select]
;#############################################################

#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
Code: [Select]
<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
Code: [Select]
        .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

  • Member
  • **
  • Posts: 58
Re: ToolTip Icon
« Reply #26 on: December 10, 2012, 10:50:19 PM »
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

  • Guest
Re: ToolTip Icon
« Reply #27 on: December 11, 2012, 04:25:33 AM »
dedndave
I try this. With manifest any tooltip appear. when I del manifest file - tooltip appear without TT_CLOSE and icon

dedndave

  • Member
  • *****
  • Posts: 8825
  • Still using Abacus 2.0
    • DednDave
Re: ToolTip Icon
« Reply #28 on: December 11, 2012, 04:28:36 AM »
let me play with it.....

bomz

  • Guest
Re: ToolTip Icon
« Reply #29 on: December 11, 2012, 04:33:29 AM »
see line 2155