home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_code1
/
datetime
/
datetim1.frm
(
.txt
)
next >
Wrap
Visual Basic Form
|
1991-11-04
|
10KB
|
201 lines
FullWindow
DateTime
IIIII
Form1
Zeitmesser
&Menu
MenuClick
&Click
Separator1
MenuFormat
dddd ddddd ttttt
MenuFormat
dddd ddddd hh:mm
MenuFormat
ddd ddddd hh:mm
MenuFormat
dddd d-mmmm-yy h:mm:ss
MenuFormat
ddd dd-mmm-yy hh:mm
MenuFormat
ddd d/m/yy h:mm
MenuFormat
Enter your own format
Separator2
MenuAbout
&About...
MenuHelp
&Help
INIFILENAME
HelpFilePath
DTFormat
Form_Unload
Abbrechen
WindowState]
NORMALN
WritePrivateProfileString!
Left'
MenuClick
Checked
MenuFormat3
Caption4
Form_Paint
DatTim
CurrentXx
Width
SmallWindow
Form_Loadh
Initializeb
GetPrivateProfileInt
GetPrivateProfileString
Clear_MenuFormat_CheckmarksO
TRUEB
hModule
GetClassWord
GCW_HMODULE
GetModuleFileName
Zeitmesser
Interval
Form_Resize
MINIMIZEDn
MenuAbout_Click
MenuClick_Click
MenuHelp_Click
SH_NORMAL_FOCUS
ErrNo
MB_OK
MB_ICONSTOP
MenuFormat_ClickN
Index%
FALSE
Zeitmesser_Timer]
iZeitmesser;
ActiveWindow
SystemFocus
GetActiveWindow
SetFocusAPI
DatTimOld
GetWindow
GW_OWNER
Visible
GW_HWNDFIRST
Flags
SWP_NOMOVE
SWP_NOSIZE
SWP_SHOWWINDOW
SWP_NOACTIVATE
SetWindowPos
Separator1_ClickZ
Program related declarations
DATETIME.INI
Form_Unload
To make sure the parameters of the NORMAL window are saved,
not the ones of the icon in case the form is minimized:
Write all parameters into DATETIME.INI:
DateTime
DateTime
DateTime
Click"
DateTime
FormatString
DateTime
FormatNumber
Make sure the other form is unloaded also:
Form_Paint
DatTim$ is a global variable containing the text to be displayed:
SmallWindow shall always follow FullWindow but is hiddeni
as long FullWindow is active:
Form_Load
Get parameters from file (INIFILENAME$):o
DateTime
DateTime
DateTime
Click"
Remove trailing Chr$(0) and other stuff
Remove leading and trailing blanksr
DateTime
FormatString
Enter your own format"
Remove trailing Chr$(0) and other stuff
Remove leading and trailing blanksr
DateTime
FormatNumber
Determine DTFormat$ and put check mark next to active format:
Determine own path to find help file later.
First get own path and file name:
Remove chr$(0) and other stuff
Remove extension and replace with .WRI:
Initialize display string:
Initializing, one moment please...
Load start timer which runs for one second only, then forces:
WindowState from MINIMIZED to NORMAL to facilitate loadinge
from the WIN.INI load= line:o
Form_Resize
Zeitmesser(1) timer when resized from icon to normal:
WindowState = MINIMIZED, i.e. an icon
If resized to icon then stop timer to reduce system load,
hide the small form and clear text so it does not display
over the icon:
WindowState
Let the small form always follow the primary one:
MenuAbout_Click
DateTime
Copyright
1991
A.C.I. GmbH MicroSysteme
Hans-Georg Michna"
74776.2361@compuserve.com"
Select Help for more info.
MenuClick_Click
MenuHelp_Click
The help file path of DATETIME.WRI has been determined in Sub Form_Load
WRITE.EXE
WRITE.EXE not found.
Install Windows properly."
Error"
Initialize
Set general constants that cannot be declared:d
MenuFormat_Click
Make sure that the window is repaintede
which may have been obscured by the unfolding menu:
Ask user for its own format string:
Date and time codes:
d..dddd"
Month:
m..mmmm"
Year:"
yy or yyyy
Full date: ddddd
Hour:"
h or hh"
Minute:"
m or mm"
Second: s or ss"
Full time: ttttt
Date delimiter: /"
Example: d/m/yy h:mm
Enter Your Own Format"
Now try if this string really works:
Invalid format string:
First format activated instead. Click on Help to get more information.
Format String Error"
Common procedure for all menu items:
Clear_MenuFormat_Checkmarks
Zeitmesser_Timer
Start timer, runs only for a short time after loading:
Just loaded and a short time passed; time to resize
to NORMAL, but then put focus back to where it wase
(presumably Program Manager):
The start timer has fulfilled its purpose and will now be disabled for good:a
iZeitmesser% = 1, i.e. main seconds timer
For repaint purposes the string is kept in the global variable DatTim$
Check if got system focus:t
In case FullWindow was moved put SmallWindow behind again:a
Still have focus:
Focus was lost:
Replace FullWindow with SmallWindow:l
Not visible, i.e. borderless SmallWindow is visible
If necessary, bring to top:
Visible/Not Visible
iZeitmesser% = 1