Results 1 to 5 of 5

Thread: Change Other Apps titlebar... how ?

  1. #1

    Thread Starter
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    Change Other Apps titlebar... how ?

    IS it possible to change another applications titlebar ? say for example when you open MSN messenger it opens with "MSN Messenger" as the titlebar, how can i change this with my Application ?
    I'm thinking get the window handle then use the SetWindowText API ?

    Any help and code will be appreciated, thanks
    Zeegnahtuer?

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Change Other Apps titlebar... how ?

    SetWindowText will work and so will SendMessage(lHwnd, WM_SETTEXT, ByVal "Test", 4) or something like that.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Change Other Apps titlebar... how ?

    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    4. Private Declare Function SendMessageString Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
    5. ByRef lParam As Any) As Long
    6. Private Const WM_SETTEXT As Long = &HC
    7.  
    8. Private Sub Command1_Click()
    9.     Dim lHwnd As Long
    10.     lHwnd = FindWindow("MSNMSBLClass", "MSN Messenger")
    11.     SendMessageString lHwnd, WM_SETTEXT, ByVal 12, ByVal "My Messneger"
    12. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    Re: Change Other Apps titlebar... how ?

    Ok, so how would i go aboput getting the handle on the Window to send the message too ?
    (i don;t have Spy+)
    Zeegnahtuer?

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Change Other Apps titlebar... how ?

    www.patorjk.com has a tool called API Spy


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width