File dialog pops up in corner and not centre with LV 6.0 
Author Message
 File dialog pops up in corner and not centre with LV 6.0

In LV 5.0 the file dialog box pops up in the centre of the window.  In
LV 6.0 the file dialog box pops up in the top left hand corner of the
window.  How annoying!!!

NB.  The file dialog box is a function and not a sub vi that i can
change windows settings for.

I like the format of this windows file search box so i dont want to
have to program my own or use the multiple file selector vi described
on this site.  I have tried window moving vi's, but you first see the
box appear in the wrong place.

I would also like to change the title of the file dialog box...  Yes,
i want the moon on a stick!

Please, if you can help, please do..

Kim



Mon, 11 Oct 2004 17:43:08 GMT  
 File dialog pops up in corner and not centre with LV 6.0
Poping up in the left hand corner is a new style in windows. I found
that MS IE 5.5 does it the same way, some other applications get it in
the centre.

From MSDN I get that the chance of moving the dialog around the screen
before it is displayed, is to set a hook function for the windows
INIT_DIALOG message for that common dialog. This function has a
special interface which you cannot create with a VI. So you must
accept this behaviour.

Changing the title of a window can be done with the "Rename Window" VI
from the Winutil LLB. In this special case you need th code runing
parallel, either by a subVI started with RunVI or a while loop. In
this code you have to poll until the window will appear and then
change the title. The one thing you must know is the old title. Maybe
you can see a flicker in the titlebar.

Another method is to write a DLL with a function you can call from
labview as a wrapper around the WIN API function GetOpenFileName. This
is neccessary since this function needs a pointer to a structure which
itself contains pointer to c-style strings and string tables. But this
will solve all your problems.



Mon, 11 Oct 2004 19:57:19 GMT  
 File dialog pops up in corner and not centre with LV 6.0
Thanks for trying to help.  Unfortunately i have no idea what MSDN is,
or INIT_DIALOG, let alone setting a hook function.  Sorry about that.
And as for writing a DLL, i wouldn't know where to start.  I have
tried the Rename Window vi, but as with the Move Window vi, you do get
a pause before the new settings take effect.  I guess i will have to
live with this if there are no other manageable options for
me...appart from converting back to LV 5.0 that is!  But surely NI
wouldn't want to see that happen???


Mon, 11 Oct 2004 21:50:18 GMT  
 File dialog pops up in corner and not centre with LV 6.0
I see you are not familiar with the internals of windows so I will
give you same short explanation:

MSDN is the MicroSoft Developer Network. This contains information
about Windows, development tools, examples and so on. MSDN is partly
available online and in full only on CD/DVD which they want money for.
It is somehow like the NI Developer Zone.

Windows uses a lot of messages which are sent to the windows. A window
is created in Windows before it is displayed on the monitor. One of
the messages a window gets before it is displayed is INIT_DIALOG. As a
result of the message a part of the code related to the window is
executed. At this time you can change a lot of properties of the
window like position and size. The file open dialog is a dialog which
is not created by the programmer of the application. This dialog comes
from Windows directly. So a programmer would not have the chance to
change the properties during this message processing. So Microsoft
made a mechanism which allows programmers to execute their own code.
This is called a hook function.

I don't know which LV version you have but 5.1.1 has the "right"
behavior. And it is really stable and good. So if you don't need the
new controls or new properties this one would be a better choise than
5.0.



Mon, 11 Oct 2004 22:53:41 GMT  
 File dialog pops up in corner and not centre with LV 6.0
I only have version 5.0 and 6.0 unfortunately.

I know it's a bit cheeky, but do you fancy writing a hook function for
me??  Please?  *smiles*?



Mon, 11 Oct 2004 23:05:40 GMT  
 File dialog pops up in corner and not centre with LV 6.0
Hi,

Easiest way to work around it, is to make a second modal vi, that controls
its own position (e.g. relative to it's caller, or to the center of the
screen). Make the panel bounds 1 with, 1 height, and make it's inputs and
outputs the same as the file dialog function. Put the file dialog function
in the new vi, and connect it's inputs and outputs.

When the vi is called, it invisible for the user, and the file dialog pups
up above it. This way you can place the popup anywhere you want.

Regards,

Wiebe.


Quote:
> In LV 5.0 the file dialog box pops up in the centre of the window.  In
> LV 6.0 the file dialog box pops up in the top left hand corner of the
> window.  How annoying!!!

> NB.  The file dialog box is a function and not a sub vi that i can
> change windows settings for.

> I like the format of this windows file search box so i dont want to
> have to program my own or use the multiple file selector vi described
> on this site.  I have tried window moving vi's, but you first see the
> box appear in the wrong place.

> I would also like to change the title of the file dialog box...  Yes,
> i want the moon on a stick!

> Please, if you can help, please do..

> Kim



Tue, 12 Oct 2004 20:13:10 GMT  
 File dialog pops up in corner and not centre with LV 6.0
Thanks for the tip!  I've tried it and it does work.  There is still a
small line above the file dialog from the 2nd modal window but i can
live with that.


Wed, 13 Oct 2004 00:49:21 GMT  
 File dialog pops up in corner and not centre with LV 6.0
Your welkom. Have you set the property 'has title bar' off? Maybe this will
remove the small line. In my experiments there was no such line.

Regards,

Wiebe.


Quote:
> Thanks for the tip!  I've tried it and it does work.  There is still a
> small line above the file dialog from the 2nd modal window but i can
> live with that.



Fri, 29 Oct 2004 16:42:11 GMT  
 File dialog pops up in corner and not centre with LV 6.0
The dialog pops up in the left corner of the top level vi. This window does
not have to be a dialog (it has to be when the vi calling the dummy is a
dialog). If it is a dialog, you'll see the border of the vi.

Regards,

Wiebe.


Quote:
> Your welkom. Have you set the property 'has title bar' off? Maybe this
will
> remove the small line. In my experiments there was no such line.

> Regards,

> Wiebe.



> > Thanks for the tip!  I've tried it and it does work.  There is still a
> > small line above the file dialog from the 2nd modal window but i can
> > live with that.



Fri, 29 Oct 2004 18:36:22 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. File dialog pops up in corner and not centre with LV 6.0

2. LV 6.0 runtime engine not found with labview 6.1

3. LV 6i / File Dialog Positioning

4. combobox pops up in left top screen corner

5. Mouse over pop-ups with VisualWorks

6. Pop-ups in VW 2

7. Error or notification pop-ups in Tk

8. Pop-ups on Canvas items

9. Examples for Pop-Ups, Keyboard Accelerators?

10. annoying pop ups

11. backdoor.trojan - popups that aren't pop-ups

 

 
Powered by phpBB® Forum Software