English
Source / code snippets

Reading/Change Header TabControl Text/Icon

 

Jörg
Sellmeyer

'this code reads whom Headertext one Tabcontrols from.
'of Jörg Sellmeyer to disengaged Disposal for all
 $H commctrl.ph
Struct TC_ITEMHEADER = Mask&,lpReseved1&,lpReseved2&,pszText&,cchTextMax&,iImage&
Declare TC_Item#
Dim TC_Item#, TC_ITEMHEADER

Proc GetTabText

    Parameters hTab&,hwnd&,i&
    Declare Text#,Text$
    Dim Text#,12

    With TC_Item#

        .cchTextMax& = 24
        .Mask& = $0001
        .pszText& = Text#

    EndWith

    SendMessage(hTab&,$01305,i&,TC_Item#)
    Text$ = String $(Text#,0)
    Dispose Text#
    Return Text$

ENDPROC

Proc SetTabText

    Parameters hdl&,Id%,txt$

    With TC_Item#

        .Cchtextmax& = Len(txt$)
        .Mask& = $0001
        .Psztext& = Addr(txt$)

    Endwith

    SendMessage(Tab&,~TCM_SETITEM,Id%,TC_Item#)

ENDPROC

Proc SetTabIcon

    Parameters hTab&,index%,IconIndex%
    Declare TC_Item#
    Dim TC_Item#,TC_ITEMHEADER

    With TC_Item#

        .Mask& = ~TCIF_IMAGE
        .iImage& = IconIndex%

    EndWith

    SendMessage(hTab&,~TCM_SETITEM,index%,TC_Item#)

ENDPROC

Declare Tab&
Cls
var hToolBmp& = create("HPIC", 0, "TOOLBAR")
var hIL& = Create("ImageList", 16, 16, hToolBmp&, rgb(192, 192, 192))
Tab&=Create("Tabctrl",%hWnd,"Test 5",130,30,460,300)
SendMessage(Tab&, ~TCM_SETIMAGELIST, 0, hIL&)

WhileLoop 4,1,-1

    InsertTab(Tab&,0,"Test " + Str $(&Loop))

Wend

WhileLoop 0,4

    print "Text = " + GetTabText(Tab&,%hwnd,&Loop)

Wend

Randomize

While 1

    WaitInput
    Case %umessage = 16:Break

    If %mousePressed = 0

        SetTabText(Tab&,GetActiveTab(Tab&),Str $(&GetTickCount))
        SetTabIcon(Tab&,GetActiveTab(Tab&),Rnd(GetCount(hIL&)))

    EndIf

Wend

Dispose TC_Item#
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
10/01/06  
 




Jac
de
Lad
Wozu should the well his? I mean whom Header can one user Yes not change...
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
10/01/06  
 




Jörg
Sellmeyer
Jacob Liebeck
Wozu should the well his? I mean whom Header can one user Yes not change...


so can dynamic Tabs create and according to cover unterschiedlicheAktionen perform.
Also kannstDu now the user gestatten, The Texts To Change (by Input$() z. B.)
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
10/01/06  
 




Jac
de
Lad
Well, is already clear, becomes still but seeeehr seldom appear, or crazy I?
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
10/02/06  
 




Jörg
Sellmeyer
Umso rather, if one then white as goes ;)
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
10/02/06  
 




Jac
de
Lad
Yes, clear...
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
10/03/06  
 




ByteAttack
OK! then schieß time go: How change I the Please a Text one already existing TabControl-Reiters???
 
Website:  [...] 
Facebook:  [...] 
10/24/07  
 




Frank
Abbing
with the Message TCM_SETITEM.
 
10/24/07  
 




Jörg
Sellmeyer
If always so simply would, but MS machts often unbelievable tricky, b.z.w. are we of Profan so verwöhnt.
I habs time supra into code eingefügt.
Greeting
Jörg
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
10/24/07  
 




ByteAttack
Thank you. have me The half-way night whom head zermattert over The MSN-Library and the commctrl.ph.
but now have You it Yes reingestellt, and so ne Kleinigkeit mach too me happy! Thank you.
 
Website:  [...] 
Facebook:  [...] 
10/24/07  
 




Jörg
Sellmeyer
code supra repariert and circa function To change the Icons complement.
 
XProfan X4
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/23/18  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

17.215 Views

Untitledvor 0 min.
Axel Berse11/08/23
Sven Bader03/13/23
Normann Strübli02/03/23
RudiB.09/15/22
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie