home *** CD-ROM | disk | FTP | other *** search
- VBEX4
- VISUAL BASICS Example 4
- Form1
- Label1
- Program Name:
- lbl_InfoCaption
- LBL_InfoCaption
- lbl_Info
- LBL_Info
- FileMain
- &File
- FileExti
- E&xit
- Form_Click
- GetModuleFileName
- hModule2
- lpFilename
- nSize
- GCW_HMODULEv
- GetClassWord
- nIndex'
- GetActiveWindow
- AsInteger
- EXEName/
- hMyModule
- ModuleHandle
- EXEFileName,
- SuccessS
- ThisEXENameZ
- FileName_Clickl
- FileExti_Click
- Form_KeyUpn
- KeyCode
- Shift
- Form_MouseDown
- Buttonb
- Form_LostFocus
- @ Form_Load
- SepPathNFileName
- Fullname
- PathName
- FileName"
- SUCCEED
- ColonPos
- BslashPos
- Saveddir
- DriveErr
- ErrorHandler
- LastOne
- SlashPos
- HelpLoc_Click
- Result
- SepPath
- Lbl_InfoCaption
- Caption
- Lbl_Info
- Memory
- ProcessorV
- GetWinInfo
- GetFreeSpacel
- wFlags
- GetWinFlags;
- WF_STANDARD
- WF_ENHANCED
- WF_80x87
- WinFlags
- NulLoc
- InstrEXEFileName
- Label1
- VBEX4
- Kernel}
- Kernel
- Kernel
- global to the form, loaded upon form load
- EXEName
- Author:
- Barry Seymouri
- Date:
- 13Mar92
- Explanation: This Function returns a string containing the
- name of the EXE file for the current program.
- The GetModuleFileName function call is a Windows APIg
- call defined in the declarations section of this module
- or in the global module.a
- Use GetActiveWindow to get the currently active window.
- Since this function is called from within your program, the
- unavoidable conclusion is that YOUR program is the currently
- active window.
- We need to use GetClassWord to obtain a handle to our module.
- This is the first parameter required by GetModuleFileName. In
- addition, we need to prepare a return buffer long enough to hold
- our EXE name:n
- Get the Module File name!
- Trim off everything after the Null character...o
- there's the return value
- FileExti_Click
- Form_Load
- Memory Mode:
- Free Memory:
- Math CoProcessor:"
- MUST SHOW WINDOW TO MAKE IT ACTIVE!
- Program Name:
- SepPathNFileName
- This function parses a Fullname and attempts to break it down into PathName and Filename.
- It returns SUCCEED or FAIL.n
- It will FAIL if...
- A colon is found anywhere other than the 2nd position or not at all.N
- If the function fails, it will return FAIL and FileName will return a string
- which describes the error which caused the function to fail.
- First Check to see if FileName is in fact a SUBDIRECTORY:-
- drive and/or path spec. NO Filename.
- If we've gotten this far, Fullname is not justO
- a directory name. Parse...
- No colon or backslash
- GetWinInfo
- 386 Enhanced
- Standard
-