Skip to content

Commit 74d1a35

Browse files
committed
Initial commit
0 parents  commit 74d1a35

File tree

6 files changed

+246
-0
lines changed

6 files changed

+246
-0
lines changed

.gitattributes

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# VB6 source files (show diff + keep CRLF in zip download)
2+
3+
*.bas working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6
4+
*.cls working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6
5+
*.ctl working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6
6+
*.dob working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6
7+
*.dsr working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6
8+
*.frm working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6
9+
*.pag working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6
10+
*.vbg working-tree-encoding=CP1252 text eol=crlf
11+
*.vbl working-tree-encoding=CP1252 text eol=crlf
12+
*.vbp working-tree-encoding=CP1252 text eol=crlf
13+
*.vbr working-tree-encoding=CP1252 text eol=crlf
14+
*.vbw working-tree-encoding=CP1252 text eol=crlf
15+
16+
# Other source files (show diff + LF only in zip download)
17+
18+
*.asm text
19+
*.asp text
20+
*.bat text
21+
*.c text
22+
*.cpp text
23+
*.dsp text
24+
*.dsw text
25+
*.h text
26+
*.idl text
27+
*.java text
28+
*.js text
29+
*.manifest text
30+
*.odl text
31+
*.php text
32+
*.php3 text
33+
*.rc text
34+
*.sln text
35+
*.sql text
36+
*.vb text
37+
*.vbs text
38+
39+
# Binary
40+
41+
*.res binary
42+
*.frx binary
43+
*.ctx binary
44+
*.dsx binary
45+
*.exe binary
46+
*.dll binary
47+
*.ocx binary
48+
*.cmp binary
49+
*.pdb binary
50+
*.tlb binary
51+
*.xls binary
52+
*.doc binary
53+
*.ppt binary
54+
*.xlsx binary
55+
*.docx binary
56+
*.pptx binary
57+
*.chm binary
58+
*.hlp binary
59+
*.jpg binary
60+
*.png binary
61+
*.bmp binary
62+
*.gif binary
63+
*.ico binary
64+
*.zip binary
65+
*.cab binary
66+
*.7z binary
67+
*.gz binary
68+
69+
# Text files but keep as binary (no diff)
70+
71+
# *.cfg text
72+
# *.conf text
73+
# *.csi text
74+
# *.css text
75+
# *.csv text
76+
# *.def text
77+
# *.htm text
78+
# *.html text
79+
# *.inf text
80+
# *.ini text
81+
# *.log text
82+
# *.reg text
83+
# *.rtf text
84+
# *.txt text
85+
# *.url text
86+
# *.xml text

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.scc
2+
*.dca
3+
*.oca
4+
*.obj
5+
vb*.tmp
6+
@PSC*

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<div align="center">
2+
3+
## Start Button Controller
4+
5+
6+
</div>
7+
8+
### Description
9+
10+
It shows you how to enable/disable Start button. (Well, though I looked through the previous submissions, I didn't see such a code. Maybe I missed it I don't know. Anyway, it may be of use to some of you, especially for those who want to restrict user.
11+
12+
### More Info
13+
14+
Windows API, window handles and classes
15+
16+
Enabling/Disabling Start button
17+
18+
It was tested on Windows 98/NT4/2000. The result was successful.Anyway, save your critical data prior to executing this code. (I did't)
19+
20+
By the way, the code was written in VB6 SP3. With slight modifications, it should work in VB5 and VB4 32-bit as well.
21+
22+
23+
<span> |<span>
24+
--- |---
25+
**Submitted On** |2000-09-15 15:59:04
26+
**By** |[QuaPro](https://github.com/Planet-Source-Code/PSCIndex/blob/master/ByAuthor/quapro.md)
27+
**Level** |Advanced
28+
**User Rating** |4.0 (8 globes from 2 users)
29+
**Compatibility** |VB 4\.0 \(32\-bit\), VB 5\.0, VB 6\.0
30+
**Category** |[Windows API Call/ Explanation](https://github.com/Planet-Source-Code/PSCIndex/blob/master/ByCategory/windows-api-call-explanation__1-39.md)
31+
**World** |[Visual Basic](https://github.com/Planet-Source-Code/PSCIndex/blob/master/ByWorld/visual-basic.md)
32+
**Archive File** |[CODE\_UPLOAD99079152000\.zip](https://github.com/Planet-Source-Code/quapro-start-button-controller__1-11491/archive/master.zip)
33+
34+
35+
36+
37+
38+
39+
40+

StartButton.vbp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Type=Exe
2+
Form=frmMain.frm
3+
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\WINDOWS\SYSTEM\STDOLE2.TLB#OLE Automation
4+
IconForm="frmMain"
5+
Startup="frmMain"
6+
Command32=""
7+
Name="StartButton"
8+
HelpContextID="0"
9+
CompatibleMode="0"
10+
MajorVer=1
11+
MinorVer=0
12+
RevisionVer=0
13+
AutoIncrementVer=0
14+
ServerSupportFiles=0
15+
VersionCompanyName="SBT"
16+
CompilationType=0
17+
OptimizationType=0
18+
FavorPentiumPro(tm)=0
19+
CodeViewDebugInfo=0
20+
NoAliasing=0
21+
BoundsCheck=0
22+
OverflowCheck=0
23+
FlPointCheck=0
24+
FDIVCheck=0
25+
UnroundedFP=0
26+
StartMode=0
27+
Unattended=0
28+
Retained=0
29+
ThreadPerObject=0
30+
MaxNumberOfThreads=1
31+
32+
[MS Transaction Server]
33+
AutoRefresh=1

StartButton.vbw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
frmMain = 0, 0, 530, 448, Z, 198, 198, 728, 646, C

frmMain.frm

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
VERSION 5.00
2+
Begin VB.Form frmMain
3+
BorderStyle = 1 'Fixed Single
4+
Caption = "Find Start Button"
5+
ClientHeight = 930
6+
ClientLeft = 45
7+
ClientTop = 330
8+
ClientWidth = 3135
9+
BeginProperty Font
10+
Name = "Tahoma"
11+
Size = 8.25
12+
Charset = 0
13+
Weight = 400
14+
Underline = 0 'False
15+
Italic = 0 'False
16+
Strikethrough = 0 'False
17+
EndProperty
18+
LinkTopic = "Form1"
19+
MaxButton = 0 'False
20+
MinButton = 0 'False
21+
ScaleHeight = 930
22+
ScaleWidth = 3135
23+
StartUpPosition = 2 'CenterScreen
24+
Begin VB.ListBox List1
25+
Height = 255
26+
Left = 120
27+
TabIndex = 1
28+
Top = 90
29+
Width = 2895
30+
End
31+
Begin VB.CommandButton btnStatus
32+
Caption = "Disable Start button"
33+
Height = 375
34+
Left = 120
35+
TabIndex = 0
36+
Top = 480
37+
Width = 2895
38+
End
39+
End
40+
Attribute VB_Name = "frmMain"
41+
Attribute VB_GlobalNameSpace = False
42+
Attribute VB_Creatable = False
43+
Attribute VB_PredeclaredId = True
44+
Attribute VB_Exposed = False
45+
Option Explicit
46+
47+
48+
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
49+
' if fEnable=0 then you disable the window. if 1, you enable it.
50+
51+
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
52+
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
53+
54+
Private xText(1) As String
55+
Private Toggle As Long
56+
Private StartButtonHandle As Long
57+
58+
Private Sub btnStatus_Click()
59+
Dim Funk As Long
60+
61+
Toggle = (Toggle + 1) Mod 2
62+
63+
btnStatus.Caption = xText(Toggle)
64+
Funk = EnableWindow(StartButtonHandle, Toggle)
65+
End Sub
66+
67+
Private Sub Form_Load()
68+
Dim hWParent As Long
69+
70+
Toggle = 1
71+
72+
hWParent = FindWindow("Shell_TrayWnd", vbNullString)
73+
StartButtonHandle = FindWindowEx(hWParent, 0&, "Button", vbNullString)
74+
75+
List1.AddItem "Start button handle : " + Trim(Str(StartButtonHandle))
76+
77+
xText(1) = "Disable Start button"
78+
xText(0) = "Enable Start button"
79+
80+
End Sub

0 commit comments

Comments
 (0)