vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Mails senden, abrufen und decodieren - ganz easy ;-)  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Allgemeine Diskussionen
was hab ich falsch gemacht (code) 
Autor: NeedHelp
Datum: 02.04.03 15:44

Hi . bei mir kommt immer so ne Fehler Meldung :

Can't show non-modal when form modal displayed

Hier mein Code :

Form1Main:
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
If Option1 Then
Formger.Show
Else: If Option2 Then Formeng.Show
End If
End Sub
Formeng:[
code]Option Explicit
' zunächst die benötigten API-Deklarationen
Private Declare Function CreateToolhelpSnapshot Lib _
"Kernel32" Alias "CreateToolhelp32Snapshot" ( _
ByVal lFlgas As Long, ByVal lProcessID As Long) _
As Long
Private Declare Function ProcessFirst Lib "Kernel32" _
Alias "Process32First" (ByVal hSnapshot As Long, _
uProcess As PROCESSENTRY32) As Long
Private Declare Function ProcessNext Lib "Kernel32" _
Alias "Process32Next" (ByVal hSnapshot As Long, _
uProcess As PROCESSENTRY32) As Long
Private Declare Sub CloseHandle Lib "Kernel32" ( _
ByVal hPass As Long)
Private Const TH32CS_SNAPPROCESS As Long = 2&
Private Const MAX_PATH As Long = 260
Private Type PROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwflags As Long
szexeFile As String * MAX_PATH
End Type
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Dim Fn As Integer
Private Sub Command1_Click()
Shell (Text2.Text & " " & Text1.Text)
End Sub
Private Sub Command2_Click()
Fn = FreeFile
Open App.Path & "\Config.INI" For Output As #Fn
Write #Fn, Text2.Text
Close #Fn
End Sub
Private Sub Command3_Click()
Text2.Text = ""
Text2.Enabled = True
Kill App.Path & "\Config.INI"
End Sub
Private Sub Command4_Click()
Dim OFName As OPENFILENAME
OFName.lStructSize = Len(OFName)
'Set the parent window
OFName.hwndOwner = Me.hWnd
'Set the application's instance
OFName.hInstance = App.hInstance
'Select a filter
OFName.lpstrFilter = "ArmyOps (*.exe)" + Chr$(0) + "*ArmyOps.exe" + Chr$(0)
'create a buffer for the file
OFName.lpstrFile = Space$(254)
'set the maximum length of a returned file
OFName.nMaxFile = 255
'Create a buffer for the file title
OFName.lpstrFileTitle = Space$(254)
'Set the maximum length of a returned file title
OFName.nMaxFileTitle = 255
'Set the initial directory
OFName.lpstrInitialDir = "C:\"
'Set the title
OFName.lpstrTitle = "Open File "
'No flags
OFName.flags = 0
'Show the 'Open File'-dialogIf GetOpenFileName(OFName) Then
If GetOpenFileName(OFName) Then
Text2.Text = "" + Trim$(OFName.lpstrFile)
End If
End Sub
Private Sub Form_Load()
Dim Text As String
On Error GoTo ErrLog
Fn = FreeFile
Open App.Path & "\Config.INI" For Input As #Fn
Text = Input(LOF(Fn), 1)
Text2.Text = Mid$(Text, 2, Len(Text) - 4)
Close #Fn
Exit Sub
ErrLog:
MsgBox ("Config File not found please set your settings or replace the Config.INI File")
End Sub


' Prüft, ob eine EXE-Datei bereits ausgeführt wird
Private Function IsEXERunning(ByVal sFilename As String) As Long
Dim lSnapshot As Long
Dim uProcess As PROCESSENTRY32
Dim nResult As Long

' "Snapshot" des aktuellen Prozess ermitteln
lSnapshot = CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&)
If lSnapshot <> 0 Then
uProcess.dwSize = Len(uProcess)

' Ersten Prozess ermitteln
nResult = ProcessFirst(lSnapshot, uProcess)

Do Until nResult = 0
' Prozessliste durchlaufen
If InStr(LCase$(uProcess.szexeFile), LCase$(sFilename)) > 0 Then
' Jepp - EXE gefunden
IsEXERunning = True
Exit Do
End If

' nächster Prozess
nResult = ProcessNext(lSnapshot, uProcess)
Loop

' Handle schliessen
CloseHandle lSnapshot
End If
End Function

Private Sub Timer2_Timer()
If IsEXERunning("ArmyOps.exe") Then
Me.Hide
End If
If Not IsEXERunning("ArmyOps.exe") Then
Me.Show
End If
End SubFormger:
ist das gleiche wie form ger nur das die buttons und so auf Deutsch sind
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
was hab ich falsch gemacht (code)593NeedHelp02.04.03 15:44
Re: was hab ich falsch gemacht (code)428_void02.04.03 16:40
Re: was hab ich falsch gemacht (code)400NeedHelp04.04.03 19:37

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel