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 


Window Not on top

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Jul 02, 2003 2:45 am    Post subject: Window Not on top Reply with quote

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 Mad

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Wed Jul 02, 2003 5:06 am    Post subject: Reply with quote

Here's an old topic about this:

http://forum.vdsworld.com/viewtopic.php?t=76
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Jul 02, 2003 1:08 pm    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Jul 02, 2003 1:13 pm    Post subject: Reply with quote

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
Arrow 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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Jul 02, 2003 1:26 pm    Post subject: Reply with quote

Thanks a lot for sharing that code! Wink
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Thu Jul 03, 2003 2:37 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Jul 04, 2003 11:02 am    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Fri Jul 04, 2003 3:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sat Jul 05, 2003 5:27 am    Post subject: Reply with quote

Oh VDS variables as constants. i thought this could be so but.. my ignorance Embarassed
Thanx for that Very Happy

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
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