Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Renaming Developer Studio Toolbars by VB Hooks

Renaming Developer Studio Toolbars by VB Hooks

Scheduled Pinned Locked Moved Visual Basic
debugginghelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Borrowing heavily from Nick Hodapp's original C code: LRESULT CALLBACK FindToolbarProc(int nCode, WPARAM wParam, LPARAM lParam) { // watch window creation: if (nCode == HCBT_CREATEWND) { CBT_CREATEWND* pcw = (CBT_CREATEWND*)lParam; // watch for toolbar creation, set toolbar name if (pcw->lpcs->lpszName && 0 != strstr(pcw->lpcs->lpszName, "Toolbar")) { strcpy((char*)pcw->lpcs->lpszName, "NukeNCB"); } } return CallNextHookEx(g_hkCBT, nCode, wParam, lParam); } I was hoping to translate this into a VB hook... this is what I have so far... Public Function FindToolbarProc(ByVal ncode As Integer, ByVal wParam As Long, ByVal lParam As Long) As Long Dim tCREATESTRUCT As CREATESTRUCT Dim tCBT_CREATEWND As CBT_CREATEWND Dim ptr As Long Dim sStr As String * 8 'If a keystroke is received. If ncode = HCBT_CREATEWND Then Debug.Print "1.in!>>>>>" 'ptr.lpcs = lParam 'CreateFromPointer (lParam) 'Call CopyMemoryCBT_CreateWnd(mCBT_CREATEWND, lParam, LenB(mCBT_CREATEWND)) 'SetWindowText wParam, "ASDF" Debug.Print "wParam=" & wParam Debug.Print "lParam=" & lParam ptr = VarPtr(tCBT_CREATEWND) Call MoveMemory(ByVal ptr, ByVal lParam, Len(tCBT_CREATEWND)) Debug.Print "CBT_CREATEWND.lpcs=" & tCBT_CREATEWND.lpcs Debug.Print "CBT_CREATEWND.hwnd=" & tCBT_CREATEWND.hWndInsertAfter Call MoveMemory(mCREATESTRUCT, ByVal tCBT_CREATEWND.lpcs, LenB(mCREATESTRUCT)) Debug.Print "mCREATESTRUCT=" & mCREATESTRUCT.lpszClass Debug.Print "mCREATESTRUCT=" & mCREATESTRUCT.lpszName Debug.Print "mCREATESTRUCT=" & mCREATESTRUCT.Style Call MoveMemory(sStr, mCREATESTRUCT.lpszName, 10) End If 'Pass the keystroke on to the primary program and pick up the next hook for processing. FindToolbarProc = CallNextHookEx(gLngWindowHook, ncode, wParam, lParam) End Function Only problem is that the MoveMemory (AKA RTLMOVEMEMORY) command seems to be returning erronous data. Any suggestions?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups