Author Topic: Displaying Text in XP Taskbar  (Read 7081 times)

raleep

  • Regular Member
  • *
  • Posts: 36
Displaying Text in XP Taskbar
« on: October 07, 2012, 01:39:35 AM »
I want to display text in the XP taskbar after the executable name, for example, "lll c:\RDF", "lllSTABLE g:\...\fin", etc.

Can anyone help me get started researching how to do this?  I have not had much luck on msdn or in the SDK.

Thanks.

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: Displaying Text in XP Taskbar
« Reply #1 on: October 07, 2012, 03:30:25 AM »

Don't see really what you want to do.The taskar show the window title of the program being excuted.To modify this text,modify the title of the executable.
Fa is a musical note to play with CL

dedndave

  • Member
  • *****
  • Posts: 8825
  • Still using Abacus 2.0
    • DednDave
Re: Displaying Text in XP Taskbar
« Reply #2 on: October 07, 2012, 04:32:18 AM »
just set the window caption text (SetWindowText) - that is what gets displayed in the taskbar

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: Displaying Text in XP Taskbar
« Reply #3 on: October 07, 2012, 05:36:52 AM »

in the program ,no problem  invoke sendmessage,hwnd,WM_SETTEXT,,
By an outside prog you need to hook the program to know it's class.
and then EnumWindows GetClassName
Perhaps is there better way.
Fa is a musical note to play with CL

jj2007

  • Member
  • *****
  • Posts: 9912
  • Assembler is fun ;-)
    • MasmBasic
Re: Displaying Text in XP Taskbar
« Reply #4 on: October 07, 2012, 05:52:35 AM »
By an outside prog you need to hook the program to know it's class.
and then EnumWindows GetClassName
Perhaps is there better way.

Is there better way:

include \masm32\MasmBasic\MasmBasic.inc   ; download
   Init
   .If WinByTitle("Post reply -")
      SetWin$ eax="Salut Yves"
   .endif
   Exit
end start

No hook needed.

qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: Displaying Text in XP Taskbar
« Reply #5 on: October 07, 2012, 06:14:39 AM »
Is there better way:
as dave said, the best way is: SetWindowText()  :bgrin:
MREAL macros - when you need floating point arithmetic while assembling!

raleep

  • Regular Member
  • *
  • Posts: 36
Re: Displaying Text in XP Taskbar
« Reply #6 on: October 07, 2012, 06:58:42 AM »
just set the window caption text (SetWindowText) - that is what gets displayed in the taskbar

That works!

Thank you.

(I am happy to have the text in the title bar also.)

jj2007

  • Member
  • *****
  • Posts: 9912
  • Assembler is fun ;-)
    • MasmBasic
Re: Displaying Text in XP Taskbar
« Reply #7 on: October 07, 2012, 07:07:38 AM »
Is there better way:
as dave said, the best way is: SetWindowText()  :bgrin:

That works, sure, but in any case you never need a hook to perform that simple task ;-)

include \masm32\MasmBasic\MasmBasic.inc   ; download
  Init
  .If WinByTitle("Untitled")   ; needs a new file in qEditor
   .if rv(GetDlgItem, eax, 1F4H)
      xchg eax, ecx
      SetWin$ ecx=FileRead$("\masm32\include\Windows.inc")   ; Try that with SetWindowText ;-)
   .endif
  .endif
  Exit
end start

qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: Displaying Text in XP Taskbar
« Reply #8 on: October 07, 2012, 08:03:11 AM »
SetWin$ ecx=FileRead$("\masm32\include\Windows.inc")   ; Try that with SetWindowText ;-)
Your wish is my command:
Code: [Select]
include \masm32\include\masm32rt.inc
.data?
    hInstance   HINSTANCE ?
.code
DlgProc proc uses edi ebx edi hDlg:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM

    .if uMsg == WM_CLOSE
        invoke EndDialog,hDlg,0
    .elseif uMsg == WM_INITDIALOG
        mov edi,rv(GetDlgItem,hDlg,100)
        invoke GlobalFree,ASM(mov rv(SetWindowText,edi,ASM(mov ebx,InputFile("\masm32\include\Windows.inc"))),ebx) ; ;-D
    .else
        xor eax,eax
        ret
    .endif
    mov eax,1
    ret
   
DlgProc endp

main proc
    mov hInstance,rv(GetModuleHandle,0)
    Dialog "SetWindowText","Arial",10,WS_SYSMENU OR DS_CENTER,1,0,0,220,220,1024
    DlgEdit WS_BORDER or ES_MULTILINE,0,0,200,200,100
    CallModalDialog hInstance,0,DlgProc,0
    invoke ExitProcess,0
main endp
end main
8)
MREAL macros - when you need floating point arithmetic while assembling!

jj2007

  • Member
  • *****
  • Posts: 9912
  • Assembler is fun ;-)
    • MasmBasic
Re: Displaying Text in XP Taskbar
« Reply #9 on: October 07, 2012, 05:23:18 PM »
Not bad, young friend, really not bad :t

Note, however, that my proggie (in response to ToutEnMasm's claim that you need all sorts of complicated stuff - hooks, class info etc) sets the text in the child window of another process - and that would indeed fail miserably with SetWindowText, as you certainly know ;-)
 :icon14:

P.S.: I attach the MasmBasic equivalent to your dialog example. Here is the source code:

include \masm32\MasmBasic\MasmBasic.inc        ; download
  Init
  DlgDefine "Resources", 0, 0, 500, 200
  DlgControl dcEdit, Cat$(FileRead$("DlgTest.rc")), ES_MULTILINE, 1, 1, 100.0, 100.0   ; DlgTest.rc must be a Unicode text file
  DlgShow
  Exit
end start

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: Displaying Text in XP Taskbar
« Reply #10 on: October 07, 2012, 06:27:33 PM »
Quote
in response to ToutEnMasm's claim that you need all sorts of complicated stuff - hooks, class info etc
Don't write only lies.I was  just asking what was the exact need.
just read the title of a window to get his handle is not the only way to do and couldn't be apply to all case.
There is a number of functions in the sdk who are abble to solve any case.
Fa is a musical note to play with CL

jj2007

  • Member
  • *****
  • Posts: 9912
  • Assembler is fun ;-)
    • MasmBasic
Re: Displaying Text in XP Taskbar
« Reply #11 on: October 07, 2012, 06:49:25 PM »
Don't write only lies.I was  just asking what was the exact need.

See your reply #3.

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: Displaying Text in XP Taskbar
« Reply #12 on: October 07, 2012, 07:23:28 PM »

This is of better use than your library:
http://vbsedit.en.softonic.com/
Fa is a musical note to play with CL

jj2007

  • Member
  • *****
  • Posts: 9912
  • Assembler is fun ;-)
    • MasmBasic
Re: Displaying Text in XP Taskbar
« Reply #13 on: October 07, 2012, 08:26:51 PM »
Looks nice, Yves. Is that what you are using nowadays? Unfortunately it doesn't assemble with JWasm :(

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: Displaying Text in XP Taskbar
« Reply #14 on: October 08, 2012, 03:42:39 AM »

Quote
Unfortunately it doesn't assemble with JWasm
Try masmbasic,he surely assemble it  :lol:
Fa is a musical note to play with CL