Private Declare Function GetModuleFileName Lib "kernel32" _
Alias "GetModuleFileNameA" _
(ByVal hModule As Long, _
ByVal lpFileName As String, _
ByVal nSize As Long) As Long
Private Sub Form_Load()
'Set the command button names
Command1.Caption = "Different Project and Executable Names"
Command2.Caption = "Similar File Names"
End Sub
Private Sub Command1_Click()
'Click this button if the project name and the compiled file
'name are different.
MsgBox VB.App.EXEName
End Sub
Private Sub Command2_Click()
'Click this button if the project name and the compiled file
'name are the same.
wow, a bunch of stars for that one there Iwarez... but I'm still in question of WHY anybody wouldn't know if they were running their app from an executable or not. Somebody tell me how this would ever be an issue. This isn't a flame, I just can't figure out the point on this one.
Tuna, you may need to take different actions if in design mode. For instance I had a recent app that, amongst other things, sent a set of text messages. Once that bit worked, I didn't really want to send the whole lot every time in IDE.
Me, being thick, just Remmed that bit out, but I could have used this much cleverer system if I'd thought of it!
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
For example:
- Functions like Createmutex for prev instance checking I don't want to be executed in design time. (I know BTW of the App.Previntance function, I just don't want to use it)
- Subclassing I don't always want to use within the IDE. Once it works I disable it inside the IDE for more stability.
- Low level keyboard hooks I disable within the IDE. (I use it to disable the Windows key and Alt-Tab)
- Password screens are very nice within an application, but do you want to be bothered everytime you enter a password protected section of your program?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.