|
-
Jul 27th, 2006, 04:05 PM
#1
Thread Starter
New Member
API call to lock toolbars?
Is there an API Declaration that I can call via VBA to lock the position of the toolbars?
-
Jul 27th, 2006, 07:09 PM
#2
Re: API call to lock toolbars?
Most likely not, the Office toolbars are a custom control and there is no standard "lock position" message that I am aware of.
You could try your luck in the Office Development forum. Make sure you post what version of Office you're using.
Welcome to the forums.
-
Jul 28th, 2006, 01:36 AM
#3
Thread Starter
New Member
Re: API call to lock toolbars?
Sorry i didnt mention the specific application. Im working in VBA for Autocad, and I wish to lock those toolbars that i accidentally move while I work. I already posted in AutoCAD's forum but they suggested to download some 3rd party application to lock these toolbars. But I want to lock it without loading 3rd party apps. If there's a thing like that, I thought that maybe there's an API call that I can use. just guessing.
I'll try posting in Office Development. I hope VBA for other applications posts are also welcome in that thread. Thanks.
-
Jul 28th, 2006, 01:38 AM
#4
Re: API call to lock toolbars?
Ah, well that might be different, I'm not sure how AutoCAD's toolbars work, they are most likely different to Office's.
-
Jul 28th, 2006, 01:50 AM
#5
Re: API call to lock toolbars?
You may want to try something like this but modify for AutoCads VBA but they should be compaitble.
VB Code:
Dim oCB As Office.CommandBar
Set oCB = Application.CommandBars.Item("Standard")
oCB.Protection = msoBarNoChangeDock Or msoBarNoMove Or msoBarNoCustomize
You will need to change it to reflect the toolbar name you want to lock.
VBA is licensed from MS and should include the Office reference or similar.
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Jul 28th, 2006, 03:31 AM
#6
Thread Starter
New Member
Re: API call to lock toolbars?
Yes, in fact the VBA interface are the same.
I loaded the MS Office 11 type library to have access for that Command Bar object and tried to set it to AutoCAD applications toolbar (coz AutoCAD doesn't have command bars) but I've got the 'type mismatch' error. Maybe because in MS Office its a Command Bar (custom control-as posted) and not a standard toolbar.
Last edited by brain_catcher; Jul 28th, 2006 at 03:45 AM.
Reason: spelling
-
Jul 28th, 2006, 03:42 AM
#7
Re: API call to lock toolbars?
Hmm, then try using MS Spy++ and see what the toolbars window class name is. Once you have that you can declare your objects as that type and should get you farther.
Yes, to be licensed to integrate VBA IDE into an application you need to pay some decent $'s and you may have commandbars for the VBA IDE but will be different for AutoCads GUI.
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Jul 28th, 2006, 03:55 AM
#8
Thread Starter
New Member
Re: API call to lock toolbars?
I use EliteSpy and these are the results.
Window Handle: 2163946
Window Caption:
Window Class: ToolbarWindow32
Window Style: WS_CHILD WS_CLIPSIBLINGS WS_VISIBLE
Rectangle: (374, 73) - (853, 102)
Parent Handle: 2229562
Parent Caption: AutoCAD Tools
Parent Class: AfxWnd70
Test made on one of the toolbars. In fact I can enable, disable, show and hide, by EliteSpy. But to lock, there is none.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|