|
-
Feb 28th, 2001, 06:35 PM
#1
Thread Starter
New Member
hello,
i am a newbie at vb.
i what also a programm like win popup. is there someone who can send me an example for this prog.
i what study the source for learning an modify.
thanks from germany
frank
//[email protected]
-
Mar 1st, 2001, 03:18 PM
#2
Member
Hallo Frank,
welche Art von Popup Fenster willst Du denn machen?
Wenn mit der rechten Maustaste auf irgendwas geklickt wird?
Oder einfach eine MsgBox?
Private Sub Command1_Click()
Dim intResult As Integer
intResult = MsgBox("Hello!", vbOKOnly, "Das ist eine Message Box!")
End Sub
Grüße,
Susn
-
Mar 1st, 2001, 06:10 PM
#3
Thread Starter
New Member
win popup
hallo susn,
es gibt ein programm das als zusatztool bei win95 oder nt auf der cd dabei ist und es nennt sich win popup. damit kann man textnachrichten über das lokale netz versenden.
so etwas ähnliches möchte ich haben.
frank
-
Mar 2nd, 2001, 06:24 AM
#4
New Member
winpop up
Code in frmAbout:
Option Explicit
Private Sub CmdAction_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim strAbt As String
strAbt = Space(4) & "NetSend Builder" & vbCrLf
strAbt = strAbt & Space(5) & "Version : " & App.Major & "." & Format(App.Minor, "00") & "." & Format(App.Revision, "00") & vbCrLf
strAbt = strAbt & Space(5) & "Developed By: Chris. CHANG" & vbCrLf
strAbt = strAbt & Space(5) & Chr(169) & " 2000"
lblAbt.Caption = strAbt
End Sub
Code in frmMain (Startobjekt)
Option Explicit
Private tvw As Node
Private Const REG_SZ = 1
Private Const REG_DWORD = 4
Private Const HKEY_CURRENT_USER = &H80000001
Private objREG As CRegistry.Registry
Private Sub CmdAction_Click()
Dim msg As String
If txtMessage <> "" And lblClient(1).Caption <> "" Then
msg = "Net Send " & lblClient(1).Caption & " " & txtMessage.Text
Shell msg, vbHide
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
txtDomain.Move 1100, 50, 1900, 285
txtDomain.SetFocus
Set objREG = New CRegistry.Registry
'Get the old setting from registry
Dim FORM_LEFT As Long
Dim FORM_TOP As Long
Dim EX_DOMAIN As String
EX_DOMAIN = objREG.GET_STRING_VALUE(HKEY_CURRENT_USER, "Software\Net Send Builder", "Domain", REG_SZ)
FORM_LEFT = objREG.GET_STRING_VALUE(HKEY_CURRENT_USER, "Software\Net Send Builder", "Left", REG_SZ)
FORM_TOP = objREG.GET_STRING_VALUE(HKEY_CURRENT_USER, "Software\Net Send Builder", "Top", REG_SZ)
Me.Move FORM_LEFT, FORM_TOP
If EX_DOMAIN <> "" Then
txtDomain.Text = EX_DOMAIN
If Load_Client(EX_DOMAIN) <> 0 Then
CmdAction.Enabled = True
Else
CmdAction.Enabled = False
End If
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'Store all the setting into the regsitry
'Last Domain
If objREG.GET_STRING_VALUE(HKEY_CURRENT_USER, "Software\Net Send Builder", "Domain", REG_SZ) = "" Then
objREG.CREATE_REG_STRING HKEY_CURRENT_USER, "Software\Net Send Builder", "Domain", REG_SZ, tvwClient.Nodes.Item(1)
Else
objREG.SET_STRING_VALUE HKEY_CURRENT_USER, "Software\Net Send Builder", "Domain", REG_SZ, tvwClient.Nodes.Item(1)
End If
'Left
If objREG.GET_STRING_VALUE(HKEY_CURRENT_USER, "Software\Net Send Builder", "Left", REG_SZ) = "" Then
objREG.CREATE_REG_STRING HKEY_CURRENT_USER, "Software\Net Send Builder", "Left", REG_SZ, frmMain.Left
Else
objREG.SET_STRING_VALUE HKEY_CURRENT_USER, "Software\Net Send Builder", "Left", REG_SZ, frmMain.Left
End If
'Top
If objREG.GET_STRING_VALUE(HKEY_CURRENT_USER, "Software\Net Send Builder", "Top", REG_SZ) = "" Then
objREG.CREATE_REG_STRING HKEY_CURRENT_USER, "Software\Net Send Builder", "Top", REG_SZ, frmMain.Top
Else
objREG.SET_STRING_VALUE HKEY_CURRENT_USER, "Software\Net Send Builder", "Top", REG_SZ, frmMain.Top
End If
Set objREG = Nothing
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim strDomain As String
Select Case Button.Key
Case "mnuDomain"
Case "mnuAbout"
Load frmAbout
frmAbout.Show vbModal
Case "mnuExit"
Unload Me
End
End Select
End Sub
Private Function Load_Client(ByVal lpDomain As String) As Integer
On Error GoTo ErrHandle
Dim TheDomain As IADsDomain
Dim Computer As IADsComputer
Dim strDomain As String
Dim iMousePointer As Integer
'Use the WinNT Directory Services
strDomain = "WinNT://" & lpDomain
'Initialize the User Interface
tvwClient.Nodes.Clear
iMousePointer = Me.MousePointer
Me.MousePointer = vbHourglass
'Create the Domain object
Set TheDomain = GetObject(strDomain)
'Search for Computers in the Domain
TheDomain.Filter = Array("Computer")
'Create the Domain tree node
Set tvw = tvwClient.Nodes.Add(, , "K0", UCase(lpDomain), "ImgDomain", "ImgDomain")
Set tvw = Nothing
For Each Computer In TheDomain
Set tvw = tvwClient.Nodes.Add("K0", tvwChild, "K" & UCase(Computer.Name), Computer.Name, "ImgClient", "ImgClient")
Set tvw = Nothing
Next Computer
If tvwClient.Nodes.Count > 1 Then tvwClient.Nodes.Item(1).Expanded = True
'Clean up
Me.MousePointer = iMousePointer
Set Computer = Nothing
Set TheDomain = Nothing
Load_Client = 1
Exit Function
ErrHandle:
Load_Client = 0
Me.MousePointer = vbDefault
tvwClient.Nodes.Clear
MsgBox "Error :" & Err.Number & ", " & Err.Description, vbExclamation + vbOKOnly, "Net Send Builder"
End Function
Private Sub tvwClient_NodeClick(ByVal Node As MSComctlLib.Node)
If Node.Index = 1 Then
lblClient(1).Caption = ""
CmdAction.Enabled = False
Else
lblClient(1).Caption = Node.Text
CmdAction.Enabled = True
End If
End Sub
Private Sub txtDomain_GotFocus()
txtDomain.SelStart = 0
txtDomain.SelLength = Len(txtDomain)
End Sub
Private Sub txtDomain_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtDomain <> "" Then
If Load_Client(txtDomain) <> 0 Then
CmdAction.Enabled = True
Else
CmdAction.Enabled = False
End If
End If
End If
End Sub
Um den Aufbau und das Aussehen der Formen musst Du dich noch selber kümmern ...
Der Code ist irgendwo aus dem Internet, ich hab ihn auch nur kopiert .... wie Du im Code siehst ist von irgendjemandem der Chan heisst .....
Da Du keine Mailadresse angegeben hast kann ich dir das komplette Beispielprogramm nicht schicken (zip File)
Grüße,
RedZack
-
Mar 2nd, 2001, 07:21 AM
#5
Thread Starter
New Member
win popup
hallo redzack,
meine e-mail adresse ist
[email protected].
danke fürs posting
-
Mar 2nd, 2001, 08:10 AM
#6
New Member
email
Hast Du noch eine andere E-Mail Adresse, diese scheint mir nicht zu funktionieren.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|