News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Displaying Text in XP Taskbar

Started by raleep, October 07, 2012, 01:39:35 AM

Previous topic - Next topic

raleep

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.

TouEnMasm


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

just set the window caption text (SetWindowText) - that is what gets displayed in the taskbar

TouEnMasm


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

Quote from: ToutEnMasm on October 07, 2012, 05:36:52 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

MREAL macros - when you need floating point arithmetic while assembling!

raleep

Quote from: dedndave on October 07, 2012, 04:32:18 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

Quote from: qWord on October 07, 2012, 06:14:39 AM
Quote from: jj2007 on October 07, 2012, 05:52:35 AMIs 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

Quote from: jj2007 on October 07, 2012, 07:07:38 AMSetWin$ ecx=FileRead$("\masm32\include\Windows.inc")   ; Try that with SetWindowText ;-)
Your wish is my command:
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

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

TouEnMasm

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

Quote from: ToutEnMasm on October 07, 2012, 06:27:33 PM
Don't write only lies.I was  just asking what was the exact need.

See your reply #3.

TouEnMasm

Fa is a musical note to play with CL

jj2007

Looks nice, Yves. Is that what you are using nowadays? Unfortunately it doesn't assemble with JWasm :(

TouEnMasm


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