| View previous topic :: View next topic |
| Author |
Message |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Sun Dec 16, 2007 6:29 am Post subject: Making the window stay in top and some more |
|
|
Ok i have 2 questions:
1) Can anyone give me the code to make my program stay at the top?
and what is the code to not make it stay on top?
2) How can i add like a form which checks the program i made each and every time he uses it and tells him if he is using the correct version?
3) Ok now if i click a button it will copey the file from the folder and paste it to another!
Thnx and i am using vb6 for all
Last edited by raushan2007 on Sun Dec 16, 2007 6:56 am; edited 2 times in total |
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Sun Dec 16, 2007 6:32 am Post subject: |
|
|
| About 2: You need a server to check the highest version.
|
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Sun Dec 16, 2007 6:32 am Post subject: |
|
|
| HolyBlah wrote: | | About 2: You need a server to check the highest version. |
How can i do that?
Thnx
|
|
| Back to top |
|
 |
Aikos Cheater
Reputation: 0
Joined: 26 Nov 2007 Posts: 47
|
Posted: Sun Dec 16, 2007 6:37 am Post subject: |
|
|
| @Q1: What's your programming language?
|
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Sun Dec 16, 2007 6:38 am Post subject: |
|
|
| Aikos wrote: | | @Q1: What's your programming language? |
Vb6
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Sun Dec 16, 2007 6:41 am Post subject: |
|
|
1. I have a way to do it in VB6
Firstly add this to your form
| Code: | Private Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (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 SetTopmostWindow(ByVal hWnd As Long, Optional topmost As Boolean = True)
Const HWND_NOTOPMOST = -2
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
SetWindowPos hWnd, IIf(topmost, HWND_TOPMOST, HWND_NOTOPMOST), 0, 0, 0, 0, _
SWP_NOMOVE + SWP_NOSIZE
End Sub |
Now in your form loading event, add this:
| Code: | | SetTopmostWindow Me.hWnd |
_________________
|
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Sun Dec 16, 2007 6:46 am Post subject: |
|
|
| Blader wrote: | 1. I have a way to do it in VB6
Firstly add this to your form
| Code: | Private Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (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 SetTopmostWindow(ByVal hWnd As Long, Optional topmost As Boolean = True)
Const HWND_NOTOPMOST = -2
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
SetWindowPos hWnd, IIf(topmost, HWND_TOPMOST, HWND_NOTOPMOST), 0, 0, 0, 0, _
SWP_NOMOVE + SWP_NOSIZE
End Sub |
Now in your form loading event, add this:
| Code: | | SetTopmostWindow Me.hWnd |
|
Thnx and what is the code to not make it stay on top?
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Sun Dec 16, 2007 6:53 am Post subject: |
|
|
| Code: | | SetTopmostWindow Me.hWnd, False |
Try that
_________________
|
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Sun Dec 16, 2007 6:54 am Post subject: |
|
|
| Blader wrote: | | Code: | | SetTopmostWindow Me.hWnd, False |
Try that |
Thnx and a new question for u blader.
Read question number3 pls
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Sun Dec 16, 2007 7:03 am Post subject: |
|
|
For question 3, do you mean copy a file from folder1 to folder2 in the .exe path?
_________________
|
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Sun Dec 16, 2007 7:04 am Post subject: |
|
|
| Blader wrote: | | For question 3, do you mean copy a file from folder1 to folder2 in the .exe path? |
yes
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Sun Dec 16, 2007 7:09 am Post subject: |
|
|
Try this:
| Code: | Dim fso As New FileSystemObject
fso.CopyFile "C:\Files\file.txt", "C:\Files\file_copy.txt" |
And go to project > references
Scroll down to microsoft scripting runtime and add that
You can also use this:
| Code: | Dim fso As New FileSystemObject
fso.CopyFile App.Path & "\something.txt", App.Path & "\copy\" |
_________________
Last edited by Blader on Sun Dec 16, 2007 7:14 am; edited 1 time in total |
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Sun Dec 16, 2007 7:14 am Post subject: |
|
|
| Blader wrote: | Try this:
| Code: | Dim fso As New FileSystemObject
fso.CopyFile "C:\Files\file.txt", "C:\Files\file_copy.txt" |
And go to project > references
Scroll down to microsoft scripting runtime and add that |
It tells me Script not found! and i am trying to copy an exe file
Last edited by raushan2007 on Sun Dec 16, 2007 7:15 am; edited 1 time in total |
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Sun Dec 16, 2007 7:15 am Post subject: |
|
|
Did you add microsoft scripting runtime?
Wait, are you using vb6 full version?
_________________
|
|
| Back to top |
|
 |
raushan2007 Expert Cheater
Reputation: 0
Joined: 06 Nov 2007 Posts: 130
|
Posted: Sun Dec 16, 2007 7:17 am Post subject: |
|
|
| Blader wrote: | Did you add microsoft scripting runtime?
Wait, are you using vb6 full version? |
Yes i am using full version and i did add the microsoft thing
|
|
| Back to top |
|
 |
|