| View previous topic :: View next topic |
| Author |
Message |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Fri Jan 24, 2003 9:15 am Post subject: Bind programm into vds window |
|
|
Hi,
is there a way to bind a programm into a vds window ?
I saw this in multimedia builder before - binding a programm
into another window.
Thanks.
Fabian |
|
| Back to top |
|
 |
MarkTrubo Contributor


Joined: 27 May 2001 Posts: 148 Location: Long Island, NY
|
Posted: Fri Jan 24, 2003 12:52 pm Post subject: |
|
|
| Someplace I have a VisualBasic program called Kidnap that does something like that -- if you want, I'll dig it up -- I think I have the source code -- at least it might give you some ideas. |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Fri Jan 24, 2003 3:26 pm Post subject: Bind programm into vds window |
|
|
Hi,
this would be great.
Thank you,
Fabian |
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Fri Jan 24, 2003 5:30 pm Post subject: |
|
|
Also its possible to do that probably with Gadget.dll (Never tried tho). Mindpower told me it would be possible. Me too I use MMB and I will someday try to do the same with VDS. Its really a nice feature and sometimes a practical one.
Ciao |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1566
|
Posted: Fri Jan 24, 2003 6:49 pm Post subject: |
|
|
I'm not sure if Gadget supports this but I'm thinking it should/does. Try using the Windows API command:
SetParent(hWndChild, hWndNewParent)
You should then set the top,left position of the Child Window using the VDS command WINDOW POSITION.
You must use the Window handles with the SetParent API, you can determine Window handles of the two windows by using the VDS function @winexists.
Here is the full description of the SetParent function from the Win32 Programmer's Reference:
| Quote: |
The SetParent function changes the parent window of the specified child window.
HWND SetParent(
HWND hWndChild, // handle of window whose parent is changing
HWND hWndNewParent // handle of new parent window
);
Parameters
hWndChild
Identifies the child window.
hWndNewParent
Identifies the new parent window. If this parameter is NULL, the desktop window becomes the new parent window.
Return Values
If the function succeeds, the return value is the handle of the previous parent window.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
Remarks
An application can use the SetParent function to set the parent window of a pop-up, overlapped, or child window. The new parent window and the child window must belong to the same application.
If the window identified by the hWndChild parameter is visible, Windows performs the appropriate redrawing and repainting.
See Also
GetParent
|
|
|
| Back to top |
|
 |
MarkTrubo Contributor


Joined: 27 May 2001 Posts: 148 Location: Long Island, NY
|
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 767 Location: Eastman, GA
|
Posted: Sat Jan 25, 2003 2:00 am Post subject: |
|
|
vdswnd.dll does exactly this. Comes with one of the vdsdll.dll packages.
NodNarb |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Sat Jan 25, 2003 1:11 pm Post subject: Bind programm into vds window |
|
|
Hi cnodnarb,
I tried it with vdswnd (i bought vdsdll3 package last year), but
maybe I am to stupid.
I have 2 windows with classes #PI and #PIusers
now I tried:
WND PARENT,#PIusers,#PI
but nothing happens.
What is wrong ?
Bye, Fabian |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Sat Jan 25, 2003 1:13 pm Post subject: Bind programm into vds window |
|
|
ups - my problem.
now i got it.
Thank you all for your help.
Bye, Fabian |
|
| Back to top |
|
 |
Tsunami1988 Contributor


Joined: 15 Aug 2002 Posts: 70 Location: The Netherlands
|
Posted: Sat Jan 25, 2003 1:15 pm Post subject: Re: Bind programm into vds window |
|
|
| X-Tools wrote: | Hi cnodnarb,
I tried it with vdswnd (i bought vdsdll3 package last year), but
maybe I am to stupid.
I have 2 windows with classes #PI and #PIusers
now I tried:
WND PARENT,#PIusers,#PI
but nothing happens.
What is wrong ?
Bye, Fabian |
| Quote: | | DLL WND, PARENT, <window identifier>, <new parent window identifier> |
Don't know if they mean all identifiers (title, class and identifier), or just the identifier... |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Sat Jan 25, 2003 2:38 pm Post subject: Bind programm into vds window |
|
|
I have it running.
Do you know why the child windows covers the statusbar of the mainwindow ? I saw other programs where childwindows are only beetween titlebar (or menu) and statusbar.
Bye, Fabian |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Jan 26, 2003 12:03 am Post subject: |
|
|
You should be able to use WINDOW POSITION (or possibly
DIALOG SETPOS) and set the location and size of the child
to whatever ya want...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Sun Jan 26, 2003 10:58 am Post subject: Bind programm into vds window |
|
|
Hi Mac,
yes - I know.
But if the child window gets maximized, it covers the statusbar of its parent. Is there a way to prevent this ?
Bye, Fabian |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Jan 26, 2003 11:21 am Post subject: |
|
|
You could use a TIMER event, and either check the position
(and reposition if necessary), or just set the position without
checking.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Jan 27, 2003 1:45 pm Post subject: |
|
|
Hi X-Tools,
I think the problem is you are trying to set a window that does not have the WS_CHILD window style. I have experimented with this and I have found that when you set a VDS window as a child to another window then you have to do all kinds of stuff to handle little problems with this idea. Here take a look at an experimental MDI application I have been working on. It is only experimental and no it does not work exactly right but it is getting closer Yeah it uses my Gadget.dll to do this...
| Code: | REM ****************************************************
External gadget.dll,demo
%%USER32 = @Gadget(demo,LoadLib,user32.dll)
rem Window field offsets for GetWindowLong() and GetWindowWord()
Gadget demo,Constant,GWL_WNDPROC,-4
Gadget demo,Constant,GWL_HINSTANCE,-6
Gadget demo,Constant,GWL_HWNDPARENT,-8
Gadget demo,Constant,GWL_STYLE,-16
Gadget demo,Constant,GWL_EXSTYLE,-20
Gadget demo,Constant,GWL_USERDATA,-21
Gadget demo,Constant,GWL_ID,-12
rem Window Styles
Gadget demo,Constant,WS_OVERLAPPED,@Sum(0,$0)
Gadget demo,Constant,WS_POPUP,@Sum(0,$80000000)
Gadget demo,Constant,WS_CHILD,@Sum(0,$40000000)
Gadget demo,Constant,WS_MINIMIZE,@Sum(0,$20000000)
Gadget demo,Constant,WS_VISIBLE,@Sum(0,$10000000)
Gadget demo,Constant,WS_DISABLED,@Sum(0,$8000000)
Gadget demo,Constant,WS_CLIPSIBLINGS,@Sum(0,$4000000)
Gadget demo,Constant,WS_CLIPCHILDREN,@Sum(0,$2000000)
Gadget demo,Constant,WS_MAXIMIZE,@Sum(0,$1000000)
Gadget demo,Constant,WS_CAPTION,@Sum(0,$C00000)
rem WS_BORDER Or WS_DLGFRAME
Gadget demo,Constant,WS_BORDER,@Sum(0,$800000)
Gadget demo,Constant,WS_DLGFRAME,@Sum(0,$400000)
Gadget demo,Constant,WS_VSCROLL,@Sum(0,$200000)
Gadget demo,Constant,WS_HSCROLL,@Sum(0,$100000)
Gadget demo,Constant,WS_SYSMENU,@Sum(0,$80000)
Gadget demo,Constant,WS_THICKFRAME,@Sum(0,$40000)
Gadget demo,Constant,WS_GROUP,@Sum(0,$20000)
Gadget demo,Constant,WS_TABSTOP,@Sum(0,$10000)
Gadget demo,Constant,WS_MINIMIZEBOX,@Sum(0,$20000)
Gadget demo,Constant,WS_MAXIMIZEBOX,@Sum(0,$10000)
Gadget demo,Constant,WS_TILED,@Gadget(demo,WS_OVERLAPPED)
Gadget demo,Constant,WS_ICONIC,@Gadget(demo,WS_MINIMIZE)
Gadget demo,Constant,WS_SIZEBOX,@Gadget(demo,WS_THICKFRAME)
Gadget demo,Constant,WS_OVERLAPPEDWINDOW,@Gadget(demo,Or,@Gadget(demo,WS_OVERLAPPED),@Gadget(demo,WS_CAPTION),@Gadget(demo,WS_SYSMENU),@Gadget(demo,WS_THICKFRAME),@Gadget(demo,WS_MINIMIZEBOX),@Gadget(demo,WS_MAXIMIZEBOX))
Gadget demo,Constant,WS_TILEDWINDOW,@Gadget(demo,WS_OVERLAPPEDWINDOW)
rem
rem Common Window Styles
rem /
Gadget demo,Constant,WS_POPUPWINDOW,@Gadget(demo,Or,@Gadget(demo,WS_POPUP),@Gadget(demo,WS_BORDER),@Gadget(demo,WS_SYSMENU))
Gadget demo,Constant,WS_CHILDWINDOW,@Gadget(demo,WS_CHILD)
rem Extended Window Styles
Gadget demo,Constant,WS_EX_DLGMODALFRAME,@Sum(0,$1)
Gadget demo,Constant,WS_EX_NOPARENTNOTIFY,@Sum(0,$4)
Gadget demo,Constant,WS_EX_TOPMOST,@Sum(0,$8)
Gadget demo,Constant,WS_EX_ACCEPTFILES,@Sum(0,$10)
Gadget demo,Constant,WS_EX_TRANSPARENT,@Sum(0,$20)
Gadget demo,Constant,WS_EX_MDICHILD,64
rem Static Control Constants
Gadget demo,Constant,SS_LEFT,@Sum(0,$0)
Gadget demo,Constant,SS_CENTER,@Sum(0,$1)
Gadget demo,Constant,SS_RIGHT,@Sum(0,$2)
Gadget demo,Constant,SS_ICON,@Sum(0,$3)
Gadget demo,Constant,SS_BLACKRECT,@Sum(0,$4)
Gadget demo,Constant,SS_GRAYRECT,@Sum(0,$5)
Gadget demo,Constant,SS_WHITERECT,@Sum(0,$6)
Gadget demo,Constant,SS_BLACKFRAME,@Sum(0,$7)
Gadget demo,Constant,SS_GRAYFRAME,@Sum(0,$8)
Gadget demo,Constant,SS_WHITEFRAME,@Sum(0,$9)
Gadget demo,Constant,SS_USERITEM,@Sum(0,$A)
Gadget demo,Constant,SS_SIMPLE,@Sum(0,$B)
Gadget demo,Constant,SS_LEFTNOWORDWRAP,@Sum(0,$C)
Gadget demo,Constant,SS_OWNERDRAW,@Sum(0,$0D)
Gadget demo,Constant,SS_ENHMETAFILE,@Sum(0,$0F)
Gadget demo,Constant,SS_ETCHEDHORZ,@Sum(0,$0010)
Gadget demo,Constant,SS_ETCHEDVERT,@Sum(0,$0011)
Gadget demo,Constant,SS_ETCHEDFRAME,@Sum(0,$0012)
Gadget demo,Constant,SS_TYPEMASK,@Sum(0,$001F)
Gadget demo,Constant,SS_NOPREFIX,@Sum(0,$0080)
Gadget demo,Constant,SS_NOTIFY,@Sum(0,$0100)
Gadget demo,Constant,SS_CENTERIMAGE,@Sum(0,$0200)
Gadget demo,Constant,SS_RIGHTJUST,@Sum(0,$0400)
Gadget demo,Constant,SS_REALSIZEIMAGE,@Sum(0,$0800)
Gadget demo,Constant,SS_SUNKEN,@Sum(0,$1000)
rem Static Control Mesages
Gadget demo,Constant,STM_SETICON,@Sum(0,$170)
Gadget demo,Constant,STM_GETICON,@Sum(0,$171)
Gadget demo,Constant,STM_MSGMAX,@Sum(0,$172)
Rem Some constants for Window messages to hook
Gadget demo,Constant,WM_COMMAND,273
Gadget demo,Constant,WM_SYSCOMMAND,274
Gadget demo,Constant,WM_NOTIFY,78
Gadget demo,Constant,WM_PAINT,15
Gadget demo,Constant,WM_SIZE,5
Gadget demo,Constant,WM_SIZING,532
Gadget demo,Constant,WM_WINDOWPOSCHANGED,71
Gadget demo,Constant,WM_MOVE,3
Gadget demo,Constant,WM_QUIT,18
Gadget demo,Constant,WM_CLOSE,16
Gadget demo,Constant,WM_ERASEBKGND,20
Gadget demo,Constant,WM_CHAR,258
Gadget demo,Constant,WM_LBUTTONDOWN,513
Gadget demo,Constant,WM_LBUTTONUP,514
REM Initialize HOOK for control messages
%%HOOK = 0
REM Initialize WINPROC for window messages
%%WNDPROC = 0
rem Gadget demo,Structure,msg,hwndfrom As Handle;id As DWORD;WPARAM As DWORD;LPARAM As DWORD
rem POINT structure
Gadget demo,Structure,pt,X As Integer;Y As Integer
rem MSG structure
Gadget demo,Structure,msg,hwnd As Handle;message As DWORD;wParam As Long;lParam As Long;time As DWORD;pt As BYTE {@Gadget(demo,SizeOf,pt)}
Gadget demo,Declare,SetParent,%%USER32,SetParent,hWndChild As Handle;hWndNewParent As Handle,Long
Gadget demo,Declare,GetWindowLong,%%USER32,GetWindowLong,hWnd As Handle;nIndex As Integer,Long
Gadget demo,Declare,SetWindowLong,%%USER32,SetWindowLong,hWnd As Handle;nIndex As Integer;lNewLong As Long,Long
Gadget demo,Declare,CreateWindowExA,%%user32,CreateWindow,dwExStyle As DWORD;ClassName As String;WinName As String;dwStyle As DWORD;x As Integer;y As Integer;nWidth As Integer;nHeight As Integer;hWndParent As Handle;hMenu As Long;hInstance As Handle;lpParam As Long,Handle
Gadget demo,Declare,DestroyWindow,%%user32,DestroyWindow,hwnd As Handle,Integer
rem Gadget demo,Declare,HideCaret,%%USER32,HideCaret,hWnd As Handle,Integer
title Child Dialog Test
DIALOG CREATE,Main Dialog,-1,0,627,378,RESIZABLE,PAINT
DIALOG ADD,MENU,&File,&New,&Open,&Quit
DIALOG ADD,STATUS,SB,Choose New to open a new MDI child
DIALOG SHOW
%%Main_hwnd = @winexists(Main Dialog)
%%hInst = "%"@Gadget(demo,GetWindowLong,%%Main_hwnd,@Gadget(demo,GWL_HINSTANCE))
%%Client_hwnd = @Gadget(demo,CreateWindow,512,"static",NULL,@Gadget(demo,Or,@Gadget(demo,WS_CHILD),@Gadget(demo,WS_CLIPCHILDREN),@Gadget(demo,SS_WHITERECT)),0,0,@dlgpos(,W),@Diff(@dlgpos(,H),@dlgpos(SB,H)),%%Main_hwnd,0,%%hInst,0)
WINDOW NORMAL,%%Client_hwnd
:Child_Dialog
%%cnt = 1
DIALOG CREATE,Child Dialog %%cnt,0,0,219,160,RESIZABLE,PAINT
REM *** Modified by Dialog Designer on 08/17/2002 - 16:42 ***
%%Child_hwnd = @winexists(Child Dialog %%cnt)
%%dwStyle = @Gadget(demo,GetWindowLong,%%Child_hwnd,@Gadget(demo,GWL_STYLE))
%%NewStyle = @Gadget(demo,Or,%%dwStyle,@Gadget(demo,WS_CHILD))
%%NewStyle = @Gadget(demo,And,%%NewStyle,@Gadget(demo,Not,@Gadget(demo,WS_POPUP)))
%%OldStyle = @Gadget(demo,SetWindowLong,%%Child_hwnd,@Gadget(demo,GWL_STYLE),%%NewStyle)
%%Ret = @Gadget(demo,SetParent,%%Child_hwnd,%%Client_hwnd)
rem %%dwExStyle = @Gadget(demo,GetWindowLong,%%Child_hwnd,@Gadget(demo,GWL_EXSTYLE))
rem %%NewExStyle = @Gadget(demo,Or,%%dwStyle,@Gadget(demo,WS_EX_MDICHILD))
rem %%OldExStyle = @Gadget(demo,SetWindowLong,%%Child_hwnd,@Gadget(demo,GWL_EXSTYLE),%%NewExStyle)
DIALOG ADD,EDIT,CEDIT1,0,0,218,156,,MULTI,WRAP,SCROLL
DIALOG SHOW
:MESSAGES
Rem Ok Gadget demo,has another trick it can also trap messages comming from the
rem Main Window Procedure...
Gadget demo,setmsg
Rem Now tell Gadget demo,to set the hook... Gadget demo,will generate an event
rem called MSG everytime it see's the message WM_CHAR stated above
rem for the EDIT element....
Rem Ok lets tell Gadget demo,what messages to watch for....
rem Gadget demo,setmsg,watchwndmsg,@Gadget(demo,WM_COMMAND)
REM Gadget demo,setmsg,watchwndmsg,@Gadget(demo,WM_CLOSE)
REM Gadget demo,setmsg,watchwndmsg,@Gadget(demo,WM_QUIT)
Rem Now tell Gadget demo,to set the hook... Gadget demo,will generate an event
rem called WNDPROC everytime it see's the messages WM_COMMAND and WM_SYSCOMMAND
rem as stated above for the Main Window Proceedure....
rem %%WNDPROC = @Gadget(demo,getmsg,wndproc,%%Client_hwnd,"WNDPROC")
rem Now set a trap for messages going to our Dialog
Gadget demo,SETMSG,TrapFor,%%Client_hwnd
rem Watch Mouse messages going to our Dialog
Gadget demo,SETMSG,WatchFor,%%Client_hwnd,@Gadget(demo,WM_COMMAND)
rem Set the event hook
%%hook = @Gadget(demo,GETMSG,eventhook,%%Client_hwnd,MSG)
dialog select,1
dialog focus,CEDIT1
rem dialog select,0
:Main_evloop
wait event,0.003
parse "%E;%D",@event(D)
if @zero(%D)
goto %E
else
If @Winclass(%%Child_hwnd)
dialog select,1
Else
dialog select,0
End
goto Child_%E
end
stop
:Child_TIMER
:TIMER
Goto Main_evloop
:MSG
Rem Hook mouse messages going to our dialog
List Assign,1,@Gadget(demo,Getmsg)
%%ctrlhwnd = @Item(1,0)
%%id = @Item(1,1)
%%WPARAM = @Item(1,2)
%%LPARAM = @Item(1,3)
%%lstcnt = @Count(1)
Rem Fill our msg structure with the info from gadget's Getmsg function
Gadget demo,msg.hwnd,@Item(1,0)
Gadget demo,msg.message,@Item(1,1)
Gadget demo,msg.wParam,@Item(1,2)
Gadget demo,msg.lParam,@Item(1,3)
Gadget demo,msg.time,@Item(1,4)
Info @Text(1)@CR()
List clear,1
Goto Main_evloop
:WNDPROC
Rem This Sub processes Messages recieved by our dialog.
List create,1
List clear,1
List Assign,1,@Gadget(demo,getmsg,forwndproc)
Gadget demo,msg.hwndfrom,"%"@Item(1,0)
Gadget demo,msg.id,@Item(1,1)
Gadget demo,msg.WPARAM,@Item(1,2)
Gadget demo,msg.LPARAM,@Item(1,3)
List close,1
%%HILPARAM = @Gadget(demo,HIWORD,@Gadget(demo,msg.LPARAM))
%%LOLPARAM = @Gadget(demo,LOWORD,@Gadget(demo,msg.LPARAM))
%%HIWPARAM = @Gadget(demo,HIWORD,@Gadget(demo,msg.WPARAM))
%%LOWPARAM = @Gadget(demo,LOWORD,@Gadget(demo,msg.WPARAM))
If @Equal(@Gadget(demo,msg.hwndfrom),%%Main_hwnd)
Rem If the message came from our window. We don't want to process
rem messages for everything.
If @Equal(@Gadget(demo,msg.id),@Gadget(demo,WM_COMMAND))
Rem If we recieved the WM_COMMAND API message ID
Info WPARAM = @Gadget(demo,msg.WPARAM)@cR()LPARAM = @Gadget(demo,msg.LPARAM)
End
Rem Give the user some feedback
rem Dialog set,TEXT1,Window To: @Gadget(demo,demo,msg.hwndfrom)@Tab()MessgeID: @Gadget(demo,demo,msg.id)@cr()WPARAM: @Gadget(demo,demo,msg.WPARAM)@Tab()LPARAM: @Gadget(demo,demo,msg.LPARAM)
Else
Rem Give the user some feedback
rem Dialog set,TEXT1,BUTTON1: @winexists(~BUTTON1)@cr()Window To: @Gadget(demo,demo,msg.hwndfrom)@cr()MessgeID: @Gadget(demo,demo,msg.id)@cr()WPARAM: @Gadget(demo,demo,msg.WPARAM)@CR()LPARAM: @Gadget(demo,demo,msg.LPARAM)
End
If @Equal(@Gadget(demo,msg.id),@Gadget(demo,WM_CLOSE))@Equal(@Gadget(demo,msg.id),@Gadget(demo,WM_QUIT))
Rem Ok if the user clicks the 'X' button in the upper right corner or if you do
rem anything that sends a WM_CLOSE or WM_QUIT
Goto CLOSE
End
End
goto Main_evloop
:NewMENU
%%cnt = @Succ(%%cnt)
DIALOG CREATE,Child Dialog %%cnt,0,0,219,160,RESIZABLE,PAINT
REM *** Modified by Dialog Designer on 08/17/2002 - 16:42 ***
DIALOG ADD,EDIT,CEDIT1,0,0,218,156,,MULTI,WRAP,SCROLL
%%New_Child_hwnd = @winexists(Child Dialog %%cnt)
%%dwStyle = @Gadget(demo,GetWindowLong,%%New_Child_hwnd,@Gadget(demo,GWL_STYLE))
%%NewStyle = @Gadget(demo,Or,%%dwStyle,@Gadget(demo,WS_CHILD))
%%OldStyle = @Gadget(demo,SetWindowLong,%%New_Child_hwnd,@Gadget(demo,GWL_STYLE),%%NewStyle)
%%Ret = @Gadget(demo,SetParent,%%New_Child_hwnd,%%Client_hwnd)
DIALOG SHOW
Goto Main_evloop
:OpenMENU
Goto Main_evloop
:QuitMENU
:CLOSE
Rem Remove our Message hooks
Gadget demo,setmsg
Gadget demo,setmsg,unhook,%%HOOK
Gadget demo,setmsg,unhookwndproc,%%WNDPROC
%%Client_hwnd = @Gadget(demo,DestroyWindow,%%Client_hwnd)
Gadget demo,FreeLib,%%USER32
exit
Stop
:RESIZE
:PAINT
DIALOG SELECT,0
WINDOW POSITION,%%Client_hwnd,0,0,@dlgpos(,W),@Diff(@dlgpos(,H),@dlgpos(SB,H))
rem %%Eu = @event()
goto Main_evloop
:Child_RESIZE
:Child_PAINT
DIALOG SETPOS,CEDIT1,0,0,@DLGPOS(,W),@DLGPOS(,H)
goto Main_evloop
REM With a non-modal child dialog any of the buttons and dialog
REM elements can generate events, including those on other dialogs,
REM and so you have to find out which dialog they came from by
REM using @event(D). For most applications, as here, while the
REM child dialog is showing you don't want to respond to events
REM from the main window so the usual response is to sound a warning
REM beep and activate the dialog the user is supposed to be using.
REM It is possible to write scripts in which events can legitimately
REM be received from any dialog that is showing (such as the VDS
REM Dialog Designer) but this is complicated stuff for advanced
REM programmers only.
REM The main advantage of using a non-modal DIALOG SHOW is that
REM it allows you to do other things while the child dialog is
REM active. Here, we validate that some data has been entered in
REM the edit box, and display a warning if there isn't any. We have
REM also added a Help button which could be used to call up online
REM help.
:Child_CLOSE
REM Even in the event of clicking the close button, you must still
REM explicitly close the child dialog. This is to give you a chance
REM to recover any data from it.
DIALOG CLOSE
REM Wait for the CLOSE event that this generates...
wait event
REM ...and throw it away (otherwise it will be executed by the main
REM event loop!)
%E = @event()
%%cnt = @Pred(%%cnt)
goto Main_evloop
|
Well I hope this gives you a little idea of what it takes to do what you want to do... Anyway have fun with it. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
|
|
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
|
|