Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tooltips do not show in Exe 2

Status
Not open for further replies.

Koen Piller

Programmer
Jun 30, 2005
841
0
0
NL
Hi,
My tooltips do not show in the exe unless I once click anywhere on my form, after that they show as usual. In development I dont experience this behavior.
Do we have a solution for this?
Regards,
Koen
 
You could check what runtimes the EXE really uses. If you put a vfp9r.dll next to the exe that should be loaded, but MS offers a tool to list the DLL files really loaded into a process here:
Then obviously a difference of the exact runtime version of IDE (vfp9.exe) and vfp9r.dll can make a difference.

Here's what I find:
Listdlls (execute form a cmd shell) lists a lot of DLLs, regarding vfp9r.dll:
C:\Program Files (x86)\Common Files\Microsoft Shared\VFP\vfp9r.dll

vfp9.exe version I use is 9.0.0.7423
vfp9r.dll version from that location is 9.0.0.7423, same.

I have no problem, but I only have tested one textbox tooltiptext.

Form.ShowTips is relevant, but without setting it .T. you also don't see tips within the IDE. The only bugs I know about this are about the grid and a feature of Memo Tooltips, that only works in the IDE by design. But that's not about tooltiptext of a grid column or control, that is about the display of a memo value in the form of a tooltip. It only has the same visual design, but it's not done by the tooltip mechanism and it's an IDE feature and IIRC only about browse, not even in all grids.

So can you tell more about the details?

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf,
details?
VFP.exe version 9.0.0.7423
vfpr.dll same
OS() Win10
Regards,
Koen
 
Olaf,
I am using the image, label, editbox controls. All are placed on a Pageframe.
Will tickering a small form in an exe.

I had built a test.exe, nicely not-showing the tooltips.
Since there is no need to also show s splash in this test.exe I commented that procedure out. To my surprise now the tooltips do show!
Seems I have to change the splashscreen procedure.
Code:
Declare Integer Sleep In WIN32API Integer
Public oSplash

oSplash = Newobject("frmSplash","Coronaclss.vcx")
oSplash.Show(1)

Inkey(1)
DoEvents
Sleep(1000)
=myInstance("Corona")
 
	With oSplash
        .Hide()
        .Release()
    ENDWITH
    ON SHUTDOWN quit
    Do Form testMain.SCX

Read Events


Procedure myInstance
    Parameters myApp
    Local iChannel
    =Ddesetoption("SAFETY",.F.)
    iChannel=Ddeinitiate(myApp,"ZOOM")
    =Ddesetservice(myApp,"DEFINE")
    =Ddesetservice(myApp,"EXECUTE")
    =Ddesettopic(myApp,"","DDEZOOM")
    Return
Endproc

Procedure ddezoom
    Parameter iChannel,saction,sitem,sdata,sformat,istatus
    Zoom Window Screen Norm
    Return
Endproc
Regards,
Koen
 
Koen,

Could this be as simple as the form not being the currently active window? I've noticed sometimes that, when an EXE is launched, its main form is not the active window, even though it is in front of all the other windows on the desktop. This seems to happen when there is a top-level form involved.

Your mention of a splash screen is consistent with that. When you launch the EXE, the splash screen becomes the active window. But if you then remove the splash screen programmatically, focus does not necessarily pass to the next form.

Might be worth experimenting a bit with this.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

That could very well be possible, but don't you think that the lines
Code:
With oSplash
        .Hide()
        .Release()
    ENDWITH
in my splashscreen should do it?
Otherwise what else do you propose to kill this little guy?

Regards,
Koen
 
Well, the first thing is to decide if my suggestion is feasible, or if I am talking rubbish (as usual). You can check that just by clicking on the form. If you can't see the tooltips before you click, but you can see them afterwards, then I am talking sense and we can find a solution. But if that's not the case, we needn't spend any more time on it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

That is exactly what is happening here.
When the mainform is opened in the exe and I hoover the mouse over any object. No tooltip.
When I click on any object of the form, the tooltip shows and it will show also on all the other objects.
So it seems you nailed it correctly: although the form is visible it does not have the focus or something like that.
Obviously I already tried, in the init of the form
Code:
Thisform.PF.Page1.imgReport.click()
That did not help :(

Regards,

Koen
 
Setfocus should give the focus.

But it's awkward, any form freshly started will get focus and have the control with taborder 1 focused (if that's able to have focus).

Is there only some Hide() and Show() taking place? You could try and Setfocus to the form itself, too.

The other thing I see in the documentation is that besides ShowTips of the form itself, _screeen.Showtips also must be set .T., does the splash turn that off, perhaps? I think it can't be the reason because then activating the form would not help as that does not change _SCREEN or any forms ShopwTips, it just focuses the main form.

Does it have to do with the DDEzoom? Does that run and does it put the focus on SCREEN after testmain runs?

Bye, Olaf.

Olaf Doschke Software Engineering
 
Koen,

You could try this:

Code:
DECLARE INTEGER SetForegroundWindow IN WIN32API INTEGER
SetForegroundWindow(thisform.HWnd)
CLEAR DLLS "SetForegroundWindow"

If you put this in the form's Init, I think that should solve the problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike Lewis!
This has bothered me for years. I knew it was a focus problem so I am very used to clicking on my apps after starting :) I assume I can just copy and paste this code into my form as is?

THANK YOU!
 
Hi mr. TheProgrammerGuy,
Yes, just put it in your init, and donot forget to put default() as first line of your init()
Regards,
Koen

P.S. @Mike,
May I suggest to make a FAQ of this little, but very convenient trick?
 
I'm pleased that this turned out to be useful.

Yes, just put it in your init, and donot forget to put default() as first line of your init()

Just for the sake of precision, it's DODEFAULT(), not DEFAULT().

May I suggest to make a FAQ of this little, but very convenient trick?

Good idea.

One other small point. Koen, you said that you had tried this:

Code:
Thisform.PF.Page1.imgReport.click()

When you call a Click event in this way, it doesn't actually perform the click. All it does is execute whatever code you have written in the Click event. In fact, that's generally true of all events. That's why it didn't have the same effect as manually clicking on the form.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,
you are correct, but I have code in this method. Actually it changes the UI language.
And of course DODEFAULT() --- Grrr no another one of those please.
Regards,
Koen
 
Well, it's simply as Mike says: Event behavior is separate from any code. Having code vs. no code in an event only sometimes effects whether event tracking logs an event or not, the exceptions are explained in that topic. And sometimes an event can be suppressed with NODEFAULT. Or with RETURN .F., but calling events never causes the base behavior, here to set focus, too.

Bye, Olaf.






Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top