Couple questions regarding to Addin

Couple questions regarding to Addin

Anonymous
Not applicable
511 Views
9 Replies
Message 1 of 10

Couple questions regarding to Addin

Anonymous
Not applicable
I just played a bit with some sample AddIns in SDK and feel more
comfortable to create one now. Just couple questions hope someone here can
help me
1) How to set the form on top, same level with IV, when you run an addin.
I tried ScanDrawingViews add in and each time I click on IV window, it's on
top of the ScanDrawingViews window
2) I still have trouble to get the icons shown in the panel tool bar
Thx, Chris

--
IV11 Pro. sp1 (uninstall)
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 84.26
SpacePilot V 1.1.2
0 Likes
512 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
This might help.

http://www.devx.com/vb2themax/Tip/19200
0 Likes
Message 3 of 10

Rene-J
Collaborator
Collaborator
Hi Chris
call your form
1) Formname.Show vbModal

2) You have maybe all ready load your icon.
check in the tools-customize-commands -addin
the icon will only be load the first time.
Your run the Addin.

Regards
René J
0 Likes
Message 4 of 10

Anonymous
Not applicable
Thanks, Peter. I don't want "always ontop all windows" - but ontop of IV
window only
Chris
wrote in message news:5269382@discussion.autodesk.com...
This might help.

http://www.devx.com/vb2themax/Tip/19200
0 Likes
Message 5 of 10

Anonymous
Not applicable
And another question:
VB6 only allows you to open one project at a time. what's the trick to copy
and paste code between projects
Thx, Chris

"Chris (IV11 Pro. SP1 (uninstall)" wrote in message
news:5269345@discussion.autodesk.com...
I just played a bit with some sample AddIns in SDK and feel more
comfortable to create one now. Just couple questions hope someone here can
help me
1) How to set the form on top, same level with IV, when you run an addin.
I tried ScanDrawingViews add in and each time I click on IV window, it's on
top of the ScanDrawingViews window
2) I still have trouble to get the icons shown in the panel tool bar
Thx, Chris

--
IV11 Pro. sp1 (uninstall)
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 84.26
SpacePilot V 1.1.2
0 Likes
Message 6 of 10

Anonymous
Not applicable
Two sessions of VB6 ....
0 Likes
Message 7 of 10

Anonymous
Not applicable
Try this:

Add the following to a module in your add-in:

Public Const GWL_HWNDPARENT = (-8)

Public Declare Function SetWindowLong Lib "user32" Alias
"SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal wNewLong As Long)
As Long

Add the following variable declaration as a form level variable in your
form:

'form level variable declaration
Private originalParenthWnd As Long

Add the following to the form_Load event for your form:

'set form to always be on top of Inventor window, but minmize along
with Inventor
'note that ivApp is a reference to the Inventor.Application object
(must be assigned prior to calling this function)
originalParenthWnd = SetWindowLong(Me.hwnd, GWL_HWNDPARENT,
ivApp.MainFrameHWND)

Add the following to the form_Unload event for your form:

'restore the original parent window before unloading
Call SetWindowLong(Me.hwnd, GWL_HWNDPARENT, originalParenthWnd)

Neil


"Chris (IV11 Pro. SP1 (uninstall)" wrote in message
news:5269384@discussion.autodesk.com...
Thanks, Peter. I don't want "always ontop all windows" - but ontop of IV
window only
Chris
wrote in message news:5269382@discussion.autodesk.com...
This might help.

http://www.devx.com/vb2themax/Tip/19200
0 Likes
Message 8 of 10

Anonymous
Not applicable
I got this error mesg at the line (see the att.) : Me.hwnd

originalParenthWnd = SetWindowLong(Me.hwnd, GWL_HWNDPARENT,
ivApp.MainFrameHWND)

Thx, Chris



"Neil Munro" wrote in message
news:5269451@discussion.autodesk.com...
Try this:

Add the following to a module in your add-in:

Public Const GWL_HWNDPARENT = (-8)

Public Declare Function SetWindowLong Lib "user32" Alias
"SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal wNewLong As Long)
As Long

Add the following variable declaration as a form level variable in your
form:

'form level variable declaration
Private originalParenthWnd As Long

Add the following to the form_Load event for your form:

'set form to always be on top of Inventor window, but minmize along
with Inventor
'note that ivApp is a reference to the Inventor.Application object
(must be assigned prior to calling this function)
originalParenthWnd = SetWindowLong(Me.hwnd, GWL_HWNDPARENT,
ivApp.MainFrameHWND)

Add the following to the form_Unload event for your form:

'restore the original parent window before unloading
Call SetWindowLong(Me.hwnd, GWL_HWNDPARENT, originalParenthWnd)

Neil


"Chris (IV11 Pro. SP1 (uninstall)" wrote in message
news:5269384@discussion.autodesk.com...
Thanks, Peter. I don't want "always ontop all windows" - but ontop of IV
window only
Chris
wrote in message news:5269382@discussion.autodesk.com...
This might help.

http://www.devx.com/vb2themax/Tip/19200
0 Likes
Message 9 of 10

Anonymous
Not applicable
The attached code has some word wrap issues. The attached text file has the
correct formatting.

Neil


"Chris (IV11 Pro. SP1 (uninstall)" wrote in message
news:5272563@discussion.autodesk.com...
I got this error mesg at the line (see the att.) : Me.hwnd
0 Likes
Message 10 of 10

Anonymous
Not applicable
Thanks, Neil. I finally had a chane to try it and it works nicely
Chris
"Neil Munro" wrote in message
news:5272769@discussion.autodesk.com...
The attached code has some word wrap issues. The attached text file has the
correct formatting.

Neil


"Chris (IV11 Pro. SP1 (uninstall)" wrote in message
news:5272563@discussion.autodesk.com...
I got this error mesg at the line (see the att.) : Me.hwnd
0 Likes