` Printed Icetips Article

Icetips Article



Par2: Taskbar text
2005-03-30 -- David Bratovich
 
> I have a program that consists of one window with no caption. I am able to
> place an icon in the taskbar, but no text.
> 
> system{PROP:icon} = ~my.ico          !works
> system{PROP:text} = 'my window'    !doesn't display
> 
> Is there any way to display text in taskbar when there is no caption on the
> window?


Create your WINDOW with no caption/no frame...

In your map add...

MODULE('WindowsAPI')
SetWindowTextA(UNSIGNED,LONG),BOOL,PASCAL,RAW
END

Add the following variable...

WindowText CSTRING(100)


Add this in an embed as soon as the window is OPENed...

WindowText = 'My Program is Here'
trash# = SetWindowTextA(Window{PROP:Handle},ADDRESS(WindowText))


You will have a task bar button with the name of your program on it, and
nothing on your window.

-------

A neat little twist is to use it as a progress bar. Inside a process loop
changed the WindowText to reflect the pecentage completed.

!After calculating the progress_ value
WindowText =  'Batch Process:  ' & progress_  '%'
trash# = SetWindowTextA(Window{PROP:Handle},ADDRESS(WindowText))



Printed December 3, 2024, 11:39 am
This article has been viewed/printed 35230 times.