1 Attachment(s)
[RESOLVED] Hello can someone please help me with my problem
Dear VB-Formers,
I wish to get the addin to be on how step of everything except the mouse cursor and then to have focus when the IDE master window has focus with it. And then to size up to the right amount of pixels to the window it's running into with, so.
!! Thanks in advance !!
Re: Hello can someone please help me with my problem
I really don't understand what you're asking, but an API call to EbMode from within an Add-In can tell you whether the IDE is in design-mode, run-mode, or break-mode.
Re: Hello can someone please help me with my problem
I think I should take a break from these forums immediately. Read somewhere that when forums start looking like a mental institution to you it’s probably you that’s going crazy.
Re: Hello can someone please help me with my problem
I am asking for help to have a Form, to then be Me.TopMost for something like that one, so
Re: Hello can someone please help me with my problem
In this particular case I'm pretty sure Google Translate would do a superior job!
This will be always on top:
Re: Hello can someone please help me with my problem
gee thanks, dude. but then vbModal, makes the other Forms, etc .Enabled = False, or then such things like that
Re: Hello can someone please help me with my problem
Well then what do you want? If you have multiple forms and none of them are modal then whichever one gets the focus, it will be on top!
Re: Hello can someone please help me with my problem
but then when the Form, looses focus it gets sent behind the VB-IDE. which is what i don't want to do, here. But then it looks like i need to call the TopMost API. Can you please help me to code it, then I will be able to then give the frmAddin the required WindowState, like when the VB-IDE is minimized, then the same goes for the frmAddin Form. If you are able to get to understand me, then it will be a bonus score, here???
Re: Hello can someone please help me with my problem
I don't have any experience with Addins so I don't know how the IDE handles their windows. You could try to write code in the "LostFocus" event but if the form loses focus and you try to bring it back then it will gain focus again and this will go into a loop of losing focus and getting it back...
Re: Hello can someone please help me with my problem
Ahh I see:
Code:
Public Sub Form_LostFocus()
If EBMode = DesignTime Then
With frmAddin
.SetFocus
.ZOrder 0
End With
ElseIf EBMode <> DesignTime Then
With frmAddin
ZOrder 1
End With
End If
End Sub
1 Attachment(s)
Re: Hello can someone please help me with my problem
Someone please help me with the MakeTopMost API, in which I am using here, then so. Then please tell me where i am going wrong with the API. I wish to make the frmAddin.Form() to have a SetFocus and TopMost on all Apps, in the view mode of my Addin. Also then i want it to loose focus, and NotMakeTopMost, when the VB-IDE is minimised or even then so closed, for any reasons know to the programming source code, i have been able to write here so.
Re: Hello can someone please help me with my problem
This is what i was looking for; you have to call the API in Form_Load and then not on a Timer, like i was looking for, then so
Code:
Public VBInstance As VBIDE.VBE
Public Connect As Connect
'
Private Declare Function SetWindowPos Lib "USER32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE
'
Option Explicit
Public Sub MakeTopMost(hWnd As Long)
On Error Resume Next
SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub
Public Sub Form_Load()
On Error Resume Next
SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub