| View previous topic :: View next topic |
| Author |
Message |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Wed Jul 02, 2003 2:45 am Post subject: Window Not on top |
|
|
Changing back the z order of a window set to ontop attribute. It is possible using gadget dll but Just wondering
Now that VDS 5 allows calling any dll. Is it possible to do window NOTOPMOST by vds alone ??
Using W32 API - Not sure as to how  _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Wed Jul 02, 2003 1:08 pm Post subject: |
|
|
I saw the discussin in the above thread(Great Idea for simple apps) but it will make lose
the data in the external dll drawn dialog.
I tried making a dialog NOTOPMOST in VDS as below but it doesnot work:
| Code: |
#define command,NOTONTOP
:NOTONTOP
LOADLIB USER32
%H = @strdel(@WINEXISTS(#TFORM),1,1)
if %H
%H = @lib(user32,SetWindowPos,bool:,%H,HWND_NOTOPMOST,0,400,600,300,SWP_NOSIZE)
FREELIB USER32
goto EVLOOPI
else
ERROR -1
end
FREELIB USER32
end
|
Corresponding code in VB is working:
| Code: |
Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As
Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags
As Long) As Long
Sub KeepOnTop(F As Form)
Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Dim Success As Integer
Success% = SetWindowPos(F.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE)
End Sub
|
Missing things I found in my VDS script were:
I have not declared the constants SWP_NOSIZE and HWND_NOTOPMOST
Another doubt in my mind is that %H variable may be giving wrong value(values by vds/vds
spy are different from that given by spy++). ? Does it need converting or something.
Lastly all the varibles are declared as long in VB. what ids the corresponding term in
VDS ?
I am thinking of calling the VB exe giving it my vds app handle and get the vds app set
to NONTOPMOST as the last resort. Any better Ideas?
Lots of questions eating my head.
CodeScript _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Wed Jul 02, 2003 1:13 pm Post subject: |
|
|
Sorry for that I just found it working in VDS:
| Code: |
#define command,NOTONTOP
:NOTONTOP
LOADLIB USER32
%H = @strdel(@WINEXISTS(#TFORM),1,1)
if %H
%H = @lib(user32,SetWindowPos,bool:,%H,-2, 0, 0, 0, 0, 3)
goto EVLOOPI
else
ERROR -1
end
FREELIB USER32
end
REM AND %H = @lib(user32,SetWindowPos,bool:,%H,-1,0, 0, 0, 0,3)
REM to make it ONTOP
REM AND you can resisize Ur window by changing the values of 0 ,0,0 ,0
REM to whatever U wish !!
|
Now the only question is how can i find these values -1 and -2 in case of some other function because it these numbers are not mentioned in W32 API file either. Did some modifications to prevent errors.
CodeScript _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Wed Jul 02, 2003 1:35 pm; edited 3 times in total |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jul 02, 2003 1:26 pm Post subject: |
|
|
Thanks a lot for sharing that code!  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Thu Jul 03, 2003 2:37 am Post subject: |
|
|
| CodeScript wrote: | | Now the only question is how can i find these values -1 and -2 in case of some other function because it these numbers are not mentioned in W32 API file either. Did some modifications to prevent errors. |
Usually you will have to search your header files. VB probably has header files defining
the constants. In Delphi I can find them in Windows.pas:
{$EXTERNALSYM HWND_TOPMOST}
HWND_TOPMOST = HWND(-1);
{$EXTERNALSYM HWND_NOTOPMOST}
HWND_NOTOPMOST = HWND(-2); |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Fri Jul 04, 2003 11:02 am Post subject: |
|
|
Thanx for the info. I dont have access to Delphi.
I found that the constants from be obtained from the VB API text Viewer.
The striking thing I find missing in VDS is ability to define constants and use them. This makes using even a little complex functions difficult and I fear even impossible. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Fri Jul 04, 2003 3:01 pm Post subject: |
|
|
| CodeScript wrote: | | The striking thing I find missing in VDS is ability to define constants and use them. This makes using even a little complex functions difficult and I fear even impossible. |
Of course you could use variables for this, like this:
%%HWND_TOPMOST = -1
%%HWND_NOTOPMOST = -2
and then in your @LIB call just use these variable names. |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Sat Jul 05, 2003 5:27 am Post subject: |
|
|
Oh VDS variables as constants. i thought this could be so but.. my ignorance
Thanx for that  _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
|