forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


ONTOP option from child window for the main window

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sat Aug 07, 2004 8:39 am    Post subject: ONTOP option from child window for the main window Reply with quote

Hi
I want to send ONTOP function from child window for the main window

One part of code MENU Properties only:
:PropertiesMENU
DIALOG CREATE,Properties,-1,0,298,167,NOSYS
DIALOG ADD,TEXT,TEXT1,8,112,,,Properties,,TRANSPARENT,STYLE1
DIALOG ADD,GROUP,GROUP1,44,0,300,80
DIALOG ADD,CHECK,CHECK1,50,22,198,18,Always on top,,,CLICK
DIALOG ADD,BUTTON,Save,134,152,64,24,Save
DIALOG ADD,BUTTON,Close,134,226,64,24,Close
DIALOG SHOW

Missing stuff:
Main window
Child window for PropertiesMENU that works

Problem:
If main window has timer or clock this must be on child window to.
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Aug 07, 2004 8:57 am    Post subject: Reply with quote

Hi Filip, and welcome at VDSWORLD... Smile Your question isn't really clear. Maybe you can try to explain it a bit better, so that we can help you to find a solution? Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Aug 07, 2004 9:05 am    Post subject: Reply with quote

hi filip and skit,

i think that filip wants to be able to set the main window of a program as being always ONTOP from a child window

i'm not sure that this can be done filip as usually setting a window to being always ONTOP requires the program to be run a second time with the ONTOP setting

i'm not sure if an api will help

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Aug 07, 2004 9:09 am    Post subject: Reply with quote

In that case, this might be an solution:

Code:
  DIALOG CREATE,New Dialog 1,-1,0,240,160
  DIALOG SHOW

  DIALOG CREATE,New Dialog 2,-1,0,240,160
  DIALOG SHOW

  # First, select the first dialog, which ID is zero
  dialog select,0
  # Now use the "dialog show" command to place it above all other windows
  dialog show
 
  wait event

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Aug 07, 2004 9:15 am    Post subject: Reply with quote

sounds good skit but it will only be on top as long as a user doesn't try to access another window as it won't be a real always ontop thingy Sad

perhaps your idea is what filip needs Smile

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sat Aug 07, 2004 9:34 am    Post subject: Child window OK BUT... Reply with quote

I want to create a program with options that are not on the same main window.

Examle:

WordPad.exe
View/Options...

Any idea...
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Aug 07, 2004 10:34 am    Post subject: Reply with quote

Hmm... The dialog showmodal command seems like what you need. Unfortunatly, I can't get it to work... Confused

Visual Dialogscript Helpfile wrote:
DIALOG SHOWMODAL This command is similar to DIALOG SHOW, except that the script freezes on this command until a button is pressed. When a button is pressed, the <button_name>BUTTON event is generated, but the dialog behaves as if it has been closed. The script can use @event() to test which button was pressed, and if it was not a Cancel button get information from the dialog. Then it must use DIALOG CLOSE to close finally the dialog.


Code:
  DIALOG CREATE,New Dialog 1,-1,0,240,160
  DIALOG ADD,BUTTON,BUTTON1,98,125,,,BUTTON1
  DIALOG SHOW

  DIALOG CREATE,New Dialog 2,-1,0,240,160
  DIALOG SHOW

  dialog select,0
  dialog showmodal

  wait event

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Sat Aug 07, 2004 3:52 pm    Post subject: Reply with quote

Skit,
The reason it does not work is because you have to hide the main window first before showing it as modal. The main window is already showing so you would not be able to switch it's state. Just add a dialog hide like the code below.

Code:
  DIALOG CREATE,New Dialog 1,-1,0,240,160
  DIALOG ADD,BUTTON,BUTTON1,98,125,,,BUTTON1
  DIALOG SHOW

  DIALOG CREATE,New Dialog 2,-1,0,240,160
  DIALOG SHOW

  dialog select,0
  dialog hide
  dialog showmodal

  wait event


BTW the shortcut to download the script does not work. It only downloads remarks and not the script.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Sat Aug 07, 2004 6:02 pm    Post subject: Reply with quote

filip,
I am not sure exactly what you wanted to do but try this one. You will need a copy of my Gadget dll to use this. My Gadget VDS Extention is still being rebuilt but I am very close to releasing it. If you send me a PM I can tell you where you can download a demo of the DLL. I would have made it in VDS 5 since it is only 2 or 3 functions that would need to be called but I noticed that you prob. don't have VDS 5 since this thread is under the VDS 4 source code section.

Code:

Rem Load Gadget.dll
External gadget.dll
Rem If this is running under VDS 5 define Gadget's command/functions
If @Greater(@Name(@Sysinfo(DSVER)),4)
  #DEFINE COMMAND,GADGET
  #DEFINE FUNCTION,GADGET
End

Rem Load the user32.dll
Gadget Define,Constant,user32,@Gadget(LoadDLL,user32.dll)

Rem define some constants these are variables that gadget can reconize directly
Gadget Define,Constant,SWP_NOSIZE,$1
Gadget Define,Constant,SWP_NOMOVE,$2
Gadget Define,Constant,SWP_NOZORDER,$4
Gadget Define,Constant,SWP_NOREDRAW,$8
Gadget Define,Constant,SWP_NOACTIVATE,$10
Gadget Define,Constant,SWP_FRAMECHANGED,$20
Gadget Define,Constant,SWP_SHOWWINDOW,$40
Gadget Define,Constant,SWP_HIDEWINDOW,$80
Gadget Define,Constant,SWP_NOCOPYBITS,$100
Gadget Define,Constant,SWP_NOOWNERZORDER,$200
Gadget Define,Constant,SWP_DRAWFRAME,SWP_FRAMECHANGED
Gadget Define,Constant,SWP_NOREPOSITION,SWP_NOOWNERZORDER
Gadget Define,Constant,HWND_TOP,0
Gadget Define,Constant,HWND_BOTTOM,1
Gadget Define,Constant,HWND_TOPMOST,-1
Gadget Define,Constant,HWND_NOTOPMOST,-2

Rem define the functions we need
Gadget Define,Function,SetWindowPos,user32,SetWindowPos,hwnd As HANDLE;hWndInsertAfter As HANDLE;x As DWORD;y As DWORD;cx As DWORD;cy As DWORD;wFlags As DWORD,DWORD
Gadget Define,Function,BringWindowToTop,user32,BringWindowToTop,hwnd As HANDLE,DWORD
Gadget Define,Function,SetForegroundWindow,user32,SetForegroundWindow,hwnd As HANDLE,DWORD



  DIALOG CREATE,New Dialog 1,150,0,240,160
  DIALOG SHOW

  DIALOG CREATE,New Dialog 2,100,0,240,160
  DIALOG ADD,BUTTON,BUTTON1,98,125,,,BUTTON1
  DIALOG SHOW
 
  Rem Set the the Main dialog on top
  %A = @Gadget(SetForegroundWindow,@winexists(New Dialog 1))
  %A = @Gadget(BringWindowToTop,@winexists(New Dialog 1))
  %A = @Gadget(SetWindowPos,@winexists(New Dialog 1),HWND_TOPMOST,0,0,0,0,@Gadget(Or,SWP_NOSIZE,SWP_NOMOVE,SWP_SHOWWINDOW))
  %%Ontop = 1
:evloop
  wait event
  Parse "%%Event;%%Dialog",@event(D)
  If %%Event
    Goto %%Event
  End
goto evloop

:BUTTON1BUTTON
  If @Equal(%%Ontop,1)
    Info Ok I will remove top most for the main window now
    %A = @Gadget(SetWindowPos,@winexists(New Dialog 1),HWND_NOTOPMOST,0,0,0,0,@Gadget(Or,SWP_NOSIZE,SWP_NOMOVE,SWP_SHOWWINDOW))
    %%Ontop = 0
  Else
    Info Ok I will make the main window top most now
    %A = @Gadget(SetForegroundWindow,@winexists(New Dialog 1))
    %A = @Gadget(BringWindowToTop,@winexists(New Dialog 1))
    %A = @Gadget(SetWindowPos,@winexists(New Dialog 1),HWND_TOPMOST,0,0,0,0,@Gadget(Or,SWP_NOSIZE,SWP_NOMOVE,SWP_SHOWWINDOW))
    %%Ontop = 1
  End
goto evloop
:close
  Gadget FreeDLL,user32
stop



Anyway this allows you to set any window to top most anytime you would like Wink

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Aug 08, 2004 3:12 am    Post subject: Reply with quote

Please post questions in the help forums. Smile The source code forums are
intended for posting code that you have built.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Mon Aug 09, 2004 12:27 am    Post subject: Reply with quote

Mmmmmmmmmmmmmmmmmmmmmm


Pizzaaaaaaaaa

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Mon Aug 09, 2004 5:46 am    Post subject: Where can i find gadget.dll ??? Reply with quote

Where can i find gadget.dll ???
Back to top
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Mon Aug 09, 2004 3:43 pm    Post subject: Reply with quote

I agree with Garrett...

(I had to read filip's first post several times, not because it was unclear,
but because that tasty looking pizza is so distracting....) Rolling Eyes

Gotta go get some pizza..... Wink

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group