Accueil > > > DIALOGUES ENTRES APPLICATIONS
DIALOGUES ENTRES APPLICATIONS
Information sur la source
Description
DIALOGUES ENTRES APPLICATIONS (PAR LA BASE DE REGISTRE) plusieurs applic... pourront se parler et se repondre savoir si une autre applic... nommee est executee elles se reconnaissent par leurs noms d executable ou fichier vbp l applic.... sais qui l'appelle je donnerai des infos sur la fonction BLOCK() si besoin executer les deux projets ils sont identiques mais projet1 dit bonjour ---- projet2 lui repond merci et le nomme .....
Source
- 'projet1------------------------------------------
-
- ''form1--------------------------------*
- Private Sub Form_Load()
- Form1.Caption = App.EXEName ' aff le nom de son application
-
- 'If dialog_test("projet2") Then End ' falcutatif : ne demarre que si le projet2 est lance
-
- Call dialog_init(Form1) ' initialise le dialoge entre applications [ Form1 pour informer ou est Public Sub dialog_recu() ]
- Timer1.Interval = 100 ' le timer qui surveil
-
- Call dialog_env("projet2", "bonjour") ' envois bonjours a l apllication projet2
-
- End Sub
-
- '=============pour gerer les dialogues recus=====================
- Public Sub dialog_recu(appelant, message)
- List1.AddItem appelant & " " & message ' falcutatif
-
- If message = "bonjour" Then Call dialog_env(appelant, "merci " & appelant) ' si bonjour repond par un message a appelant
- ' ect.....
- ' ect.....
- DoEvents
- End Sub
-
- Private Sub Form_Terminate()
- Timer1.Interval = 0 ' stop le timer qui surveil
- Call dialog_fin ' stop le dialog : informe de son inactivite
- ' et efface les traces de messages (si derniere application)
- End Sub
-
- Private Sub Timer1_Timer()
- Call dialog_surveil
- End Sub
-
-
- ''module--------------------------*
- Public Cible As Form
-
- Public Sub dialog_surveil()
- a = block(App.EXEName, 4)
- End Sub
-
- Public Sub dialog_env(app_cible, dial)
- SaveSetting "dialog connect", app_cible, App.EXEName, dial
- End Sub
-
- Public Sub dialog_fin()
- SaveSetting "dialog connect", "inscris", App.EXEName, "inactif"
- a = block("inscris", 1)
- End Sub
-
- Public Sub dialog_init(cible1 As Form)
- SaveSetting "dialog connect", "inscris", App.EXEName, "actif"
- Set Cible = cible1
- End Sub
-
- Public Function dialog_test(a5)
- dialog_test = GetSetting("dialog connect", "inscris", a5) = "inactif"
- End Function
- ''bon courage......
- Public Function block(a2 As String, a3 As Integer) As Variant
-
- Dim avnt As Variant
- Dim bntX As Integer
- Dim app_ins As String
- Dim app_dial As String
-
- If a3 = 0 Then Exit Function
-
-
- block = "0": avnt = GetAllSettings("dialog connect", a2)
- If VarType(avnt) <> 0 Then
- For bntX = 0 To UBound(avnt, 1)
- app_ins = avnt(bntX, 0)
- app_dial = avnt(bntX, 1)
-
- If a3 = 1 And app_dial = "actif" Then block = "1"
- If a3 = 2 Then a = block(app_ins, 3)
- If a3 = 3 Then DeleteSetting "dialog connect", a2, app_ins
- If a3 = 4 Then Call Cible.dialog_recu(app_ins, app_dial)
-
- Next bntX
- If a3 = 4 Then DeleteSetting "dialog connect", App.EXEName
- End If
- If a3 = 1 And block = "0" Then
- a = block("inscris", 2)
- End If
- DoEvents
- End Function
-
-
-
- 'projet2------------------------------------------
-
- ' il vous faut form list timer
- ''form1--------------------------------*
-
- Private Sub Form_Load()
- Form1.Caption = App.EXEName ' aff le nom de son application
-
- 'If dialog_test("projet2") Then End ' falcutatif : ne demarre que si le projet2 est lance
-
- Call dialog_init(Form1) ' initialise le dialoge entre applications [ Form1 pour informer ou est Public Sub dialog_recu() ]
- Timer1.Interval = 100 ' le timer qui surveil
-
- ''Call dialog_env("projet2", "bonjour") ' envois bonjours a l apllication projet2
-
- End Sub
-
- '=====================pour gerer les dialogues recus=====================
- Public Sub dialog_recu(appelant, message)
- List1.AddItem appelant & " " & message ' falcutatif
-
- If message = "bonjour" Then Call dialog_env(appelant, "merci " & appelant) ' si bonjour repond par un message a appelant
- ' ect.....
- ' ect.....
- DoEvents
- End Sub
-
- Private Sub Form_Terminate()
- Timer1.Interval = 0 ' stop le timer qui surveil
- Call dialog_fin ' stop le dialog : informe de son inactivite
- ' et efface les traces de messages (si derniere application)
- End Sub
-
- Private Sub Timer1_Timer()
- Call dialog_surveil
- End Sub
-
- ''module--------------------------*
-
- '''le meme que projet1
'projet1------------------------------------------
''form1--------------------------------*
Private Sub Form_Load()
Form1.Caption = App.EXEName ' aff le nom de son application
'If dialog_test("projet2") Then End ' falcutatif : ne demarre que si le projet2 est lance
Call dialog_init(Form1) ' initialise le dialoge entre applications [ Form1 pour informer ou est Public Sub dialog_recu() ]
Timer1.Interval = 100 ' le timer qui surveil
Call dialog_env("projet2", "bonjour") ' envois bonjours a l apllication projet2
End Sub
'=============pour gerer les dialogues recus=====================
Public Sub dialog_recu(appelant, message)
List1.AddItem appelant & " " & message ' falcutatif
If message = "bonjour" Then Call dialog_env(appelant, "merci " & appelant) ' si bonjour repond par un message a appelant
' ect.....
' ect.....
DoEvents
End Sub
Private Sub Form_Terminate()
Timer1.Interval = 0 ' stop le timer qui surveil
Call dialog_fin ' stop le dialog : informe de son inactivite
' et efface les traces de messages (si derniere application)
End Sub
Private Sub Timer1_Timer()
Call dialog_surveil
End Sub
''module--------------------------*
Public Cible As Form
Public Sub dialog_surveil()
a = block(App.EXEName, 4)
End Sub
Public Sub dialog_env(app_cible, dial)
SaveSetting "dialog connect", app_cible, App.EXEName, dial
End Sub
Public Sub dialog_fin()
SaveSetting "dialog connect", "inscris", App.EXEName, "inactif"
a = block("inscris", 1)
End Sub
Public Sub dialog_init(cible1 As Form)
SaveSetting "dialog connect", "inscris", App.EXEName, "actif"
Set Cible = cible1
End Sub
Public Function dialog_test(a5)
dialog_test = GetSetting("dialog connect", "inscris", a5) = "inactif"
End Function
''bon courage......
Public Function block(a2 As String, a3 As Integer) As Variant
Dim avnt As Variant
Dim bntX As Integer
Dim app_ins As String
Dim app_dial As String
If a3 = 0 Then Exit Function
block = "0": avnt = GetAllSettings("dialog connect", a2)
If VarType(avnt) <> 0 Then
For bntX = 0 To UBound(avnt, 1)
app_ins = avnt(bntX, 0)
app_dial = avnt(bntX, 1)
If a3 = 1 And app_dial = "actif" Then block = "1"
If a3 = 2 Then a = block(app_ins, 3)
If a3 = 3 Then DeleteSetting "dialog connect", a2, app_ins
If a3 = 4 Then Call Cible.dialog_recu(app_ins, app_dial)
Next bntX
If a3 = 4 Then DeleteSetting "dialog connect", App.EXEName
End If
If a3 = 1 And block = "0" Then
a = block("inscris", 2)
End If
DoEvents
End Function
'projet2------------------------------------------
' il vous faut form list timer
''form1--------------------------------*
Private Sub Form_Load()
Form1.Caption = App.EXEName ' aff le nom de son application
'If dialog_test("projet2") Then End ' falcutatif : ne demarre que si le projet2 est lance
Call dialog_init(Form1) ' initialise le dialoge entre applications [ Form1 pour informer ou est Public Sub dialog_recu() ]
Timer1.Interval = 100 ' le timer qui surveil
''Call dialog_env("projet2", "bonjour") ' envois bonjours a l apllication projet2
End Sub
'=====================pour gerer les dialogues recus=====================
Public Sub dialog_recu(appelant, message)
List1.AddItem appelant & " " & message ' falcutatif
If message = "bonjour" Then Call dialog_env(appelant, "merci " & appelant) ' si bonjour repond par un message a appelant
' ect.....
' ect.....
DoEvents
End Sub
Private Sub Form_Terminate()
Timer1.Interval = 0 ' stop le timer qui surveil
Call dialog_fin ' stop le dialog : informe de son inactivite
' et efface les traces de messages (si derniere application)
End Sub
Private Sub Timer1_Timer()
Call dialog_surveil
End Sub
''module--------------------------*
'''le meme que projet1
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
SESSION SILVERLIGHT 5 3D : SLIDES ET DEMOSSESSION SILVERLIGHT 5 3D : SLIDES ET DEMOS par Groc
Durant les techdays, j'ai eu le plaisir d'animer une session sur Silverlight 5 et la 3D avec Simon Ferquel. Comme promis, voici nos slides et mes démos (celles avec le viper BSG) ici et là. Pour mémoire, les démos utilisent toutes le viper BSG...
Cliquez pour lire la suite de l'article par Groc [TECHDAYS 2012] SESSION WEBMATRIX 2 : LE COUTEAU SUISSE GRATUIT POUR VOS DéVELOPPEMENTS WEB - SLIDES[TECHDAYS 2012] SESSION WEBMATRIX 2 : LE COUTEAU SUISSE GRATUIT POUR VOS DéVELOPPEMENTS WEB - SLIDES par gpommier
Suite à la session que j'ai présenté sur WebMatrix 2, vous pouvez trouver les slides ici, ainsi que les démos en packages nuget : démos1 et démos2 J'en profite pour remercier chaleureusement tous ceux qui sont venus très nombreux à cette sess...
Cliquez pour lire la suite de l'article par gpommier [SHAREPOINT] LES SESSIONS TECHDAYS 2012.[SHAREPOINT] LES SESSIONS TECHDAYS 2012. par Patrick Guimonet
Voici donc pour ceux qui n'ont pas pu venir, ou ceux qui n'ont pas pu toutes les suivre la liste des sessions SharePoint aux TechDays 2012, que je mettrais à jour dès que les liens des vidéo seront disponibles. Ou ici : http...
Cliquez pour lire la suite de l'article par Patrick Guimonet TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3 par ROMELARD Fabrice
Speaker: Bernard Ourghanlian Cette session est comme chaque jour transmise en live par BrainSonic, et j'ai donc suivi cette troisième pleinière par ce moyen sur mon iPad . Elle est dédiée comme chaque année à la mise en perspective de l'é...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE !MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE ! par Vko
Hier durant une session dédiée aux Techdays 2012, j'ai eu le plaisir d'annoncer la sortie de la Béta 2 de Mishra Reader. C'est quoi ? Pour les utilisateurs, c'est une vraie expérience de lecture de flux RSS sur Windows. Rien à voir avec les produit...
Cliquez pour lire la suite de l'article par Vko
Logiciels
PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|